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

Does this project support accessing the Gemini API through a proxy server? #6

Closed gaozh424 closed 6 months ago

gaozh424 commented 6 months ago

Hi, Thank you for your contribution and sharing, it's really great. Does this project support accessing the Gemini API through a proxy server? I am unable to access Google from my region.

zhu327 commented 6 months ago

I suggest deploying your project in a country where Gemini Pro API is accessible, or adding generativelanguage.googleapis.com to the proxy whitelist in your router, such as in OpenWrt.

This project utilizes the Google Genai SDK, and this feature cannot be implemented until the SDK supports proxy configuration.

zhu327 commented 6 months ago

https://github.com/google/generative-ai-go/issues/17

gaozh424 commented 6 months ago

google/generative-ai-go#17

Thank you very much for your reply. I will try to modify the code in handler.go and recompile to see if it works, or could you add an additional parameter?

zhu327 commented 6 months ago

google/generative-ai-go#17

Thank you very much for your reply. I will try to modify the code in handler.go and recompile to see if it works, or could you add an additional parameter?

Proxy support will not be considered until the issue with Google SDK is confirmed as closed.

zhu327 commented 6 months ago

https://docs.docker.com/engine/reference/commandline/dockerd/#running-a-docker-daemon-behind-an-https_proxy

You can refer to here to configure proxy in docker container