zhu327 / gemini-openai-proxy

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

400 error code #14

Closed withlin closed 6 months ago

withlin commented 6 months ago
curl http://localhost:8080/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer xxxxx" \
 -d '{
     "model": "gpt-4-vision-preview",
     "messages": [{"role": "user", "content": [
        {"type": "text", "text": "You are a zoological expert who knows what animal it is and what it is thinking"},
        {
          "type": "image_url",
          "image_url": {
            "url": "https://www.wikiwand.com/zh-hans/File:Cat_poster_2.jpg"
          }
        }
     ]}],
     "temperature": 0.7
 }'

{"code":400,"message":"genai send message error: googleapi: Error 400: Request contains an invalid argument.","type":""}%

zhu327 commented 6 months ago

https://www.wikiwand.com/zh-hans/File:Cat_poster_2.jpg

Your url is not an image; you may try to open it with a browser.