gpt4free
gpt4free copied to clipboard
[GeminiPro] "User location is not supported for the API use" workaround
Is there any way to implement workarounds for the "User location is not supported for the API use" issue in GeminiPro for those in geo-restricted countries, which are described here https://stackoverflow.com/questions/77659552/google-generative-ai-api-error-user-location-is-not-supported-for-the-api-use ?
You need a proxy or a vpn in the country which are allowed by Google Gemini
Sure, I already use Netlify as a proxy, but it would be way more convenient if g4f had native support to workaround this issue.
The proxy support is the native way. ?
:) I meant that if g4f could access the GeminiPro API through VertexAPI, that would be considered the native way.
I can't create a Vertex Account for me. Sorry
Edit: You have to change only the Url maybe:
const API_ENDPOINT = "us-central1-aiplatform.googleapis.com";
const URL = https://${API_ENDPOINT}/v1beta1/projects/${process.env.GOOGLE_KEY}/locations/us-central1/publishers/google/models/gemini-pro:streamGenerateContent;
edit: I added api_base as config: https://github.com/xtekky/gpt4free/pull/1630
Example api_base = "https://us-central1-aiplatform.googleapis.com/v1beta1/projects/${process.env.GOOGLE_KEY}/locations/us-central1/publishers/google"
Thank you. I'll try it and report later.
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Closing due to inactivity.