GenerateTextResponse

The response from the model, including candidate completions.

JSON representation
{
  "candidates": [
    {
      object (TextCompletion)
    }
  ],
  "filters": [
    {
      object (ContentFilter)
    }
  ],
  "safetyFeedback": [
    {
      object (SafetyFeedback)
    }
  ]
}
Fields
candidates[]

object (TextCompletion)

Candidate responses from the model.

filters[]

object (ContentFilter)

A set of content filtering metadata for the prompt and response text.

This indicates which SafetyCategory(s) blocked a candidate from this response, the lowest HarmProbability that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the SafetySettings that would be necessary to unblock at least 1 response.

The blocking is configured by the SafetySettings in the request (or the default SafetySettings of the API).

safetyFeedback[]

object (SafetyFeedback)

Returns any safety feedback related to content filtering.

TextCompletion

Output text returned from a model.

JSON representation
{
  "output": string,
  "safetyRatings": [
    {
      object (SafetyRating)
    }
  ],
  "citationMetadata": {
    object (CitationMetadata)
  }
}
Fields
output

string

Output only. The generated text returned from the model.

safetyRatings[]

object (SafetyRating)

Ratings for the safety of a response.

There is at most one rating per category.

citationMetadata

object (CitationMetadata)

Output only. Citation information for model-generated output in this TextCompletion.

This field may be populated with attribution information for any text included in the output.

SafetyFeedback

Safety feedback for an entire request.

This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.

JSON representation
{
  "rating": {
    object (SafetyRating)
  },
  "setting": {
    object (SafetySetting)
  }
}
Fields
rating

object (SafetyRating)

Safety rating evaluated from content.

setting

object (SafetySetting)

Safety settings applied to the request.