zhu327 / gemini-openai-proxy

A proxy for converting the OpenAI API protocol to the Google Gemini Pro protocol.
MIT License
580 stars 109 forks source link

最新docker latest镜像有bug #27

Closed Zangle-0 closed 8 months ago

Zangle-0 commented 8 months ago

首次对话正常,包含上下文再次对话,返回:"code":400,"message":"message.stringContent: json.Unmarshal: json: cannot unmarshal array into Go value of type string","type":""

zhu327 commented 8 months ago

Provide one post data with context

zhu327 commented 8 months ago
curl http://localhost:8080/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $YOUR_GOOGLE_AI_STUDIO_API_KEY" \
 -d '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "temperature": 0.7
 }'

From the errors above, it is because you used vision data structure on non-vision model, content must be a string, not an object

zhu327 commented 8 months ago

For full information on how to use historical context, please see the OpenAI API docs