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.stepList.steps[].text
(deprecated).textstring
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.
interaction.systemInstructionstring
System instruction for the interaction.
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)
Optional. 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.
backgroundboolean
Input only. Whether to run the model interaction in the background.
typeUnion type
type can be only one of the following:inputUnion type
input can be only one of the following:The inputs for the interaction.
interaction.stringContentstring
A string input for the interaction, it will be processed as a single text input.
The turns for the interaction.
Input only. The steps for the interaction.
The content for the interaction.
typeUnion type
type can be only one of the following: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)
response_format_configUnion type
response_format_config can be only one of the following:Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
request_typeUnion type
request_type can be only one of the following:Interaction for generating the completion using models.
Interaction for generating the completion using agents.
environmentUnion type
environment can be only one of the following: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.