Content

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.

JSON representation
{
  "parts": [
    {
      object (Part)
    }
  ],
  "role": string
}
Fields
parts[]

object (Part)

Ordered Parts that constitute a single message. Parts may have different MIME types.

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.

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.

A Part must have a fixed IANA MIME type identifying the type and subtype of the media if the inlineData field is filled with raw bytes.

JSON representation
{

  // Union field data can be only one of the following:
  "text": string,
  "inlineData": {
    object (Blob)
  },
  "functionCall": {
    object (FunctionCall)
  },
  "functionResponse": {
    object (FunctionResponse)
  },
  "fileData": {
    object (FileData)
  }
  // End of list of possible types for union field data.
}
Fields

Union field data.

data can be only one of the following:

text

string

Inline text.

inlineData

object (Blob)

Inline media bytes.

functionCall

object (FunctionCall)

A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values.

functionResponse

object (FunctionResponse)

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 is used as context to the model.

fileData

object (FileData)

URI based data.

Blob

Raw media bytes.

Text should not be sent as raw bytes, use the 'text' field.

JSON representation
{
  "mimeType": string,
  "data": string
}
Fields
mimeType

string

The IANA standard MIME type of the source data. Accepted types include: "image/png", "image/jpeg", "image/heic", "image/heif", "image/webp".

data

string (bytes format)

Raw bytes for media formats.

A base64-encoded string.

FunctionCall

A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values.

JSON representation
{
  "name": string,
  "args": {
    object
  }
}
Fields
name

string

Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.

args

object (Struct format)

Optional. The function parameters and values in JSON object format.

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 aFunctionCall made based on model prediction.

JSON representation
{
  "name": string,
  "response": {
    object
  }
}
Fields
name

string

Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.

response

object (Struct format)

Required. The function response in JSON object format.

FileData

URI based data.

JSON representation
{
  "mimeType": string,
  "fileUri": string
}
Fields
mimeType

string

Optional. The IANA standard MIME type of the source data.

fileUri

string

Required. URI.