google.ai.generativelanguage.GenerateContentResponse

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.

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.

Child Classes

class PromptFeedback