-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What does models.generateContent return when the request is *not successful*? #317
Comments
Could you give a specific example?
You can use this error class. For example (this returns a 404):
Yes good suggestion, we'll update our docs. |
Thank you for the errors, that helped. In regard to the "get code" from Google AI Studio, you get something in the lines of the following -
The google.generativeai repo listed corresponds to the following https://github.com/GoogleCloudPlatform/generative-ai, and not the one we're currently in, right? |
PiperOrigin-RevId: 726463667
We'll get the AI Studio code snippet updated, thanks for your bug report! |
PiperOrigin-RevId: 726463667
PiperOrigin-RevId: 726475680
Appreciate it. Should I close this now, or how does it work? |
Thanks, @matejsarlija Closing this ticket for now. |
Thank you for making SDK.
First of all, when using the AI studio the code in "Get code" does not mesh with the suggested genai SDK.
I have an existing API in place, but can't figure out from your docs what happens when the request fails, or is denied due to non-AI reasons (tokens limit, safety etc.). So how do I parse the usual HTTP status codes from your response?
In the code it's mentioned ~ Response body
If successful, the response body contains an instance of GenerateContentResponse.
Could you also add what happens when the request is not succesful, as it's really hard to find?
Thanks!
The text was updated successfully, but these errors were encountered: