Vertex AI API . projects . locations . publishers . models

Instance Methods

close()

Close httplib2 connections.

computeTokens(endpoint, body=None, x__xgafv=None)

Return a list of tokens based on the input text.

countTokens(endpoint, body=None, x__xgafv=None)

Perform a token counting.

embedContent(model, body=None, x__xgafv=None)

Embed content with multimodal inputs.

fetchPredictOperation(endpoint, body=None, x__xgafv=None)

Fetch an asynchronous online prediction operation.

generateContent(model, body=None, x__xgafv=None)

Generate content with multimodal inputs.

predict(endpoint, body=None, x__xgafv=None)

Perform an online prediction.

predictLongRunning(endpoint, body=None, x__xgafv=None)

rawPredict(endpoint, body=None, x__xgafv=None)

Perform an online prediction with an arbitrary HTTP payload. The response includes the following HTTP headers: * `X-Vertex-AI-Endpoint-Id`: ID of the Endpoint that served this prediction. * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's DeployedModel that served this prediction.

serverStreamingPredict(endpoint, body=None, x__xgafv=None)

Perform a server-side streaming online prediction request for Vertex LLM streaming.

streamGenerateContent(model, body=None, x__xgafv=None)

Generate content with multimodal inputs with streaming support.

streamRawPredict(endpoint, body=None, x__xgafv=None)

Perform a streaming online prediction with an arbitrary HTTP payload.

Method Details

close()
Close httplib2 connections.
computeTokens(endpoint, body=None, x__xgafv=None)
Return a list of tokens based on the input text.

Args:
  endpoint: string, Required. The name of the Endpoint requested to get lists of tokens and token ids. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ComputeTokens RPC call.
  "contents": [ # Optional. Input content.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            "outcome": "A String", # Required. Outcome of the code execution.
            "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            "code": "A String", # Required. The code to be executed.
            "language": "A String", # Required. Programming language of the `code`.
          },
          "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              "a_key": "", # Properties of the object.
            },
            "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                "fileData": { # URI based data for function response. # URI based data.
                  "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "fileUri": "A String", # Required. URI.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                  "data": "A String", # Required. Raw bytes.
                  "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
              "a_key": "", # Properties of the object.
            },
          },
          "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            "data": "A String", # Required. The raw bytes of the data.
            "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "text": "A String", # Optional. The text content of the part.
          "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
          "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            "endOffset": "A String", # Optional. The end offset of the video.
            "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            "startOffset": "A String", # Optional. The start offset of the video.
          },
        },
      ],
      "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
    },
  ],
  "instances": [ # Optional. The instances that are the input to token computing API call. Schema is identical to the prediction schema of the text model, even for the non-text models, like chat models, or Codey models.
    "",
  ],
  "model": "A String", # Optional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ComputeTokens RPC call.
  "tokensInfo": [ # Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.
    { # Tokens info with a list of tokens and the corresponding list of token ids.
      "role": "A String", # Optional. Optional fields for the role from the corresponding Content.
      "tokenIds": [ # A list of token ids from the input.
        "A String",
      ],
      "tokens": [ # A list of tokens from the input.
        "A String",
      ],
    },
  ],
}
countTokens(endpoint, body=None, x__xgafv=None)
Perform a token counting.

Args:
  endpoint: string, Required. The name of the Endpoint requested to perform token counting. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.CountTokens.
  "contents": [ # Optional. Input content.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            "outcome": "A String", # Required. Outcome of the code execution.
            "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            "code": "A String", # Required. The code to be executed.
            "language": "A String", # Required. Programming language of the `code`.
          },
          "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              "a_key": "", # Properties of the object.
            },
            "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                "fileData": { # URI based data for function response. # URI based data.
                  "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "fileUri": "A String", # Required. URI.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                  "data": "A String", # Required. Raw bytes.
                  "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
              "a_key": "", # Properties of the object.
            },
          },
          "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            "data": "A String", # Required. The raw bytes of the data.
            "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "text": "A String", # Optional. The text content of the part.
          "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
          "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            "endOffset": "A String", # Optional. The end offset of the video.
            "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            "startOffset": "A String", # Optional. The start offset of the video.
          },
        },
      ],
      "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
    },
  ],
  "generationConfig": { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config that the model will use to generate the response.
    "audioTimestamp": True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    "candidateCount": 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    "enableAffectiveDialog": True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    "frequencyPenalty": 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    "imageConfig": { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      "aspectRatio": "A String", # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: "1:1" "2:3", "3:2" "3:4", "4:3" "4:5", "5:4" "9:16", "16:9" "21:9"
      "imageOutputOptions": { # The image output format for generated images. # Optional. The image output format for generated images.
        "compressionQuality": 42, # Optional. The compression quality of the output image.
        "mimeType": "A String", # Optional. The image format that the output should be saved as.
      },
      "personGeneration": "A String", # Optional. Controls whether the model can generate people.
    },
    "logprobs": 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    "maxOutputTokens": 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    "mediaResolution": "A String", # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    "presencePenalty": 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    "responseJsonSchema": "", # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    "responseLogprobs": True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging.
    "responseMimeType": "A String", # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    "responseModalities": [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      "A String",
    ],
    "responseSchema": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      "default": "", # Optional. Default value of the data.
      "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "description": "A String", # Optional. The description of the data.
      "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
        "A String",
      ],
      "example": "", # Optional. Example of the object. Will only populated when the object is the root.
      "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
      "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
      "maxLength": "A String", # Optional. Maximum length of the Type.STRING
      "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
      "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
      "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
      "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      "nullable": True or False, # Optional. Indicates if the value may be null.
      "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        "A String",
      ],
      "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
      "required": [ # Optional. Required properties of Type.OBJECT.
        "A String",
      ],
      "title": "A String", # Optional. The title of the Schema.
      "type": "A String", # Optional. The type of the data.
    },
    "routingConfig": { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      "autoMode": { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        "modelRoutingPreference": "A String", # The model routing preference.
      },
      "manualMode": { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        "modelName": "A String", # The name of the model to use. Only public LLM models are accepted.
      },
    },
    "seed": 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    "speechConfig": { # Configuration for speech generation. # Optional. The speech generation config.
      "languageCode": "A String", # Optional. The language code (ISO 639-1) for the speech synthesis.
      "multiSpeakerVoiceConfig": { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        "speakerVoiceConfigs": [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            "speaker": "A String", # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            "voiceConfig": { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                "voiceName": "A String", # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      "voiceConfig": { # Configuration for a voice. # The configuration for the voice to use.
        "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          "voiceName": "A String", # The name of the prebuilt voice to use.
        },
      },
    },
    "stopSequences": [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker.
      "A String",
    ],
    "temperature": 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    "thinkingConfig": { # Configuration for the model's thinking features. "Thinking" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don't support thinking.
      "includeThoughts": True or False, # Optional. If true, the model will include its thoughts in the response. "Thoughts" are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model's reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      "thinkingBudget": 42, # Optional. The token budget for the model's thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    "topK": 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    "topP": 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both.
  },
  "instances": [ # Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.
    "",
  ],
  "model": "A String", # Optional. The name of the publisher model requested to serve the prediction. Format: `projects/{project}/locations/{location}/publishers/*/models/*`
  "systemInstruction": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          "outcome": "A String", # Required. Outcome of the code execution.
          "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          "code": "A String", # Required. The code to be executed.
          "language": "A String", # Required. Programming language of the `code`.
        },
        "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            "a_key": "", # Properties of the object.
          },
          "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              "fileData": { # URI based data for function response. # URI based data.
                "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                "data": "A String", # Required. Raw bytes.
                "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
            "a_key": "", # Properties of the object.
          },
        },
        "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          "data": "A String", # Required. The raw bytes of the data.
          "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "text": "A String", # Optional. The text content of the part.
        "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
        "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          "endOffset": "A String", # Optional. The end offset of the video.
          "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          "startOffset": "A String", # Optional. The start offset of the video.
        },
      },
    ],
    "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  },
  "tools": [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      "codeExecution": { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      "computerUse": { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        "environment": "A String", # Required. The environment being operated.
        "excludedPredefinedFunctions": [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          "A String",
        ],
      },
      "enterpriseWebSearch": { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          "A String",
        ],
      },
      "functionDeclarations": [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          "description": "A String", # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          "name": "A String", # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          "parameters": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "parametersJsonSchema": "", # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`.
          "response": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "responseJsonSchema": "", # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      "googleMaps": { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        "enableWidget": True or False, # Optional. If true, include the widget context token in the response.
      },
      "googleSearch": { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"].
          "A String",
        ],
      },
      "googleSearchRetrieval": { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        "dynamicRetrievalConfig": { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          "dynamicThreshold": 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          "mode": "A String", # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      "retrieval": { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        "disableAttribution": True or False, # Optional. Deprecated. This option is no longer supported.
        "externalApi": { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          "apiAuth": { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            "apiKeyConfig": { # The API secret. # The API secret.
              "apiKeySecretVersion": "A String", # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              "apiKeyString": "A String", # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          "apiSpec": "A String", # The API spec that the external API implements.
          "authConfig": { # Auth configuration to run the extension. # The authentication config to access the API.
            "apiKeyConfig": { # Config for authentication with API key. # Config for API key auth.
              "apiKeySecret": "A String", # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              "apiKeyString": "A String", # Optional. The API key to be used in the request directly.
              "httpElementLocation": "A String", # Optional. The location of the API key.
              "name": "A String", # Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.
            },
            "authType": "A String", # Type of auth scheme.
            "googleServiceAccountConfig": { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              "serviceAccount": "A String", # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            "httpBasicAuthConfig": { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              "credentialSecret": "A String", # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            "oauthConfig": { # Config for user oauth. # Config for user oauth.
              "accessToken": "A String", # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            "oidcConfig": { # Config for user OIDC auth. # Config for user OIDC auth.
              "idToken": "A String", # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          "elasticSearchParams": { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            "index": "A String", # The ElasticSearch index to use.
            "numHits": 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            "searchTemplate": "A String", # The ElasticSearch search template to use.
          },
          "endpoint": "A String", # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          "simpleSearchParams": { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        "vertexAiSearch": { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          "dataStoreSpecs": [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              "dataStore": "A String", # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              "filter": "A String", # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          "datastore": "A String", # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          "engine": "A String", # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          "filter": "A String", # Optional. Filter strings to be passed to the search API.
          "maxResults": 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        "vertexRagStore": { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          "ragResources": [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              "ragCorpus": "A String", # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              "ragFileIds": [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                "A String",
              ],
            },
          ],
          "ragRetrievalConfig": { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            "filter": { # Config for filters. # Optional. Config for filters.
              "metadataFilter": "A String", # Optional. String for metadata filtering.
              "vectorDistanceThreshold": 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              "vectorSimilarityThreshold": 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            "ranking": { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              "llmRanker": { # Config for LlmRanker. # Optional. Config for LlmRanker.
                "modelName": "A String", # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              "rankService": { # Config for Rank Service. # Optional. Config for Rank Service.
                "modelName": "A String", # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            "topK": 42, # Optional. The number of contexts to retrieve.
          },
          "similarityTopK": 42, # Optional. Number of top k results to return from the selected corpora.
          "vectorDistanceThreshold": 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      "urlContext": { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.CountTokens.
  "promptTokensDetails": [ # Output only. List of modalities that were processed in the request input.
    { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
      "modality": "A String", # The modality that this token count applies to.
      "tokenCount": 42, # The number of tokens counted for this modality.
    },
  ],
  "totalBillableCharacters": 42, # The total number of billable characters counted across all instances from the request.
  "totalTokens": 42, # The total number of tokens counted across all instances from the request.
}
embedContent(model, body=None, x__xgafv=None)
Embed content with multimodal inputs.

Args:
  model: string, Required. The name of the publisher model requested to serve the prediction. Format: `projects/{project}/locations/{location}/publishers/*/models/*` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.EmbedContent.
  "autoTruncate": True or False, # Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.
  "content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. Input content to be embedded. Required.
    "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          "outcome": "A String", # Required. Outcome of the code execution.
          "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          "code": "A String", # Required. The code to be executed.
          "language": "A String", # Required. Programming language of the `code`.
        },
        "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            "a_key": "", # Properties of the object.
          },
          "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              "fileData": { # URI based data for function response. # URI based data.
                "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                "data": "A String", # Required. Raw bytes.
                "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
            "a_key": "", # Properties of the object.
          },
        },
        "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          "data": "A String", # Required. The raw bytes of the data.
          "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "text": "A String", # Optional. The text content of the part.
        "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
        "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          "endOffset": "A String", # Optional. The end offset of the video.
          "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          "startOffset": "A String", # Optional. The start offset of the video.
        },
      },
    ],
    "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  },
  "outputDimensionality": 42, # Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.
  "taskType": "A String", # Optional. The task type of the embedding.
  "title": "A String", # Optional. An optional title for the text.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.EmbedContent.
  "embedding": { # A list of floats representing an embedding. # The embedding generated from the input content.
    "values": [ # Embedding vector values.
      3.14,
    ],
  },
  "truncated": True or False, # Whether the input content was truncated before generating the embedding.
  "usageMetadata": { # Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. # Metadata about the response(s).
    "cacheTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the cached content.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "cachedContentTokenCount": 42, # Output only. The number of tokens in the cached content that was used for this request.
    "candidatesTokenCount": 42, # The total number of tokens in the generated candidates.
    "candidatesTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the generated candidates.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "promptTokenCount": 42, # The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
    "promptTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the prompt.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "thoughtsTokenCount": 42, # Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.
    "toolUsePromptTokenCount": 42, # Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
    "toolUsePromptTokensDetails": [ # Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "totalTokenCount": 42, # The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
    "trafficType": "A String", # Output only. The traffic type for this request.
  },
}
fetchPredictOperation(endpoint, body=None, x__xgafv=None)
Fetch an asynchronous online prediction operation.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.FetchPredictOperation.
  "operationName": "A String", # Required. The server-assigned name for the operation.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  "metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
  "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  "response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
}
generateContent(model, body=None, x__xgafv=None)
Generate content with multimodal inputs.

Args:
  model: string, Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for [PredictionService.GenerateContent].
  "cachedContent": "A String", # Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`
  "contents": [ # Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            "outcome": "A String", # Required. Outcome of the code execution.
            "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            "code": "A String", # Required. The code to be executed.
            "language": "A String", # Required. Programming language of the `code`.
          },
          "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              "a_key": "", # Properties of the object.
            },
            "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                "fileData": { # URI based data for function response. # URI based data.
                  "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "fileUri": "A String", # Required. URI.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                  "data": "A String", # Required. Raw bytes.
                  "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
              "a_key": "", # Properties of the object.
            },
          },
          "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            "data": "A String", # Required. The raw bytes of the data.
            "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "text": "A String", # Optional. The text content of the part.
          "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
          "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            "endOffset": "A String", # Optional. The end offset of the video.
            "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            "startOffset": "A String", # Optional. The start offset of the video.
          },
        },
      ],
      "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
    },
  ],
  "generationConfig": { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config.
    "audioTimestamp": True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    "candidateCount": 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    "enableAffectiveDialog": True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    "frequencyPenalty": 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    "imageConfig": { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      "aspectRatio": "A String", # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: "1:1" "2:3", "3:2" "3:4", "4:3" "4:5", "5:4" "9:16", "16:9" "21:9"
      "imageOutputOptions": { # The image output format for generated images. # Optional. The image output format for generated images.
        "compressionQuality": 42, # Optional. The compression quality of the output image.
        "mimeType": "A String", # Optional. The image format that the output should be saved as.
      },
      "personGeneration": "A String", # Optional. Controls whether the model can generate people.
    },
    "logprobs": 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    "maxOutputTokens": 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    "mediaResolution": "A String", # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    "presencePenalty": 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    "responseJsonSchema": "", # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    "responseLogprobs": True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging.
    "responseMimeType": "A String", # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    "responseModalities": [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      "A String",
    ],
    "responseSchema": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      "default": "", # Optional. Default value of the data.
      "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "description": "A String", # Optional. The description of the data.
      "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
        "A String",
      ],
      "example": "", # Optional. Example of the object. Will only populated when the object is the root.
      "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
      "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
      "maxLength": "A String", # Optional. Maximum length of the Type.STRING
      "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
      "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
      "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
      "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      "nullable": True or False, # Optional. Indicates if the value may be null.
      "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        "A String",
      ],
      "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
      "required": [ # Optional. Required properties of Type.OBJECT.
        "A String",
      ],
      "title": "A String", # Optional. The title of the Schema.
      "type": "A String", # Optional. The type of the data.
    },
    "routingConfig": { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      "autoMode": { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        "modelRoutingPreference": "A String", # The model routing preference.
      },
      "manualMode": { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        "modelName": "A String", # The name of the model to use. Only public LLM models are accepted.
      },
    },
    "seed": 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    "speechConfig": { # Configuration for speech generation. # Optional. The speech generation config.
      "languageCode": "A String", # Optional. The language code (ISO 639-1) for the speech synthesis.
      "multiSpeakerVoiceConfig": { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        "speakerVoiceConfigs": [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            "speaker": "A String", # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            "voiceConfig": { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                "voiceName": "A String", # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      "voiceConfig": { # Configuration for a voice. # The configuration for the voice to use.
        "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          "voiceName": "A String", # The name of the prebuilt voice to use.
        },
      },
    },
    "stopSequences": [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker.
      "A String",
    ],
    "temperature": 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    "thinkingConfig": { # Configuration for the model's thinking features. "Thinking" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don't support thinking.
      "includeThoughts": True or False, # Optional. If true, the model will include its thoughts in the response. "Thoughts" are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model's reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      "thinkingBudget": 42, # Optional. The token budget for the model's thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    "topK": 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    "topP": 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both.
  },
  "labels": { # Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
    "a_key": "A String",
  },
  "modelArmorConfig": { # Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. # Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.
    "promptTemplateName": "A String", # Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
    "responseTemplateName": "A String", # Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
  },
  "safetySettings": [ # Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
    { # A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.
      "category": "A String", # Required. The harm category to be blocked.
      "method": "A String", # Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
      "threshold": "A String", # Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    },
  ],
  "systemInstruction": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          "outcome": "A String", # Required. Outcome of the code execution.
          "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          "code": "A String", # Required. The code to be executed.
          "language": "A String", # Required. Programming language of the `code`.
        },
        "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            "a_key": "", # Properties of the object.
          },
          "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              "fileData": { # URI based data for function response. # URI based data.
                "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                "data": "A String", # Required. Raw bytes.
                "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
            "a_key": "", # Properties of the object.
          },
        },
        "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          "data": "A String", # Required. The raw bytes of the data.
          "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "text": "A String", # Optional. The text content of the part.
        "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
        "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          "endOffset": "A String", # Optional. The end offset of the video.
          "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          "startOffset": "A String", # Optional. The start offset of the video.
        },
      },
    ],
    "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  },
  "toolConfig": { # Tool config. This config is shared for all tools provided in the request. # Optional. Tool config. This config is shared for all tools provided in the request.
    "functionCallingConfig": { # Function calling config. # Optional. Function calling config.
      "allowedFunctionNames": [ # Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.
        "A String",
      ],
      "mode": "A String", # Optional. Function calling mode.
    },
    "retrievalConfig": { # Retrieval config. # Optional. Retrieval config.
      "languageCode": "A String", # The language code of the user.
      "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # The location of the user.
        "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
        "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
      },
    },
  },
  "tools": [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      "codeExecution": { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      "computerUse": { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        "environment": "A String", # Required. The environment being operated.
        "excludedPredefinedFunctions": [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          "A String",
        ],
      },
      "enterpriseWebSearch": { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          "A String",
        ],
      },
      "functionDeclarations": [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          "description": "A String", # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          "name": "A String", # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          "parameters": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "parametersJsonSchema": "", # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`.
          "response": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "responseJsonSchema": "", # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      "googleMaps": { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        "enableWidget": True or False, # Optional. If true, include the widget context token in the response.
      },
      "googleSearch": { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"].
          "A String",
        ],
      },
      "googleSearchRetrieval": { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        "dynamicRetrievalConfig": { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          "dynamicThreshold": 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          "mode": "A String", # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      "retrieval": { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        "disableAttribution": True or False, # Optional. Deprecated. This option is no longer supported.
        "externalApi": { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          "apiAuth": { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            "apiKeyConfig": { # The API secret. # The API secret.
              "apiKeySecretVersion": "A String", # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              "apiKeyString": "A String", # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          "apiSpec": "A String", # The API spec that the external API implements.
          "authConfig": { # Auth configuration to run the extension. # The authentication config to access the API.
            "apiKeyConfig": { # Config for authentication with API key. # Config for API key auth.
              "apiKeySecret": "A String", # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              "apiKeyString": "A String", # Optional. The API key to be used in the request directly.
              "httpElementLocation": "A String", # Optional. The location of the API key.
              "name": "A String", # Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.
            },
            "authType": "A String", # Type of auth scheme.
            "googleServiceAccountConfig": { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              "serviceAccount": "A String", # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            "httpBasicAuthConfig": { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              "credentialSecret": "A String", # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            "oauthConfig": { # Config for user oauth. # Config for user oauth.
              "accessToken": "A String", # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            "oidcConfig": { # Config for user OIDC auth. # Config for user OIDC auth.
              "idToken": "A String", # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          "elasticSearchParams": { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            "index": "A String", # The ElasticSearch index to use.
            "numHits": 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            "searchTemplate": "A String", # The ElasticSearch search template to use.
          },
          "endpoint": "A String", # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          "simpleSearchParams": { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        "vertexAiSearch": { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          "dataStoreSpecs": [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              "dataStore": "A String", # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              "filter": "A String", # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          "datastore": "A String", # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          "engine": "A String", # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          "filter": "A String", # Optional. Filter strings to be passed to the search API.
          "maxResults": 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        "vertexRagStore": { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          "ragResources": [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              "ragCorpus": "A String", # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              "ragFileIds": [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                "A String",
              ],
            },
          ],
          "ragRetrievalConfig": { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            "filter": { # Config for filters. # Optional. Config for filters.
              "metadataFilter": "A String", # Optional. String for metadata filtering.
              "vectorDistanceThreshold": 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              "vectorSimilarityThreshold": 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            "ranking": { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              "llmRanker": { # Config for LlmRanker. # Optional. Config for LlmRanker.
                "modelName": "A String", # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              "rankService": { # Config for Rank Service. # Optional. Config for Rank Service.
                "modelName": "A String", # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            "topK": 42, # Optional. The number of contexts to retrieve.
          },
          "similarityTopK": 42, # Optional. Number of top k results to return from the selected corpora.
          "vectorDistanceThreshold": 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      "urlContext": { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for [PredictionService.GenerateContent].
  "candidates": [ # Output only. Generated candidates.
    { # A response candidate generated from the model.
      "avgLogprobs": 3.14, # Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response.
      "citationMetadata": { # A collection of citations that apply to a piece of generated content. # Output only. A collection of citations that apply to the generated content.
        "citations": [ # Output only. A list of citations for the content.
          { # A citation for a piece of generatedcontent.
            "endIndex": 42, # Output only. The end index of the citation in the content.
            "license": "A String", # Output only. The license of the source of the citation.
            "publicationDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. The publication date of the source of the citation.
              "day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
              "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
              "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
            },
            "startIndex": 42, # Output only. The start index of the citation in the content.
            "title": "A String", # Output only. The title of the source of the citation.
            "uri": "A String", # Output only. The URI of the source of the citation.
          },
        ],
      },
      "content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Output only. The content of the candidate.
        "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
          { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
            "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
              "outcome": "A String", # Required. Outcome of the code execution.
              "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
            },
            "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
              "code": "A String", # Required. The code to be executed.
              "language": "A String", # Required. Programming language of the `code`.
            },
            "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
              "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
              "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
            },
            "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
              "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                "a_key": "", # Properties of the object.
              },
              "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
            },
            "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
              "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
              "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                  "fileData": { # URI based data for function response. # URI based data.
                    "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    "fileUri": "A String", # Required. URI.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                    "data": "A String", # Required. Raw bytes.
                    "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                },
              ],
              "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                "a_key": "", # Properties of the object.
              },
            },
            "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
              "data": "A String", # Required. The raw bytes of the data.
              "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
            },
            "text": "A String", # Optional. The text content of the part.
            "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
            "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
            "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
              "endOffset": "A String", # Optional. The end offset of the video.
              "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
              "startOffset": "A String", # Optional. The start offset of the video.
            },
          },
        ],
        "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
      },
      "finishMessage": "A String", # Output only. Describes the reason the model stopped generating tokens in more detail. This field is returned only when `finish_reason` is set.
      "finishReason": "A String", # Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating.
      "groundingMetadata": { # Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources. # Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content.
        "googleMapsWidgetContextToken": "A String", # Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
        "groundingChunks": [ # A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
          { # A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information.
            "maps": { # A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. # A grounding chunk from Google Maps. See the `Maps` message for details.
              "placeAnswerSources": { # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
                "reviewSnippets": [ # Snippets of reviews that were used to generate the answer.
                  { # A review snippet that is used to generate the answer.
                    "googleMapsUri": "A String", # A link to show the review on Google Maps.
                    "reviewId": "A String", # The ID of the review that is being referenced.
                    "title": "A String", # The title of the review.
                  },
                ],
              },
              "placeId": "A String", # This Place's resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API.
              "text": "A String", # The text of the place answer.
              "title": "A String", # The title of the place.
              "uri": "A String", # The URI of the place.
            },
            "retrievedContext": { # Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. # A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details
              "documentName": "A String", # Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
              "ragChunk": { # A RagChunk includes the content of a chunk of a RagFile, and associated metadata. # Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
                "pageSpan": { # Represents where the chunk starts and ends in the document. # If populated, represents where the chunk starts and ends in the document.
                  "firstPage": 42, # Page where chunk starts in the document. Inclusive. 1-indexed.
                  "lastPage": 42, # Page where chunk ends in the document. Inclusive. 1-indexed.
                },
                "text": "A String", # The content of the chunk.
              },
              "text": "A String", # The content of the retrieved data source.
              "title": "A String", # The title of the retrieved data source.
              "uri": "A String", # The URI of the retrieved data source.
            },
            "web": { # A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information. # A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.
              "domain": "A String", # The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
              "title": "A String", # The title of the web page that contains the evidence.
              "uri": "A String", # The URI of the web page that contains the evidence.
            },
          },
        ],
        "groundingSupports": [ # Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
          { # A collection of supporting references for a segment of the model's response.
            "confidenceScores": [ # The confidence scores for the support references. This list is parallel to the `grounding_chunk_indices` list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim. For Gemini 2.0 and before, this list has the same size as `grounding_chunk_indices`. For Gemini 2.5 and later, this list is empty and should be ignored.
              3.14,
            ],
            "groundingChunkIndices": [ # A list of indices into the `grounding_chunks` field of the `GroundingMetadata` message. These indices specify which grounding chunks support the claim made in the content segment. For example, if this field has the values `[1, 3]`, it means that `grounding_chunks[1]` and `grounding_chunks[3]` are the sources for the claim in the content segment.
              42,
            ],
            "segment": { # A segment of the content. # The content segment that this support message applies to.
              "endIndex": 42, # Output only. The end index of the segment in the `Part`, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.
              "partIndex": 42, # Output only. The index of the `Part` object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
              "startIndex": 42, # Output only. The start index of the segment in the `Part`, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.
              "text": "A String", # Output only. The text of the segment.
            },
          },
        ],
        "retrievalMetadata": { # Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled. # Optional. Output only. Metadata related to the retrieval grounding source.
          "googleSearchDynamicRetrievalScore": 3.14, # Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
        },
        "searchEntryPoint": { # An entry point for displaying Google Search results. A `SearchEntryPoint` is populated when the grounding source for a model's response is Google Search. It provides information that you can use to display the search results in your application. # Optional. A web search entry point that can be used to display search results. This field is populated only when the grounding source is Google Search.
          "renderedContent": "A String", # Optional. An HTML snippet that can be embedded in a web page or an application's webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.
          "sdkBlob": "A String", # Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
        },
        "sourceFlaggingUris": [ # Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
          { # A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps.
            "flagContentUri": "A String", # The URI that can be used to flag the content.
            "sourceId": "A String", # The ID of the place or review.
          },
        ],
        "webSearchQueries": [ # Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
          "A String",
        ],
      },
      "index": 42, # Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` > 1.
      "logprobsResult": { # The log probabilities of the tokens generated by the model. This is useful for understanding the model's confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is "hallucinating" or generating factually incorrect information. # Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential "hallucinations".
        "chosenCandidates": [ # A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.
          { # A single token and its associated log probability.
            "logProbability": 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
            "token": "A String", # The token's string representation.
            "tokenId": 42, # The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.
          },
        ],
        "topCandidates": [ # A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.
          { # A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.
            "candidates": [ # The list of candidate tokens, sorted by log probability in descending order.
              { # A single token and its associated log probability.
                "logProbability": 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
                "token": "A String", # The token's string representation.
                "tokenId": 42, # The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.
              },
            ],
          },
        ],
      },
      "safetyRatings": [ # Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category.
        { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
          "blocked": True or False, # Output only. Indicates whether the content was blocked because of this rating.
          "category": "A String", # Output only. The harm category of this rating.
          "overwrittenThreshold": "A String", # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
          "probability": "A String", # Output only. The probability of harm for this category.
          "probabilityScore": 3.14, # Output only. The probability score of harm for this category.
          "severity": "A String", # Output only. The severity of harm for this category.
          "severityScore": 3.14, # Output only. The severity score of harm for this category.
        },
      ],
      "urlContextMetadata": { # Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. # Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL.
        "urlMetadata": [ # Output only. A list of URL metadata, with one entry for each URL retrieved by the tool.
          { # The metadata for a single URL retrieval.
            "retrievedUrl": "A String", # The URL retrieved by the tool.
            "urlRetrievalStatus": "A String", # The status of the URL retrieval.
          },
        ],
      },
    },
  ],
  "createTime": "A String", # Output only. Timestamp when the request is made to the server.
  "modelVersion": "A String", # Output only. The model version used to generate the response.
  "promptFeedback": { # Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. # Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
    "blockReason": "A String", # Output only. The reason why the prompt was blocked.
    "blockReasonMessage": "A String", # Output only. A readable message that explains the reason why the prompt was blocked.
    "safetyRatings": [ # Output only. A list of safety ratings for the prompt. There is one rating per category.
      { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
        "blocked": True or False, # Output only. Indicates whether the content was blocked because of this rating.
        "category": "A String", # Output only. The harm category of this rating.
        "overwrittenThreshold": "A String", # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
        "probability": "A String", # Output only. The probability of harm for this category.
        "probabilityScore": 3.14, # Output only. The probability score of harm for this category.
        "severity": "A String", # Output only. The severity of harm for this category.
        "severityScore": 3.14, # Output only. The severity score of harm for this category.
      },
    ],
  },
  "responseId": "A String", # Output only. response_id is used to identify each response. It is the encoding of the event_id.
  "usageMetadata": { # Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. # Usage metadata about the response(s).
    "cacheTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the cached content.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "cachedContentTokenCount": 42, # Output only. The number of tokens in the cached content that was used for this request.
    "candidatesTokenCount": 42, # The total number of tokens in the generated candidates.
    "candidatesTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the generated candidates.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "promptTokenCount": 42, # The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
    "promptTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the prompt.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "thoughtsTokenCount": 42, # Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.
    "toolUsePromptTokenCount": 42, # Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
    "toolUsePromptTokensDetails": [ # Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "totalTokenCount": 42, # The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
    "trafficType": "A String", # Output only. The traffic type for this request.
  },
}
predict(endpoint, body=None, x__xgafv=None)
Perform an online prediction.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.Predict.
  "instances": [ # Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' Model's PredictSchemata's instance_schema_uri.
    "",
  ],
  "labels": { # Optional. The user labels for Imagen billing usage only. Only Imagen supports labels. For other use cases, it will be ignored.
    "a_key": "A String",
  },
  "parameters": "", # The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint's DeployedModels' Model's PredictSchemata's parameters_schema_uri.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.Predict.
  "deployedModelId": "A String", # ID of the Endpoint's DeployedModel that served this prediction.
  "metadata": "", # Output only. Request-level metadata returned by the model. The metadata type will be dependent upon the model implementation.
  "model": "A String", # Output only. The resource name of the Model which is deployed as the DeployedModel that this prediction hits.
  "modelDisplayName": "A String", # Output only. The display name of the Model which is deployed as the DeployedModel that this prediction hits.
  "modelVersionId": "A String", # Output only. The version ID of the Model which is deployed as the DeployedModel that this prediction hits.
  "predictions": [ # The predictions that are the output of the predictions call. The schema of any single prediction may be specified via Endpoint's DeployedModels' Model's PredictSchemata's prediction_schema_uri.
    "",
  ],
}
predictLongRunning(endpoint, body=None, x__xgafv=None)

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.PredictLongRunning.
  "instances": [ # Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' Model's PredictSchemata's instance_schema_uri.
    "",
  ],
  "parameters": "", # Optional. The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint's DeployedModels' Model's PredictSchemata's parameters_schema_uri.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  "metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
  "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  "response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
}
rawPredict(endpoint, body=None, x__xgafv=None)
Perform an online prediction with an arbitrary HTTP payload. The response includes the following HTTP headers: * `X-Vertex-AI-Endpoint-Id`: ID of the Endpoint that served this prediction. * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's DeployedModel that served this prediction.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.RawPredict.
  "httpBody": { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged. # The prediction input. Supports HTTP headers and arbitrary data payload. A DeployedModel may have an upper limit on the number of instances it supports per request. When this limit it is exceeded for an AutoML model, the RawPredict method returns an error. When this limit is exceeded for a custom-trained model, the behavior varies depending on the model. You can specify the schema for each instance in the predict_schemata.instance_schema_uri field when you create a Model. This schema applies when you deploy the `Model` as a `DeployedModel` to an Endpoint and use the `RawPredict` method.
    "contentType": "A String", # The HTTP Content-Type header value specifying the content type of the body.
    "data": "A String", # The HTTP request/response body as raw binary.
    "extensions": [ # Application specific response metadata. Must be set in the first response for streaming APIs.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
  "contentType": "A String", # The HTTP Content-Type header value specifying the content type of the body.
  "data": "A String", # The HTTP request/response body as raw binary.
  "extensions": [ # Application specific response metadata. Must be set in the first response for streaming APIs.
    {
      "a_key": "", # Properties of the object. Contains field @type with type URL.
    },
  ],
}
serverStreamingPredict(endpoint, body=None, x__xgafv=None)
Perform a server-side streaming online prediction request for Vertex LLM streaming.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.StreamingPredict. The first message must contain endpoint field and optionally input. The subsequent messages must contain input.
  "inputs": [ # The prediction input.
    { # A tensor value type.
      "boolVal": [ # Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
        True or False,
      ],
      "bytesVal": [ # STRING
        "A String",
      ],
      "doubleVal": [ # DOUBLE
        3.14,
      ],
      "dtype": "A String", # The data type of tensor.
      "floatVal": [ # FLOAT
        3.14,
      ],
      "int64Val": [ # INT64
        "A String",
      ],
      "intVal": [ # INT_8 INT_16 INT_32
        42,
      ],
      "listVal": [ # A list of tensor values.
        # Object with schema name: GoogleCloudAiplatformV1Tensor
      ],
      "shape": [ # Shape of the tensor.
        "A String",
      ],
      "stringVal": [ # STRING
        "A String",
      ],
      "structVal": { # A map of string to tensor.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Tensor
      },
      "tensorVal": "A String", # Serialized raw tensor content.
      "uint64Val": [ # UINT64
        "A String",
      ],
      "uintVal": [ # UINT8 UINT16 UINT32
        42,
      ],
    },
  ],
  "parameters": { # A tensor value type. # The parameters that govern the prediction.
    "boolVal": [ # Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
      True or False,
    ],
    "bytesVal": [ # STRING
      "A String",
    ],
    "doubleVal": [ # DOUBLE
      3.14,
    ],
    "dtype": "A String", # The data type of tensor.
    "floatVal": [ # FLOAT
      3.14,
    ],
    "int64Val": [ # INT64
      "A String",
    ],
    "intVal": [ # INT_8 INT_16 INT_32
      42,
    ],
    "listVal": [ # A list of tensor values.
      # Object with schema name: GoogleCloudAiplatformV1Tensor
    ],
    "shape": [ # Shape of the tensor.
      "A String",
    ],
    "stringVal": [ # STRING
      "A String",
    ],
    "structVal": { # A map of string to tensor.
      "a_key": # Object with schema name: GoogleCloudAiplatformV1Tensor
    },
    "tensorVal": "A String", # Serialized raw tensor content.
    "uint64Val": [ # UINT64
      "A String",
    ],
    "uintVal": [ # UINT8 UINT16 UINT32
      42,
    ],
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.StreamingPredict.
  "outputs": [ # The prediction output.
    { # A tensor value type.
      "boolVal": [ # Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
        True or False,
      ],
      "bytesVal": [ # STRING
        "A String",
      ],
      "doubleVal": [ # DOUBLE
        3.14,
      ],
      "dtype": "A String", # The data type of tensor.
      "floatVal": [ # FLOAT
        3.14,
      ],
      "int64Val": [ # INT64
        "A String",
      ],
      "intVal": [ # INT_8 INT_16 INT_32
        42,
      ],
      "listVal": [ # A list of tensor values.
        # Object with schema name: GoogleCloudAiplatformV1Tensor
      ],
      "shape": [ # Shape of the tensor.
        "A String",
      ],
      "stringVal": [ # STRING
        "A String",
      ],
      "structVal": { # A map of string to tensor.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Tensor
      },
      "tensorVal": "A String", # Serialized raw tensor content.
      "uint64Val": [ # UINT64
        "A String",
      ],
      "uintVal": [ # UINT8 UINT16 UINT32
        42,
      ],
    },
  ],
  "parameters": { # A tensor value type. # The parameters that govern the prediction.
    "boolVal": [ # Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
      True or False,
    ],
    "bytesVal": [ # STRING
      "A String",
    ],
    "doubleVal": [ # DOUBLE
      3.14,
    ],
    "dtype": "A String", # The data type of tensor.
    "floatVal": [ # FLOAT
      3.14,
    ],
    "int64Val": [ # INT64
      "A String",
    ],
    "intVal": [ # INT_8 INT_16 INT_32
      42,
    ],
    "listVal": [ # A list of tensor values.
      # Object with schema name: GoogleCloudAiplatformV1Tensor
    ],
    "shape": [ # Shape of the tensor.
      "A String",
    ],
    "stringVal": [ # STRING
      "A String",
    ],
    "structVal": { # A map of string to tensor.
      "a_key": # Object with schema name: GoogleCloudAiplatformV1Tensor
    },
    "tensorVal": "A String", # Serialized raw tensor content.
    "uint64Val": [ # UINT64
      "A String",
    ],
    "uintVal": [ # UINT8 UINT16 UINT32
      42,
    ],
  },
}
streamGenerateContent(model, body=None, x__xgafv=None)
Generate content with multimodal inputs with streaming support.

Args:
  model: string, Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for [PredictionService.GenerateContent].
  "cachedContent": "A String", # Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`
  "contents": [ # Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            "outcome": "A String", # Required. Outcome of the code execution.
            "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            "code": "A String", # Required. The code to be executed.
            "language": "A String", # Required. Programming language of the `code`.
          },
          "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              "a_key": "", # Properties of the object.
            },
            "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                "fileData": { # URI based data for function response. # URI based data.
                  "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "fileUri": "A String", # Required. URI.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                  "data": "A String", # Required. Raw bytes.
                  "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
              "a_key": "", # Properties of the object.
            },
          },
          "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            "data": "A String", # Required. The raw bytes of the data.
            "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
          },
          "text": "A String", # Optional. The text content of the part.
          "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
          "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            "endOffset": "A String", # Optional. The end offset of the video.
            "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            "startOffset": "A String", # Optional. The start offset of the video.
          },
        },
      ],
      "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
    },
  ],
  "generationConfig": { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config.
    "audioTimestamp": True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    "candidateCount": 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    "enableAffectiveDialog": True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    "frequencyPenalty": 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    "imageConfig": { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      "aspectRatio": "A String", # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: "1:1" "2:3", "3:2" "3:4", "4:3" "4:5", "5:4" "9:16", "16:9" "21:9"
      "imageOutputOptions": { # The image output format for generated images. # Optional. The image output format for generated images.
        "compressionQuality": 42, # Optional. The compression quality of the output image.
        "mimeType": "A String", # Optional. The image format that the output should be saved as.
      },
      "personGeneration": "A String", # Optional. Controls whether the model can generate people.
    },
    "logprobs": 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    "maxOutputTokens": 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    "mediaResolution": "A String", # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    "presencePenalty": 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    "responseJsonSchema": "", # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    "responseLogprobs": True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging.
    "responseMimeType": "A String", # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    "responseModalities": [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      "A String",
    ],
    "responseSchema": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      "default": "", # Optional. Default value of the data.
      "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "description": "A String", # Optional. The description of the data.
      "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
        "A String",
      ],
      "example": "", # Optional. Example of the object. Will only populated when the object is the root.
      "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
      "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
      "maxLength": "A String", # Optional. Maximum length of the Type.STRING
      "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
      "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
      "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
      "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      "nullable": True or False, # Optional. Indicates if the value may be null.
      "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        "A String",
      ],
      "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
      "required": [ # Optional. Required properties of Type.OBJECT.
        "A String",
      ],
      "title": "A String", # Optional. The title of the Schema.
      "type": "A String", # Optional. The type of the data.
    },
    "routingConfig": { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      "autoMode": { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        "modelRoutingPreference": "A String", # The model routing preference.
      },
      "manualMode": { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        "modelName": "A String", # The name of the model to use. Only public LLM models are accepted.
      },
    },
    "seed": 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    "speechConfig": { # Configuration for speech generation. # Optional. The speech generation config.
      "languageCode": "A String", # Optional. The language code (ISO 639-1) for the speech synthesis.
      "multiSpeakerVoiceConfig": { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        "speakerVoiceConfigs": [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            "speaker": "A String", # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            "voiceConfig": { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                "voiceName": "A String", # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      "voiceConfig": { # Configuration for a voice. # The configuration for the voice to use.
        "prebuiltVoiceConfig": { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          "voiceName": "A String", # The name of the prebuilt voice to use.
        },
      },
    },
    "stopSequences": [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker.
      "A String",
    ],
    "temperature": 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    "thinkingConfig": { # Configuration for the model's thinking features. "Thinking" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don't support thinking.
      "includeThoughts": True or False, # Optional. If true, the model will include its thoughts in the response. "Thoughts" are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model's reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      "thinkingBudget": 42, # Optional. The token budget for the model's thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    "topK": 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    "topP": 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both.
  },
  "labels": { # Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
    "a_key": "A String",
  },
  "modelArmorConfig": { # Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. # Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.
    "promptTemplateName": "A String", # Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user's prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
    "responseTemplateName": "A String", # Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model's response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
  },
  "safetySettings": [ # Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
    { # A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.
      "category": "A String", # Required. The harm category to be blocked.
      "method": "A String", # Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
      "threshold": "A String", # Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    },
  ],
  "systemInstruction": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          "outcome": "A String", # Required. Outcome of the code execution.
          "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          "code": "A String", # Required. The code to be executed.
          "language": "A String", # Required. Programming language of the `code`.
        },
        "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            "a_key": "", # Properties of the object.
          },
          "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              "fileData": { # URI based data for function response. # URI based data.
                "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                "data": "A String", # Required. Raw bytes.
                "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
            "a_key": "", # Properties of the object.
          },
        },
        "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          "data": "A String", # Required. The raw bytes of the data.
          "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
        },
        "text": "A String", # Optional. The text content of the part.
        "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
        "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          "endOffset": "A String", # Optional. The end offset of the video.
          "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          "startOffset": "A String", # Optional. The start offset of the video.
        },
      },
    ],
    "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  },
  "toolConfig": { # Tool config. This config is shared for all tools provided in the request. # Optional. Tool config. This config is shared for all tools provided in the request.
    "functionCallingConfig": { # Function calling config. # Optional. Function calling config.
      "allowedFunctionNames": [ # Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.
        "A String",
      ],
      "mode": "A String", # Optional. Function calling mode.
    },
    "retrievalConfig": { # Retrieval config. # Optional. Retrieval config.
      "languageCode": "A String", # The language code of the user.
      "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # The location of the user.
        "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
        "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
      },
    },
  },
  "tools": [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      "codeExecution": { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      "computerUse": { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        "environment": "A String", # Required. The environment being operated.
        "excludedPredefinedFunctions": [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          "A String",
        ],
      },
      "enterpriseWebSearch": { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          "A String",
        ],
      },
      "functionDeclarations": [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          "description": "A String", # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          "name": "A String", # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          "parameters": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "parametersJsonSchema": "", # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`.
          "response": { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            "additionalProperties": "", # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            "anyOf": [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            "default": "", # Optional. Default value of the data.
            "defs": { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "description": "A String", # Optional. The description of the data.
            "enum": [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
              "A String",
            ],
            "example": "", # Optional. Example of the object. Will only populated when the object is the root.
            "format": "A String", # Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
            "items": # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            "maxItems": "A String", # Optional. Maximum number of the elements for Type.ARRAY.
            "maxLength": "A String", # Optional. Maximum length of the Type.STRING
            "maxProperties": "A String", # Optional. Maximum number of the properties for Type.OBJECT.
            "maximum": 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            "minItems": "A String", # Optional. Minimum number of the elements for Type.ARRAY.
            "minLength": "A String", # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            "minProperties": "A String", # Optional. Minimum number of the properties for Type.OBJECT.
            "minimum": 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            "nullable": True or False, # Optional. Indicates if the value may be null.
            "pattern": "A String", # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            "properties": { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              "a_key": # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            "propertyOrdering": [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              "A String",
            ],
            "ref": "A String", # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
            "required": [ # Optional. Required properties of Type.OBJECT.
              "A String",
            ],
            "title": "A String", # Optional. The title of the Schema.
            "type": "A String", # Optional. The type of the data.
          },
          "responseJsonSchema": "", # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      "googleMaps": { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        "enableWidget": True or False, # Optional. If true, include the widget context token in the response.
      },
      "googleSearch": { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        "blockingConfidence": "A String", # Optional. Sites with confidence level chosen & above this value will be blocked from the search results.
        "excludeDomains": [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"].
          "A String",
        ],
      },
      "googleSearchRetrieval": { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        "dynamicRetrievalConfig": { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          "dynamicThreshold": 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          "mode": "A String", # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      "retrieval": { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        "disableAttribution": True or False, # Optional. Deprecated. This option is no longer supported.
        "externalApi": { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          "apiAuth": { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            "apiKeyConfig": { # The API secret. # The API secret.
              "apiKeySecretVersion": "A String", # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              "apiKeyString": "A String", # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          "apiSpec": "A String", # The API spec that the external API implements.
          "authConfig": { # Auth configuration to run the extension. # The authentication config to access the API.
            "apiKeyConfig": { # Config for authentication with API key. # Config for API key auth.
              "apiKeySecret": "A String", # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              "apiKeyString": "A String", # Optional. The API key to be used in the request directly.
              "httpElementLocation": "A String", # Optional. The location of the API key.
              "name": "A String", # Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.
            },
            "authType": "A String", # Type of auth scheme.
            "googleServiceAccountConfig": { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              "serviceAccount": "A String", # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            "httpBasicAuthConfig": { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              "credentialSecret": "A String", # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            "oauthConfig": { # Config for user oauth. # Config for user oauth.
              "accessToken": "A String", # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            "oidcConfig": { # Config for user OIDC auth. # Config for user OIDC auth.
              "idToken": "A String", # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              "serviceAccount": "A String", # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          "elasticSearchParams": { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            "index": "A String", # The ElasticSearch index to use.
            "numHits": 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            "searchTemplate": "A String", # The ElasticSearch search template to use.
          },
          "endpoint": "A String", # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          "simpleSearchParams": { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        "vertexAiSearch": { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          "dataStoreSpecs": [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              "dataStore": "A String", # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              "filter": "A String", # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          "datastore": "A String", # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          "engine": "A String", # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          "filter": "A String", # Optional. Filter strings to be passed to the search API.
          "maxResults": 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        "vertexRagStore": { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          "ragResources": [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              "ragCorpus": "A String", # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              "ragFileIds": [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                "A String",
              ],
            },
          ],
          "ragRetrievalConfig": { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            "filter": { # Config for filters. # Optional. Config for filters.
              "metadataFilter": "A String", # Optional. String for metadata filtering.
              "vectorDistanceThreshold": 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              "vectorSimilarityThreshold": 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            "ranking": { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              "llmRanker": { # Config for LlmRanker. # Optional. Config for LlmRanker.
                "modelName": "A String", # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              "rankService": { # Config for Rank Service. # Optional. Config for Rank Service.
                "modelName": "A String", # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            "topK": 42, # Optional. The number of contexts to retrieve.
          },
          "similarityTopK": 42, # Optional. Number of top k results to return from the selected corpora.
          "vectorDistanceThreshold": 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      "urlContext": { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for [PredictionService.GenerateContent].
  "candidates": [ # Output only. Generated candidates.
    { # A response candidate generated from the model.
      "avgLogprobs": 3.14, # Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response.
      "citationMetadata": { # A collection of citations that apply to a piece of generated content. # Output only. A collection of citations that apply to the generated content.
        "citations": [ # Output only. A list of citations for the content.
          { # A citation for a piece of generatedcontent.
            "endIndex": 42, # Output only. The end index of the citation in the content.
            "license": "A String", # Output only. The license of the source of the citation.
            "publicationDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. The publication date of the source of the citation.
              "day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
              "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
              "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
            },
            "startIndex": 42, # Output only. The start index of the citation in the content.
            "title": "A String", # Output only. The title of the source of the citation.
            "uri": "A String", # Output only. The URI of the source of the citation.
          },
        ],
      },
      "content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Output only. The content of the candidate.
        "parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
          { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
            "codeExecutionResult": { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
              "outcome": "A String", # Required. Outcome of the code execution.
              "output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
            },
            "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
              "code": "A String", # Required. The code to be executed.
              "language": "A String", # Required. Programming language of the `code`.
            },
            "fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
              "displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              "fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
              "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
            },
            "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
              "args": { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                "a_key": "", # Properties of the object.
              },
              "name": "A String", # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
            },
            "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
              "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
              "parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                  "fileData": { # URI based data for function response. # URI based data.
                    "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    "fileUri": "A String", # Required. URI.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
                    "data": "A String", # Required. Raw bytes.
                    "displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                },
              ],
              "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                "a_key": "", # Properties of the object.
              },
            },
            "inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
              "data": "A String", # Required. The raw bytes of the data.
              "displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
            },
            "text": "A String", # Optional. The text content of the part.
            "thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
            "thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
            "videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
              "endOffset": "A String", # Optional. The end offset of the video.
              "fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
              "startOffset": "A String", # Optional. The start offset of the video.
            },
          },
        ],
        "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
      },
      "finishMessage": "A String", # Output only. Describes the reason the model stopped generating tokens in more detail. This field is returned only when `finish_reason` is set.
      "finishReason": "A String", # Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating.
      "groundingMetadata": { # Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources. # Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content.
        "googleMapsWidgetContextToken": "A String", # Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
        "groundingChunks": [ # A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
          { # A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information.
            "maps": { # A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. # A grounding chunk from Google Maps. See the `Maps` message for details.
              "placeAnswerSources": { # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
                "reviewSnippets": [ # Snippets of reviews that were used to generate the answer.
                  { # A review snippet that is used to generate the answer.
                    "googleMapsUri": "A String", # A link to show the review on Google Maps.
                    "reviewId": "A String", # The ID of the review that is being referenced.
                    "title": "A String", # The title of the review.
                  },
                ],
              },
              "placeId": "A String", # This Place's resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API.
              "text": "A String", # The text of the place answer.
              "title": "A String", # The title of the place.
              "uri": "A String", # The URI of the place.
            },
            "retrievedContext": { # Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. # A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details
              "documentName": "A String", # Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
              "ragChunk": { # A RagChunk includes the content of a chunk of a RagFile, and associated metadata. # Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
                "pageSpan": { # Represents where the chunk starts and ends in the document. # If populated, represents where the chunk starts and ends in the document.
                  "firstPage": 42, # Page where chunk starts in the document. Inclusive. 1-indexed.
                  "lastPage": 42, # Page where chunk ends in the document. Inclusive. 1-indexed.
                },
                "text": "A String", # The content of the chunk.
              },
              "text": "A String", # The content of the retrieved data source.
              "title": "A String", # The title of the retrieved data source.
              "uri": "A String", # The URI of the retrieved data source.
            },
            "web": { # A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information. # A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.
              "domain": "A String", # The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
              "title": "A String", # The title of the web page that contains the evidence.
              "uri": "A String", # The URI of the web page that contains the evidence.
            },
          },
        ],
        "groundingSupports": [ # Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
          { # A collection of supporting references for a segment of the model's response.
            "confidenceScores": [ # The confidence scores for the support references. This list is parallel to the `grounding_chunk_indices` list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim. For Gemini 2.0 and before, this list has the same size as `grounding_chunk_indices`. For Gemini 2.5 and later, this list is empty and should be ignored.
              3.14,
            ],
            "groundingChunkIndices": [ # A list of indices into the `grounding_chunks` field of the `GroundingMetadata` message. These indices specify which grounding chunks support the claim made in the content segment. For example, if this field has the values `[1, 3]`, it means that `grounding_chunks[1]` and `grounding_chunks[3]` are the sources for the claim in the content segment.
              42,
            ],
            "segment": { # A segment of the content. # The content segment that this support message applies to.
              "endIndex": 42, # Output only. The end index of the segment in the `Part`, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.
              "partIndex": 42, # Output only. The index of the `Part` object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
              "startIndex": 42, # Output only. The start index of the segment in the `Part`, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.
              "text": "A String", # Output only. The text of the segment.
            },
          },
        ],
        "retrievalMetadata": { # Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled. # Optional. Output only. Metadata related to the retrieval grounding source.
          "googleSearchDynamicRetrievalScore": 3.14, # Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
        },
        "searchEntryPoint": { # An entry point for displaying Google Search results. A `SearchEntryPoint` is populated when the grounding source for a model's response is Google Search. It provides information that you can use to display the search results in your application. # Optional. A web search entry point that can be used to display search results. This field is populated only when the grounding source is Google Search.
          "renderedContent": "A String", # Optional. An HTML snippet that can be embedded in a web page or an application's webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.
          "sdkBlob": "A String", # Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
        },
        "sourceFlaggingUris": [ # Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
          { # A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps.
            "flagContentUri": "A String", # The URI that can be used to flag the content.
            "sourceId": "A String", # The ID of the place or review.
          },
        ],
        "webSearchQueries": [ # Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
          "A String",
        ],
      },
      "index": 42, # Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` > 1.
      "logprobsResult": { # The log probabilities of the tokens generated by the model. This is useful for understanding the model's confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is "hallucinating" or generating factually incorrect information. # Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential "hallucinations".
        "chosenCandidates": [ # A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.
          { # A single token and its associated log probability.
            "logProbability": 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
            "token": "A String", # The token's string representation.
            "tokenId": 42, # The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.
          },
        ],
        "topCandidates": [ # A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.
          { # A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.
            "candidates": [ # The list of candidate tokens, sorted by log probability in descending order.
              { # A single token and its associated log probability.
                "logProbability": 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
                "token": "A String", # The token's string representation.
                "tokenId": 42, # The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.
              },
            ],
          },
        ],
      },
      "safetyRatings": [ # Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category.
        { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
          "blocked": True or False, # Output only. Indicates whether the content was blocked because of this rating.
          "category": "A String", # Output only. The harm category of this rating.
          "overwrittenThreshold": "A String", # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
          "probability": "A String", # Output only. The probability of harm for this category.
          "probabilityScore": 3.14, # Output only. The probability score of harm for this category.
          "severity": "A String", # Output only. The severity of harm for this category.
          "severityScore": 3.14, # Output only. The severity score of harm for this category.
        },
      ],
      "urlContextMetadata": { # Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. # Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL.
        "urlMetadata": [ # Output only. A list of URL metadata, with one entry for each URL retrieved by the tool.
          { # The metadata for a single URL retrieval.
            "retrievedUrl": "A String", # The URL retrieved by the tool.
            "urlRetrievalStatus": "A String", # The status of the URL retrieval.
          },
        ],
      },
    },
  ],
  "createTime": "A String", # Output only. Timestamp when the request is made to the server.
  "modelVersion": "A String", # Output only. The model version used to generate the response.
  "promptFeedback": { # Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. # Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
    "blockReason": "A String", # Output only. The reason why the prompt was blocked.
    "blockReasonMessage": "A String", # Output only. A readable message that explains the reason why the prompt was blocked.
    "safetyRatings": [ # Output only. A list of safety ratings for the prompt. There is one rating per category.
      { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
        "blocked": True or False, # Output only. Indicates whether the content was blocked because of this rating.
        "category": "A String", # Output only. The harm category of this rating.
        "overwrittenThreshold": "A String", # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
        "probability": "A String", # Output only. The probability of harm for this category.
        "probabilityScore": 3.14, # Output only. The probability score of harm for this category.
        "severity": "A String", # Output only. The severity of harm for this category.
        "severityScore": 3.14, # Output only. The severity score of harm for this category.
      },
    ],
  },
  "responseId": "A String", # Output only. response_id is used to identify each response. It is the encoding of the event_id.
  "usageMetadata": { # Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. # Usage metadata about the response(s).
    "cacheTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the cached content.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "cachedContentTokenCount": 42, # Output only. The number of tokens in the cached content that was used for this request.
    "candidatesTokenCount": 42, # The total number of tokens in the generated candidates.
    "candidatesTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the generated candidates.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "promptTokenCount": 42, # The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
    "promptTokensDetails": [ # Output only. A detailed breakdown of the token count for each modality in the prompt.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "thoughtsTokenCount": 42, # Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.
    "toolUsePromptTokenCount": 42, # Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
    "toolUsePromptTokensDetails": [ # Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        "modality": "A String", # The modality that this token count applies to.
        "tokenCount": 42, # The number of tokens counted for this modality.
      },
    ],
    "totalTokenCount": 42, # The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
    "trafficType": "A String", # Output only. The traffic type for this request.
  },
}
streamRawPredict(endpoint, body=None, x__xgafv=None)
Perform a streaming online prediction with an arbitrary HTTP payload.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.StreamRawPredict.
  "httpBody": { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged. # The prediction input. Supports HTTP headers and arbitrary data payload.
    "contentType": "A String", # The HTTP Content-Type header value specifying the content type of the body.
    "data": "A String", # The HTTP request/response body as raw binary.
    "extensions": [ # Application specific response metadata. Must be set in the first response for streaming APIs.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
  "contentType": "A String", # The HTTP Content-Type header value specifying the content type of the body.
  "data": "A String", # The HTTP request/response body as raw binary.
  "extensions": [ # Application specific response metadata. Must be set in the first response for streaming APIs.
    {
      "a_key": "", # Properties of the object. Contains field @type with type URL.
    },
  ],
}