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 ```json
{ {
"status": "ok", "status": "ok",
"model_loaded": true, "model_loaded": true
"model_path": "../../Machine_Learning/model/model.onnx"
} }
``` ```
@@ -117,15 +116,16 @@ curl http://localhost:8001/metadata
**Response:** **Response:**
```json ```json
{ {
"service": "ZeaVis ML Service", "service_name": "zeavis-ml-service",
"version": "0.1.0", "service_version": "0.1.0",
"model_path": "../../Machine_Learning/model/model.onnx", "model_path": "../../Machine_Learning/model/model.onnx",
"model_loaded": true,
"input_size": 224, "input_size": 224,
"labels": [ "labels": [
"Bercak Daun", "Bercak Daun",
"Hawar Daun", "Daun Sehat",
"Karat Daun", "Karat Daun",
"Daun Sehat" "Hawar Daun"
] ]
} }
``` ```
@@ -149,27 +149,13 @@ curl -X POST http://localhost:8001/predict \
**Response:** **Response:**
```json ```json
{ {
"predictions": [ "label": "Daun Sehat",
{ "confidence": 0.95,
"label": "Daun Sehat", "probabilities": {
"confidence": 0.95 "Bercak Daun": 0.02,
}, "Daun Sehat": 0.95,
{ "Karat Daun": 0.01,
"label": "Bercak Daun", "Hawar Daun": 0.02
"confidence": 0.03
},
{
"label": "Hawar Daun",
"confidence": 0.01
},
{
"label": "Karat Daun",
"confidence": 0.01
}
],
"top_prediction": {
"label": "Daun Sehat",
"confidence": 0.95
} }
} }
``` ```