fix: change ScoreRequest json_schema_extra from examples list to example dict
Swagger UI Try it out was sending the {summary, value} wrapper as request body
instead of just the value contents, causing 422 errors. The 'example' (singular)
key is correctly used as the schema-level example by Swagger UI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -408,10 +408,7 @@ class ScoreRequest(BaseModel):
|
|||||||
|
|
||||||
model_config = ConfigDict(
|
model_config = ConfigDict(
|
||||||
json_schema_extra={
|
json_schema_extra={
|
||||||
"examples": [
|
"example": {
|
||||||
{
|
|
||||||
"summary": "基础评分请求",
|
|
||||||
"value": {
|
|
||||||
"question": "双源CT的时间分辨率是多少?",
|
"question": "双源CT的时间分辨率是多少?",
|
||||||
"answer": "双源CT的单扇区时间分辨率为75ms。",
|
"answer": "双源CT的单扇区时间分辨率为75ms。",
|
||||||
"contexts": "双源CT采用两套管-探测器系统 |||| 单扇区采集旋转135度",
|
"contexts": "双源CT采用两套管-探测器系统 |||| 单扇区采集旋转135度",
|
||||||
@@ -425,9 +422,7 @@ class ScoreRequest(BaseModel):
|
|||||||
],
|
],
|
||||||
"judge_model": "deepseek-v4-flash",
|
"judge_model": "deepseek-v4-flash",
|
||||||
"embedding_model": "text-embedding-v3",
|
"embedding_model": "text-embedding-v3",
|
||||||
},
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user