Closed jhgoebbert closed 1 month ago
Thank you for reporting this issue on behalf of our users! The error indicates that the langchain_google_genai
package is not able to connect to the API at all. Can you try this again after verifying your API credentials are still valid, and that Google's Gemini service is online? You can do both by trying to call the Gemini models through langchain_google_genai
directly right before starting Jupyter AI.
Oh, I am sorry. It just means that I have no permissions to connect/use the model (for whatever reason)?
Is there any chance that Jupyter-AI can check this in future to avoid that users get confused by backtraces because of a wrong key / missing permissions?
curl \
> -H 'Content-Type: application/json' \
> -d '{"contents":[{"parts":[{"text":"Explain how AI works"}]}]}' \
> -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=GOOGLE_API_KEY'
{
"error": {
"code": 400,
"message": "Gemini API free tier is not available in your country. Please enable billing on your project in Google AI Studio.",
"status": "FAILED_PRECONDITION"
}
}
The reason was error code 400 == The Google API is not available in Germany.
Description
When trying to use the Gemini model in Jupyter-AI any chat-message leads to the following error.
fails with error in
Full backtrace
I am using