Join the Gemini API Developer Competition!
Learn more
Send feedback
google.generativeai.protos.GenerateContentResponse
Stay organized with collections
Save and categorize content based on your preferences.
Response from the model supporting multiple candidates.
Note on safety ratings and content filtering. They are reported for
both prompt in GenerateContentResponse.prompt_feedback
and for
each candidate in finish_reason
and in safety_ratings
. The
API contract is that:
either all requested candidates are returned or no candidates at
all
no candidates are returned only if there was something wrong with
the prompt (see prompt_feedback
)
feedback on each candidate is reported on finish_reason
and
safety_ratings
.
Attributes
candidates
MutableSequence[google.ai.generativelanguage.Candidate]
Candidate responses from the model.
prompt_feedback
google.ai.generativelanguage.GenerateContentResponse.PromptFeedback
Returns the prompt's feedback related to the
content filters.
usage_metadata
google.ai.generativelanguage.GenerateContentResponse.UsageMetadata
Output only. Metadata on the generation
requests' token usage.
Child Classes
class PromptFeedback
class UsageMetadata
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-21 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?