generative-ai-docs icon indicating copy to clipboard operation
generative-ai-docs copied to clipboard

Gemini REST API implemented in NodeJs application works on localhost but fails in production

Open petrong opened this issue 1 year ago • 4 comments

Description of the bug:

Gemini REST API implemented in NodeJs application works on localhost but fails in production. Returns 502 error seen below

Gemini endpoint used: https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=$API_KEY

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

Error log in server Apache Ubuntu 20.04 gives

[proxy_http:error] [pid 756595] (70007)The timeout specified has expired: ....AH01102: error reading status line from remote server localhost:5001 [proxy:error] [pid 756595] ...AH00898: Error reading from remote server returned by /gig/geminize

Can I get any help to resolve this urgently please?

Thanks

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

petrong avatar Feb 14 '24 13:02 petrong

So I attempted to send this API request to Gemini API via my server terminal..

like this:

sudo curl -X POST -H "Content-Type: application/json" -d '{"contents": [{
"parts":[{"text": "Write a story about the Christian faith."}]}]}' "https://generativelanguage.googleapis.com/v1beta/mod
els/gemini-pro:generateContent?key=API_KEY"

and here was the outcome:

{
  "error": {
    "code": 400,
    "message": "User location is not supported for the API use.",
    "status": "FAILED_PRECONDITION"
  }
}

My server location is England, so I asked Google Bard the below:

Is Gemini REST API supported in England?

The reponse:

As of today, February 14, 2024, the Gemini REST API is not currently supported in England.

  • Reason: Gemini temporarily disabled all API functionalities for UK customers on November 22nd, 2023 to comply with the UK Travel Rule.
  • Expected time frame: They are working to re-enable the API with compliant features and aim to resume service in January 2024. However, due to today's date, it seems that the service hasn't resumed yet.

Here are some helpful resources:

Since I am trained on a massive dataset of text and code, I can offer different information depending on how you phrase your questions. As such, let me know if you have any further questions or need clarification on a specific aspect of the Gemini API's availability in England.

I critically need this API to implement live chat for an urgent project. Does this Google Bard response mean the end of the road for me?

Any help would be appreciated.

petrong avatar Feb 14 '24 14:02 petrong

https://ai.google.dev/available_regions

Is there any workaround for me? Though my server is situated in England, I am not. I am in Africa

petrong avatar Feb 14 '24 14:02 petrong

geminapi It seems UK is out of the available regions list

jeevanism avatar Feb 25 '24 21:02 jeevanism

That's sad. Are people from UK still can't get access as of now?

AmineAouragh avatar Oct 15 '24 14:10 AmineAouragh