Module response

Module response 

Source
Expand description

The response format follows the following structure:

{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": string
          }
        ]
      },
      "finishReason": enum (FinishReason),
      "safetyRatings": [
        {
          "category": enum (HarmCategory),
          "probability": enum (HarmProbability),
          "blocked": boolean
        }
      ],
      "citationMetadata": {
        "citations": [
          {
            "startIndex": integer,
            "endIndex": integer,
            "uri": string,
            "title": string,
            "license": string,
            "publicationDate": {
              "year": integer,
              "month": integer,
              "day": integer
            }
          }
        ]
      }
    }
  ],
  "usageMetadata": {
    "promptTokenCount": integer,
    "candidatesTokenCount": integer,
    "totalTokenCount": integer
  }
}

Structs§

Candidate
GeminiResponse
PromptFeedback
SafetyRating
StreamedGeminiResponse
TokenCount
The token count for a given prompt.
UsageMetadata

Enums§

FinishReason
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
GeminiErrorResponse