Builder
A builder for Interaction.
Functions
Alias for calling addStep with the following:
Alias for calling addStep with the following:
Alias for calling addStep with the following:
Adds a single ResponseModality to responseModalities.
Alias for calling addStep with Step.ofCodeExecutionCall(codeExecutionCall).
Alias for calling addStep with Step.ofCodeExecutionResult(codeExecutionResult).
Alias for calling addStep with Step.ofFileSearchCall(fileSearchCall).
Alias for calling addStep with Step.ofFileSearchResult(fileSearchResult).
Alias for calling addStep with Step.ofFunctionCall(functionCall).
Alias for calling addStep with Step.ofFunctionResult(functionResult).
Alias for calling addStep with Step.ofGoogleMapsCall(googleMapsCall).
Alias for calling addStep with Step.ofGoogleMapsResult(googleMapsResult).
Alias for calling addStep with Step.ofGoogleSearchCall(googleSearchCall).
Alias for calling addStep with Step.ofGoogleSearchResult(googleSearchResult).
Alias for calling addStep with Step.ofMcpServerToolCall(mcpServerToolCall).
Alias for calling addStep with Step.ofMcpServerToolResult(mcpServerToolResult).
Alias for calling addStep with Step.ofModelOutput(modelOutput).
Alias for calling addStep with Step.ofThought(thought).
Alias for calling addStep with Step.ofUrlContextCall(urlContextCall).
Alias for calling addStep with Step.ofUrlContextResult(urlContextResult).
Alias for calling addStep with Step.ofUserInput(userInput).
Alias for calling addTool with Tool.ofFunction(function).
Alias for calling addTool with Tool.ofComputerUse(computerUse).
Alias for calling addTool with Tool.ofFileSearch(fileSearch).
Alias for calling addTool with Tool.ofGoogleMaps(googleMaps).
Alias for calling addTool with Tool.ofGoogleSearch(googleSearch).
Alias for calling addTool with Tool.ofMcpServer(mcpServer).
Alias for calling addTool with Tool.ofRetrieval(retrieval).
Alias for calling addTool with Tool.ofCodeExecution().
Alias for calling addTool with Tool.ofUrlContext().
Sets Builder.agent to an arbitrary JSON value.
The name of the Agent used for generating the interaction.
Sets Builder.agentConfig to an arbitrary JSON value.
Alias for calling agentConfig with AgentConfig.ofDeepResearch(deepResearch).
Alias for calling agentConfig with AgentConfig.ofDynamic(dynamic).
Configuration parameters for the agent interaction.
Returns an immutable instance of Interaction.
Sets Builder.created to an arbitrary JSON value.
Required. Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
Sets Builder.generationConfig to an arbitrary JSON value.
Input only. Configuration parameters for the model interaction.
Sets Builder.id to an arbitrary JSON value.
Required. Output only. A unique identifier for the interaction completion.
Sets Builder.input to an arbitrary JSON value.
Alias for calling input with Input.ofAudioContent(audioContent).
Alias for calling input with Input.ofDocumentContent(documentContent).
Alias for calling input with Input.ofImageContent(imageContent).
The input for the interaction.
Alias for calling input with Input.ofTextContent(textContent).
Alias for calling input with Input.ofVideoContent(videoContent).
Alias for calling input with Input.ofString(string).
Alias for calling input with Input.ofContentList(contentList).
Alias for calling input with Input.ofStepList(stepList).
Sets Builder.model to an arbitrary JSON value.
The model that will complete your prompt.\n\nSee models for additional details.
Sets Builder.previousInteractionId to an arbitrary JSON value.
The ID of the previous interaction, if any.
Sets Builder.responseFormat to an arbitrary JSON value.
Alias for calling responseFormat with ResponseFormat.ofJsonValue(jsonValue).
Alias for calling responseFormat with ResponseFormat.ofAudio(audio).
Alias for calling responseFormat with ResponseFormat.ofImage(image).
Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
Alias for calling responseFormat with ResponseFormat.ofText(text).
Alias for calling responseFormat with ResponseFormat.ofList(list).
Sets Builder.responseMimeType to an arbitrary JSON value.
The mime type of the response. This is required if response_format is set.
Sets Builder.responseModalities to an arbitrary JSON value.
The requested modalities of the response (TEXT, IMAGE, AUDIO).
Sets Builder.role to an arbitrary JSON value.
Output only. The role of the interaction.
Sets Builder.serviceTier to an arbitrary JSON value.
The service tier for the interaction.
Sets Builder.status to an arbitrary JSON value.
Required. Output only. The status of the interaction.
Sets Builder.steps to an arbitrary JSON value.
Required. Output only. The steps that make up the interaction.
Sets Builder.systemInstruction to an arbitrary JSON value.
System instruction for the interaction.
Sets Builder.tools to an arbitrary JSON value.
A list of tool declarations the model may call during interaction.
Sets Builder.updated to an arbitrary JSON value.
Required. Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
Sets Builder.usage to an arbitrary JSON value.
Output only. Statistics on the interaction request's token usage.
Sets Builder.webhookConfig to an arbitrary JSON value.
Optional. Webhook configuration for receiving notifications when the interaction completes.