Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
The base structured datatype containing multi-part content of a message.
A Content includes a role field designating the producer of the Content and a parts field containing multi-part data that contains the content of the message turn.
Fields
role
string
Optional. The producer of the content. Must be either 'user' or 'model'.
Useful to set for multi-turn conversations, otherwise can be left blank or unset.
Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
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 (codeExecution, googleSearch, and urlContext) are enabled.
Required. The IANA standard MIME type of the source data.
fileUri
string
Required. URI.
displayName
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 (codeExecution, googleSearch, and urlContext) are enabled.
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.
Fields
name
string
Required. The name of the function to call. Matches [FunctionDeclaration.name].
Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
JSON representation
{"name": string,"args": {object}}
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.
Fields
name
string
Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
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.
JSON representation
{"name": string,"response": {object}}
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-06 UTC."],[],[],null,["# Content\n\nThe base structured datatype containing multi-part content of a message.\n\nA `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.\nFields `role` `string` \nOptional. The producer of the content. Must be either 'user' or 'model'.\n\nUseful to set for multi-turn conversations, otherwise can be left blank or unset.\n`parts[]` `object (`[Part](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#Part)`)` \nRequired. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types. \n\nPart\n----\n\nA datatype containing media that is part of a multi-part `Content` message.\n\nA `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`.\n\nA `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inlineData` or `fileData` field is filled with raw bytes.\nFields `thought` `boolean` \nOptional. Indicates if the part is thought from the model.\n`thoughtSignature` `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` \nOptional. An opaque signature for the thought so it can be reused in subsequent requests.\n\nA base64-encoded string. \n`data` `Union type` \n`data` can be only one of the following:\n`text` `string` \nOptional. Text part (can be code).\n`inlineData` `object (`[Blob](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#Blob)`)` \nOptional. Inlined bytes data.\n`fileData` `object (`[FileData](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#FileData)`)` \nOptional. URI based data.\n`functionCall` `object (`[FunctionCall](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#FunctionCall)`)` \nOptional. A predicted \\[FunctionCall\\] returned from the model that contains a string representing the \\[FunctionDeclaration.name\\] with the parameters and their values.\n`functionResponse` `object (`[FunctionResponse](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#FunctionResponse)`)` \nOptional. The result output of a \\[FunctionCall\\] that contains a string representing the \\[FunctionDeclaration.name\\] and a structured JSON object containing any output from the function call. It is used as context to the model.\n`executableCode` `object (`[ExecutableCode](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#ExecutableCode)`)` \nOptional. code generated by the model that is meant to be executed.\n`codeExecutionResult` `object (`[CodeExecutionResult](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#CodeExecutionResult)`)` \nOptional. result of executing the \\[ExecutableCode\\]. \n`metadata` `Union type` \n`metadata` can be only one of the following:\n`videoMetadata` `object (`[VideoMetadata](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#VideoMetadata)`)` \nOptional. Video metadata. The metadata should only be specified while the video data is presented in inlineData or fileData. \n\nBlob\n----\n\nContent blob.\nFields `mimeType` `string` \nRequired. The IANA standard MIME type of the source data.\n`data` `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` \nRequired. Raw bytes.\n\nA base64-encoded string.\n`displayName` `string` \nOptional. Display name of the blob.\n\nUsed to provide a label or filename to distinguish blobs.\n\nThis field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (codeExecution, googleSearch, and urlContext) are enabled. \n\nFileData\n--------\n\nURI based data.\nFields `mimeType` `string` \nRequired. The IANA standard MIME type of the source data.\n`fileUri` `string` \nRequired. URI.\n`displayName` `string` \nOptional. Display name of the file data.\n\nUsed to provide a label or filename to distinguish file datas.\n\nThis field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (codeExecution, googleSearch, and urlContext) are enabled. \n\nFunctionCall\n------------\n\nA 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.\nFields `name` `string` \nRequired. The name of the function to call. Matches \\[FunctionDeclaration.name\\].\n`args` `object (`[Struct](https://protobuf.dev/reference/protobuf/google.protobuf/#struct)` format)` \nOptional. The function parameters and values in JSON object format. See \\[FunctionDeclaration.parameters\\] for parameter details. \n\nFunctionResponse\n----------------\n\nThe 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.\nFields `name` `string` \nRequired. The name of the function to call. Matches \\[FunctionDeclaration.name\\] and \\[FunctionCall.name\\].\n`response` `object (`[Struct](https://protobuf.dev/reference/protobuf/google.protobuf/#struct)` format)` \nRequired. 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. \n\nExecutableCode\n--------------\n\ncode generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the \\[CodeExecution\\] tool, in which the code will be automatically executed, and a corresponding \\[CodeExecutionResult\\] will also be generated.\nFields `language` `enum (`[Language](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#Language)`)` \nRequired. Programming language of the `code`.\n`code` `string` \nRequired. The code to be executed. \n\nLanguage\n--------\n\nSupported programming languages for the generated code.\n\nCodeExecutionResult\n-------------------\n\nresult of executing the \\[ExecutableCode\\].\n\nOnly generated when using the \\[CodeExecution\\] tool, and always follows a `part` containing the \\[ExecutableCode\\].\nFields `outcome` `enum (`[Outcome](/vertex-ai/generative-ai/docs/reference/rest/v1/Content#Outcome)`)` \nRequired. Outcome of the code execution.\n`output` `string` \nOptional. Contains stdout when code execution is successful, stderr or other description otherwise. \n\nOutcome\n-------\n\nEnumeration of possible outcomes of the code execution.\n\nVideoMetadata\n-------------\n\nmetadata describes the input video content.\nFields `startOffset` `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` \nOptional. The start offset of the video.\n\nA duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`.\n`endOffset` `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` \nOptional. The end offset of the video.\n\nA duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`.\n`fps` `number` \nOptional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0\\]."]]