Closed Nothingness-Void closed 2 months ago
Error 400 means that the input data is incorrect. You need to provide the specific input data of the API call to confirm the problem.
Error 400 means that the input data is incorrect. You need to provide the specific input data of the API call to confirm the problem.
因为我也是用的别人的项目,我也不知道他们的请求格式是怎样的 我尝试了另一个项目 One-API 仅请求vision时 也会返回如下报错
{
"error": {
"message": "message.multiContent: json.Unmarshal: json: cannot unmarshal string into Go value of type []openai.ChatMessagePart (request id: 2024041713413320632400558692646)",
"type": "upstream_error",
"param": "400",
"code": "bad_response_status_code"
}
}
请求别的模型是正常的
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_GOOGLE_AI_STUDIO_API_KEY" \
-d '{
"model": "gpt-4-vision-preview",
"messages": [{"role": "user", "content": [
{"type": "text", "text": "What’s in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]}],
"temperature": 0.7
}'
The data format of GPT-4-vision-preview is different from that of GPT-3.5-turbo. Incorrect data formats will cause errors
请求应用为LobeChat
服务搭建完测试没问题
已增加环境变量使vision指向gemini1.5-pro
正常请求1.5-pro没问题