An error occurs when connecting to the Modelscope API
Zhen-Ming Wu
In version 1.11.12, it is not possible to call the Modelscope community API-Inference(https://www.modelscope.cn/docs/model-service/API-Inference/intro) service normally, and an error is prompted, with the error message being:
API Error: Error from Custom: AI_TypeValidationError: Type validation failed: Value: {"id":"
","object":"chat.completion.chunk","created":1745034731,"model":"deepseek-ai/DeepSeek-R1","system_fingerprint":"","choices":[{"index":0,"delta":{"role":"","content":"","tool_calls":null,"function_calls":null,"reasoning_content":"好的"},"finish_reason":null,"message":{"role":"","content":"","tool_calls":null,"function_calls":null,"reasoning_content":""}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}.
Error message: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"received": "",
"code": "invalid_enum_value",
"options": [
"assistant"
],
"path": [
"choices",
0,
"delta",
"role"
],
"message": "Invalid enum value. Expected 'assistant', received ''"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"error"
],
"message": "Required"
}
],
"name": "ZodError"
}
],
"path": [],
"message": "Invalid input"
}
]