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

gpt-engineer #11

Closed 0rtz closed 6 months ago

0rtz commented 6 months ago

Trying to use gemini-openai-proxy with the gpt-engineer I invoke gpt-engineer as following OPENAI_API_KEY=1234 OPENAI_API_BASE=http://localhost:8080/v1 gpt-engineer Tic-tac-toe gpt-3.5-turbo and get the following error on proxy side

2023/12/31 07:50:03 genai get stream message error googleapi: Error 400:
[GIN] 2023/12/31 - 07:50:03 | 200 |  740.287576ms |             ::1 | POST     "/v1/chat/completions"

Not sure if the problem is on proxy side or gpt-engineer side tho

zhu327 commented 6 months ago

This error means that the request parameter has an issue, you should try printing the request parameter

    bs, _ := json.Marshal(req)
    fmt.Printf(string(bs))

https://github.com/zhu327/gemini-openai-proxy/blob/main/api/handler.go#L68

0rtz commented 6 months ago
{"model":"","messages":null,"max_tokens":0,"temperature":0,"top_p":0,"n":0,"stream":false}2024/01/01 17:04:05 genai get stream message error googleapi: Error 400:
[GIN] 2024/01/01 - 17:04:05 | 200 |  649.504851ms |             ::1 | POST     "/v1/chat/completions"
zhu327 commented 6 months ago
{"model":"","messages":null,"max_tokens":0,"temperature":0,"top_p":0,"n":0,"stream":false}2024/01/01 17:04:05 genai get stream message error googleapi: Error 400:
[GIN] 2024/01/01 - 17:04:05 | 200 |  649.504851ms |             ::1 | POST     "/v1/chat/completions"

messages in request data cannot be empty, please confirm if client has bug, this issue is not caused by gemini openai proxy