Open AndreJLouw opened 2 months ago
Getting same error
Same setup and same problem.
Same error here, us-central1
same. Firebase function, deployed in us-central1. Tried redeploying to eu-west - same. It worked well several hrs ago. Any change in api?
Same issue on AppEngine with us-west2
same us-central1
[400 Bad Request] User location is not supported for the API use.
... running inside cloud function (gen 2)
GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [400 Bad Request] User location is not supported for the API use.
at handleResponseNotOk (file:///workspace/node_modules/@google/generative-ai/dist/index.mjs:401:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async makeRequest (file:///workspace/node_modules/@google/generative-ai/dist/index.mjs:374:9)
at async generateContent (file:///workspace/node_modules/@google/generative-ai/dist/index.mjs:813:22)
same problem
Same here, @hsubox76 any insight on what the problem is?
Same here, us-central1, functions v2. Switched function to us-west1 - works. But this is not solution if functions are called from app :(
Found another discussion here: https://discuss.ai.google.dev/t/generate-object-error-user-location-is-not-supported-for-the-api-use/37440/21 Could possibly be related to gemini api geoblocking ips of firebase/gcp cloud function calls that originate from "us-central1". The only real solution here is to deploy to several regions simultaneously and implement a failover if one region fails.
Description of the bug:
GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/text-embedding-004:embedContent: [400 Bad Request] User location is not supported for the API use. at handleResponseNotOk (/workspace/node_modules/@google/generative-ai/dist/index.js:403:11)
Actual vs expected behavior:
Completion of request
Any other information you'd like to share?
This worked before, and suddenly just stopped. The API key is on the paid account.
Firebase location: us-central1