fix: align Rust ML service verification

Corrected API response format documentation in README:
- Health endpoint: removed non-existent model_path field
- Metadata endpoint: fixed field names (service_name, service_version instead of service, version) and label order
- Prediction endpoint: corrected response structure to match implementation (single prediction object with probabilities map, not array)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Asep Haryana Saputra
2026-05-23 11:09:16 +00:00
co-authored by Claude Opus 4.7
parent 86371a6e31
commit e2e3addd66
+13 -27
View File
@@ -97,8 +97,7 @@ curl http://localhost:8001/health
```json
{
"status": "ok",
"model_loaded": true,
"model_path": "../../Machine_Learning/model/model.onnx"
"model_loaded": true
}
```
@@ -117,15 +116,16 @@ curl http://localhost:8001/metadata
**Response:**
```json
{
"service": "ZeaVis ML Service",
"version": "0.1.0",
"service_name": "zeavis-ml-service",
"service_version": "0.1.0",
"model_path": "../../Machine_Learning/model/model.onnx",
"model_loaded": true,
"input_size": 224,
"labels": [
"Bercak Daun",
"Hawar Daun",
"Daun Sehat",
"Karat Daun",
"Daun Sehat"
"Hawar Daun"
]
}
```
@@ -149,27 +149,13 @@ curl -X POST http://localhost:8001/predict \
**Response:**
```json
{
"predictions": [
{
"label": "Daun Sehat",
"confidence": 0.95
},
{
"label": "Bercak Daun",
"confidence": 0.03
},
{
"label": "Hawar Daun",
"confidence": 0.01
},
{
"label": "Karat Daun",
"confidence": 0.01
}
],
"top_prediction": {
"label": "Daun Sehat",
"confidence": 0.95
"label": "Daun Sehat",
"confidence": 0.95,
"probabilities": {
"Bercak Daun": 0.02,
"Daun Sehat": 0.95,
"Karat Daun": 0.01,
"Hawar Daun": 0.02
}
}
```