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 ( |
Fields | |
---|---|
parts[] |
Ordered |
role |
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 |
Fields | |
---|---|
Union field
|
|
text |
Inline text. |
inlineData |
Inline media bytes. |
functionCall |
A predicted |
functionResponse |
The result output of a |
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 |
The IANA standard MIME type of the source data. Accepted types include: "image/png", "image/jpeg", "image/heic", "image/heif", "image/webp". |
data |
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 |
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 |
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 |
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 |
Required. The function response in JSON object format. |
FileData
URI based data.
JSON representation |
---|
{ "mimeType": string, "fileUri": string } |
Fields | |
---|---|
mimeType |
Optional. The IANA standard MIME type of the source data. |
fileUri |
Required. URI. |