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)
  }
  // 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.

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.