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.modelInteraction.modelstring
The name of the Model used for generating the completion.
interaction.modelInteraction.generationConfig.temperaturenumber
Controls the randomness of the output.
interaction.modelInteraction.generationConfig.topPnumber
The maximum cumulative probability of tokens to consider when sampling.
interaction.modelInteraction.generationConfig.seedinteger
Seed used in decoding for reproducibility.
interaction.modelInteraction.generationConfig.stopSequences[]string
A list of character sequences that will stop output interaction.
The level of thought tokens that the model should generate.
Whether to include thought summaries in the response.
interaction.modelInteraction.generationConfig.maxOutputTokensinteger
The maximum number of tokens to include in the response.
Configuration for image interaction.
Configuration for video generation.
Optional. Configuration for speech recognition (transcription). If present, ASR is enabled.
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.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)
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.
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)
response_format_configUnion type
Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
tool_choiceUnion type
The mode of the tool choice.
The config for the tool choice.
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.