tudoujunha / gemini-google-extension

Chrome extension to view Gemini results alongside Google search
https://gemini.tudoujunha.com
GNU General Public License v3.0
77 stars 22 forks source link

Gemini API key is configured incorrectly message #14

Closed efendizadery closed 4 months ago

efendizadery commented 4 months ago

When try to use Gemini for Google Chrome extension from VPN connection, get the following error message:

Gemini for Google (v0.1.1) Failed to load response from Gemini: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 ] User location is not supported for the API use without a billing account linked.

Please confirm that your API key is configured correctly here (find AI Provider)

Is this related with corporate VPN restrictions OR I get error due the difference between IP address and location? Gemini error

Extension working well during the direct connection to Internet from another computer.

tudoujunha commented 4 months ago

I have encountered this problem before, your ip is not supported by the region. available regions: https://ai.google.dev/gemini-api/docs/available-regions Your VPN IP needs to be in this available regions.

efendizadery commented 4 months ago

I have encountered this problem before, your ip is not supported by the region. available regions: https://ai.google.dev/gemini-api/docs/available-regions Your VPN IP needs to be in this available regions.

But Google can indicate my exact location and its Azerbaijan (which in the supported region list). Can be changed something in Gemini?

tudoujunha commented 4 months ago

This problem needs to be looked at separately. Can Gemini be used if VPN is not enabled?

You can test the Gemini API on a linux environment. Be careful to keep the IP used by gemini-google-extension the same.

export API_KEY="Your Gemini API KEY"
curl "https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse&key=${API_KEY}" \
        -H 'Content-Type: application/json' \
        --no-buffer \
        -d '{ "contents":[{"parts":[{"text": "Write long a story about a magic backpack."}]}]}' \
        2> /dev/null

Can you also see whether the official web page can open normally? https://aistudio.google.com/app/prompts/new_chat

efendizadery commented 4 months ago

This problem needs to be looked at separately. Can Gemini be used if VPN is not enabled?

You can test the Gemini API on a linux environment. Be careful to keep the IP used by gemini-google-extension the same.

export API_KEY="Your Gemini API KEY"
curl "https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse&key=${API_KEY}" \
        -H 'Content-Type: application/json' \
        --no-buffer \
        -d '{ "contents":[{"parts":[{"text": "Write long a story about a magic backpack."}]}]}' \
        2> /dev/null

Can you also see whether the official web page can open normally? https://aistudio.google.com/app/prompts/new_chat

Yes, Gemini can be used without or with disabled VPN

tudoujunha commented 4 months ago

Being able to use Gemini is different from being able to use the Gemini API. This error is returned directly by the API and is not an extension issue。

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 ] User location is not supported for the API use without a billing account linked.

This error is directly returned by the Gemini API, not an extension error, gemini-google-extension request is works, so I can only recommend that you change the ip test.

Or change the Gemini API BaseURL Endpoint with a new version. https://github.com/tudoujunha/gemini-google-extension/releases/tag/v0.1.2 (v0.1.2 chrome web store is under review)