Skip to content

Commit 024e7b1

Browse files
author
nrandriamanana
committed
new tag and fix image cache prob
1 parent 4eb1095 commit 024e7b1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/api/models/responses.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,24 @@ class Prediction(BaseModel):
1919

2020
class PredictionResponse(RootModel[Dict[str, Union[Prediction, float, str]]]):
2121
pass
22+
"""
23+
Contract for the normalized prediction responses generated by the model artifact.
24+
25+
Expected flat structure after normalization:
26+
27+
{
28+
"1": Prediction,
29+
"2": Prediction,
30+
...,
31+
"IC": float, # required confidence score
32+
"MLversion": str # required run_id as model version
33+
}
34+
35+
Notes:
36+
- The output reflects what the model artifact produces, but the API applies
37+
`model_dump()` in `predict()` before returning to ensure schema consistency.
38+
- Strong validation is performed during training; inference focuses on lightweight
39+
structural checks for performance.
40+
- Any changes to the output schema (e.g., new fields, renaming) must be documented
41+
both here and in training repo (codif-ape-training) to maintain API contract clarity.
42+
"""

0 commit comments

Comments
 (0)