Full name: projects.locations.interactions.createStream
Creates an interaction and streams the response.
Endpoint
posthttps://{service-endpoint}/v1beta1/projects/*/locations/*/interactions:createStream
Where {service-endpoint} is one of the supported service endpoints.
Request body
The request body contains data with the following structure:
streamboolean
Input only. Whether the interaction will be streamed.
storeboolean
Input only. Whether to store the response and request for later retrieval.
interaction.contentList
(deprecated).contents[].text.textstring
Required. The text content.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.documentUristring
The URI of the file.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.fileNamestring
The name of the file.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.sourcestring
Source attributed for a portion of the text.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].namestring
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.pageNumberinteger
Page number of the cited document, if applicable.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.mediaIdstring
Media id in-case of image citations, if applicable.
interaction.contentList
(deprecated).contents[].text.annotations[].startIndexinteger
Start of segment of the response that is attributed to this source.
Index indicates the start of the segment, measured in bytes.
interaction.contentList
(deprecated).contents[].text.annotations[].endIndexinteger
End of the attributed segment, exclusive.
interaction.contentList
(deprecated).contents[].image.mimeTypeStringstring
Flexible MIME type string of the image, superseding mimeType = 1. Note: Bespoke logic in the GAOS parser/serializer maps this to the "mimeType" JSON key.
The resolution of the media.
interaction.contentList
(deprecated).contents[].audio.mimeTypeStringstring
Flexible MIME type string of the audio, superseding mimeType = 1. Note: Bespoke logic in the GAOS parser/serializer maps this to the "mimeType" JSON key.
interaction.contentList
(deprecated).contents[].audio.channelsinteger
The number of audio channels.
interaction.contentList
(deprecated).contents[].audio.sampleRateinteger
The sample rate of the audio.
interaction.contentList
(deprecated).contents[].document.mimeTypeStringstring
Flexible MIME type string of the document, superseding mimeType = 1. Note: Bespoke logic in the GAOS parser/serializer maps this to the "mimeType" JSON key.
interaction.contentList
(deprecated).contents[].video.mimeTypeStringstring
Flexible MIME type string of the video, superseding mimeType = 1. Note: Bespoke logic in the GAOS parser/serializer maps this to the "mimeType" JSON key.
The resolution of the media.
interaction.contentList
(deprecated).contents[].video.namestring
A user-defined name for this content block. Can be referenced by the model in the final response.
interaction.stepList.steps[].text
(deprecated).textstring
interaction.stepList.steps[].image
(deprecated).mimeTypeStringstring
interaction.stepList.steps[].audio
(deprecated).mimeTypeStringstring
interaction.stepList.steps[].audio
(deprecated).rateinteger
interaction.stepList.steps[].audio
(deprecated).channelsinteger
interaction.stepList.steps[].audio
(deprecated).sampleRateinteger
interaction.stepList.steps[].document
(deprecated).mimeTypeStringstring
interaction.stepList.steps[].video
(deprecated).mimeTypeStringstring
interaction.stepList.steps[].video
(deprecated).namestring
interaction.idstring
Required. Output only. A unique identifier for the interaction completion.
Required. Output only. The status of the interaction.
interaction.createdstring
Required. Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
interaction.updatedstring
Required. Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
interaction.role
(deprecated)string
Output only. The role of the interaction.
Output only. Responses from the model.
A list of tool declarations the model may call during interaction.
Output only. Statistics on the interaction request's token usage.
The requested modalities of the response (TEXT, IMAGE, AUDIO).
interaction.responseMimeType
(deprecated)string
The mime type of the response. This is required if responseFormat is set.
interaction.previousInteractionIdstring
The id of the previous interaction, if any.
interaction.environmentIdstring
Output only. The environment id for the interaction. Only populated if environment config is set in the request.
Required. Output only. The steps that make up the interaction.
Safety settings for the interaction.
interaction.labelsmap (key: string, value: string)
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.
Output only. Diagnostic faults / platform errors recorded on the interaction.
backgroundboolean
Input only. Whether to run the model interaction in the background.
system_instruction_configUnion type
interaction.systemInstructionstring
System instruction for the interaction.
typeUnion type
NOTE: We use these instead of the Citation message for historical reasons. A URL citation annotation.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitationobject (FileCitation)
A file citation annotation.
interaction.contentList
(deprecated).contents[].text.annotations[].placeCitationobject (PlaceCitation)
A place citation annotation.
word-level ASR annotation with timing and speaker info.
kindUnion type
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.nullValuenull
Represents a null value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.numberValuenumber
Represents a double value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.stringValuestring
Represents a string value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.boolValueboolean
Represents a boolean value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.structValueobject (Struct)
Represents a structured value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.listValueobject (ListValue)
Represents a repeated value.
interaction.contentList
(deprecated).contents[].text.annotations[].fileCitation.customMetadata.fields[].value.contentValueobject (Content)
Represents rich content (text, image, etc.).
data_or_uriUnion type
The image content.
A base64-encoded string.
interaction.contentList
(deprecated).contents[].image.uristring
The URI of the image.
data_or_uriUnion type
The audio content.
A base64-encoded string.
interaction.contentList
(deprecated).contents[].audio.uristring
The URI of the audio.
data_or_uriUnion type
The document content.
A base64-encoded string.
interaction.contentList
(deprecated).contents[].document.uristring
The URI of the document.
data_or_uriUnion type
The video content.
A base64-encoded string.
interaction.contentList
(deprecated).contents[].video.uristring
The URI of the video.
processingUnion type
typeUnion type
inputUnion type
The inputs for the interaction.
interaction.stringContentstring
A string input for the interaction, it will be processed as a single text input.
interaction.turnList
(deprecated)object (TurnList)
The turns for the interaction.
Input only. The steps for the interaction.
The content for the interaction.
typeUnion type
DO NOT USE -- These are for 3P JSON only
interaction.stepList.steps[].text
(deprecated)object (LegacyTextContent)
interaction.stepList.steps[].image
(deprecated)object (LegacyImageContent)
interaction.stepList.steps[].audio
(deprecated)object (LegacyAudioContent)
interaction.stepList.steps[].document
(deprecated)object (LegacyDocumentContent)
interaction.stepList.steps[].video
(deprecated)object (LegacyVideoContent)
data_or_uriUnion type
A base64-encoded string.
interaction.stepList.steps[].image
(deprecated).uristring
data_or_uriUnion type
A base64-encoded string.
interaction.stepList.steps[].audio
(deprecated).uristring
data_or_uriUnion type
A base64-encoded string.
interaction.stepList.steps[].document
(deprecated).uristring
data_or_uriUnion type
A base64-encoded string.
interaction.stepList.steps[].video
(deprecated).uristring
processingUnion type
response_format_configUnion type
Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
request_typeUnion type
Interaction for generating the completion using models.
Interaction for generating the completion using agents.
environmentUnion type
interaction.envIdstring
The environment id for the interaction. Can be 'remote' for default environment.
The agent's environment lives on the client connection: its built-in environment operations (filesystem ops and running commands) are yielded to the client to execute, instead of running in a server-managed sandbox. Mutually exclusive with remoteEnvironment. (Independent of any client-declared function tools, which are always executed on the client regardless of this field.)
Response body
If successful, the response body contains a stream of InteractionStreamingEvent instances.