Open henriqueArrazao opened 3 months ago
@henriqueArrazao Thank you reporting this issue. This repository is for issues related to JS SDK client bugs or improvements and the client doesn't control the service's responses. For issues related to Gemini API, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below. You can also post this issue on Discourse forum.
Description of the bug:
Locally works fine and in the server not. It's not be cause of the local of the server (Germany) because I tested the Gemini request Curl in the terminal and worked.
Did you run the curl command while SSHd into the same server instance that you're seeing the error? Or on another machine in Germany? Can you paste the curl command? (you can obscure your API key)
Description of the bug:
Locally works fine and in the server not. It's not be cause of the local of the server (Germany) because I tested the Gemini request Curl in the terminal and worked.
Did you run the curl command while SSHd into the same server instance that you're seeing the error? Or on another machine in Germany? Can you paste the curl command? (you can obscure your API key)
I ran in the same server instance through SSH. I'm using ChatGPT now, but here is the Curl:
curl --location 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent' \
--header 'content-type: application/json' \
--header 'x-goog-api-key: XXXXXXXXXXXXXXXXXXXXXXXX' \
--header 'x-goog-api-client: genai-js/0.12.0' \
--data '{
"generationConfig": {
"temperature": 0.5,
"topP": 1,
"topK": 100,
"maxOutputTokens": 8192,
"responseMimeType": "application/json"
},
"safetySettings": [],
"systemInstruction": {
"role": "system",
"parts": [
{
"text": "make the sum"
}
]
},
"contents": [
{
"parts": [
{
"text": "1 + 2"
}
],
"role": "user"
}
]
}
'
status: 400, statusText: 'Bad Request', errorDetails: [ { '@type': 'type.googleapis.com/google.rpc.ErrorInfo', reason: 'API_KEY_INVALID', domain: 'googleapis.com', metadata: { service: 'generativelanguage.googleapis.com' } } ]
How to solve this issue ?
durum: 400, durumMetni: 'Kötü İstek', hataAyrıntıları: [ { '@type': 'type.googleapis.com/google.rpc.ErrorInfo', neden: 'API_KEY_INVALID', etki alanı: 'googleapis.com', meta veri: { hizmet: 'generativelanguage.googleapis.com' } } ]
Bu sorunu nasıl çözebiliriz?
Did you find a solution? I'm facing the same issue.
Same issue, did u find any solution to that?
This is the error I'm facing
Go with ChatGPT guys, that was the solution I found.
Description of the bug:
Locally works fine and in the server not. It's not be cause of the local of the server (Germany) because I tested the Gemini request Curl in the terminal and worked.
This is the log of this package
Node.js v18.20.2
The response of the raw request is this:
My instance (working fine locally):
No idea what is going on, I've been for a while on this.