Builder

public final class Builder

A builder for Interaction.

Functions

Link copied to clipboard

Alias for calling addStep with the following:

Link copied to clipboard

Alias for calling addStep with the following:

Link copied to clipboard

Alias for calling addStep with the following:

Link copied to clipboard
public final Interaction.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
Link copied to clipboard
Link copied to clipboard
public final Interaction.Builder addStep(CodeExecutionCallStep codeExecutionCall)

Alias for calling addStep with Step.ofCodeExecutionCall(codeExecutionCall).

public final Interaction.Builder addStep(CodeExecutionResultStep codeExecutionResult)

Alias for calling addStep with Step.ofCodeExecutionResult(codeExecutionResult).

public final Interaction.Builder addStep(FileSearchCallStep fileSearchCall)

Alias for calling addStep with Step.ofFileSearchCall(fileSearchCall).

public final Interaction.Builder addStep(FileSearchResultStep fileSearchResult)

Alias for calling addStep with Step.ofFileSearchResult(fileSearchResult).

public final Interaction.Builder addStep(FunctionCallStep functionCall)

Alias for calling addStep with Step.ofFunctionCall(functionCall).

public final Interaction.Builder addStep(FunctionResultStep functionResult)

Alias for calling addStep with Step.ofFunctionResult(functionResult).

public final Interaction.Builder addStep(GoogleMapsCallStep googleMapsCall)

Alias for calling addStep with Step.ofGoogleMapsCall(googleMapsCall).

public final Interaction.Builder addStep(GoogleMapsResultStep googleMapsResult)

Alias for calling addStep with Step.ofGoogleMapsResult(googleMapsResult).

public final Interaction.Builder addStep(GoogleSearchCallStep googleSearchCall)

Alias for calling addStep with Step.ofGoogleSearchCall(googleSearchCall).

public final Interaction.Builder addStep(GoogleSearchResultStep googleSearchResult)

Alias for calling addStep with Step.ofGoogleSearchResult(googleSearchResult).

public final Interaction.Builder addStep(McpServerToolCallStep mcpServerToolCall)

Alias for calling addStep with Step.ofMcpServerToolCall(mcpServerToolCall).

public final Interaction.Builder addStep(McpServerToolResultStep mcpServerToolResult)

Alias for calling addStep with Step.ofMcpServerToolResult(mcpServerToolResult).

public final Interaction.Builder addStep(ModelOutputStep modelOutput)

Alias for calling addStep with Step.ofModelOutput(modelOutput).

public final Interaction.Builder addStep(Step step)

Adds a single Step to steps.

public final Interaction.Builder addStep(ThoughtStep thought)

Alias for calling addStep with Step.ofThought(thought).

public final Interaction.Builder addStep(UrlContextCallStep urlContextCall)

Alias for calling addStep with Step.ofUrlContextCall(urlContextCall).

public final Interaction.Builder addStep(UrlContextResultStep urlContextResult)

Alias for calling addStep with Step.ofUrlContextResult(urlContextResult).

public final Interaction.Builder addStep(UserInputStep userInput)

Alias for calling addStep with Step.ofUserInput(userInput).

Link copied to clipboard
public final Interaction.Builder addTool(Function function)

Alias for calling addTool with Tool.ofFunction(function).

public final Interaction.Builder addTool(Tool tool)

Adds a single Tool to tools.

public final Interaction.Builder addTool(Tool.ComputerUse computerUse)

Alias for calling addTool with Tool.ofComputerUse(computerUse).

public final Interaction.Builder addTool(Tool.FileSearch fileSearch)

Alias for calling addTool with Tool.ofFileSearch(fileSearch).

public final Interaction.Builder addTool(Tool.GoogleMaps googleMaps)

Alias for calling addTool with Tool.ofGoogleMaps(googleMaps).

public final Interaction.Builder addTool(Tool.GoogleSearch googleSearch)

Alias for calling addTool with Tool.ofGoogleSearch(googleSearch).

public final Interaction.Builder addTool(Tool.McpServer mcpServer)

Alias for calling addTool with Tool.ofMcpServer(mcpServer).

public final Interaction.Builder addTool(Tool.Retrieval retrieval)

Alias for calling addTool with Tool.ofRetrieval(retrieval).

Link copied to clipboard

Alias for calling addTool with Tool.ofCodeExecution().

Link copied to clipboard

Alias for calling addTool with Tool.ofUrlContext().

Link copied to clipboard
public final Interaction.Builder agent(JsonField<Interaction.Agent> agent)

Sets Builder.agent to an arbitrary JSON value.

The name of the Agent used for generating the interaction.

public final Interaction.Builder agent(String value)

Sets agent to an arbitrary String.

Link copied to clipboard
public final Interaction.Builder agentConfig(JsonField<Interaction.AgentConfig> agentConfig)

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.

Link copied to clipboard
public final Interaction build()

Returns an immutable instance of Interaction.

Link copied to clipboard
public final Interaction.Builder created(JsonField<OffsetDateTime> created)

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).

Link copied to clipboard
public final Interaction.Builder generationConfig(JsonField<GenerationConfig> generationConfig)

Sets Builder.generationConfig to an arbitrary JSON value.

public final Interaction.Builder generationConfig(GenerationConfig generationConfig)

Input only. Configuration parameters for the model interaction.

Link copied to clipboard
public final Interaction.Builder id(JsonField<String> id)

Sets Builder.id to an arbitrary JSON value.

public final Interaction.Builder id(String id)

Required. Output only. A unique identifier for the interaction completion.

Link copied to clipboard
public final Interaction.Builder input(JsonField<Interaction.Input> input)

Sets Builder.input to an arbitrary JSON value.

public final Interaction.Builder input(AudioContent audioContent)

Alias for calling input with Input.ofAudioContent(audioContent).

public final Interaction.Builder input(DocumentContent documentContent)

Alias for calling input with Input.ofDocumentContent(documentContent).

public final Interaction.Builder input(ImageContent imageContent)

Alias for calling input with Input.ofImageContent(imageContent).

The input for the interaction.

public final Interaction.Builder input(TextContent textContent)

Alias for calling input with Input.ofTextContent(textContent).

public final Interaction.Builder input(VideoContent videoContent)

Alias for calling input with Input.ofVideoContent(videoContent).

public final Interaction.Builder input(String string)

Alias for calling input with Input.ofString(string).

Link copied to clipboard
public final Interaction.Builder inputOfContentList(List<Content> contentList)

Alias for calling input with Input.ofContentList(contentList).

Link copied to clipboard
public final Interaction.Builder inputOfStepList(List<Step> stepList)

Alias for calling input with Input.ofStepList(stepList).

Link copied to clipboard
public final Interaction.Builder model(JsonField<Model> model)

Sets Builder.model to an arbitrary JSON value.

public final Interaction.Builder model(Model model)

The model that will complete your prompt.\n\nSee models for additional details.

public final Interaction.Builder model(String value)

Sets model to an arbitrary String.

Link copied to clipboard
public final Interaction.Builder previousInteractionId(JsonField<String> previousInteractionId)

Sets Builder.previousInteractionId to an arbitrary JSON value.

public final Interaction.Builder previousInteractionId(String previousInteractionId)

The ID of the previous interaction, if any.

Link copied to clipboard
public final Interaction.Builder putAdditionalProperty(String key, JsonValue value)
Link copied to clipboard
public final Interaction.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
Link copied to clipboard
Link copied to clipboard
public final Interaction.Builder responseFormat(JsonField<Interaction.ResponseFormat> responseFormat)

Sets Builder.responseFormat to an arbitrary JSON value.

public final Interaction.Builder responseFormat(JsonValue jsonValue)

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).

Link copied to clipboard

Alias for calling responseFormat with ResponseFormat.ofList(list).

Link copied to clipboard
public final Interaction.Builder responseMimeType(JsonField<String> responseMimeType)

Sets Builder.responseMimeType to an arbitrary JSON value.

public final Interaction.Builder responseMimeType(String responseMimeType)

The mime type of the response. This is required if response_format is set.

Link copied to clipboard
public final Interaction.Builder responseModalities(JsonField<List<Interaction.ResponseModality>> responseModalities)

Sets Builder.responseModalities to an arbitrary JSON value.

The requested modalities of the response (TEXT, IMAGE, AUDIO).

Link copied to clipboard
@Deprecated(message = "deprecated")
public final Interaction.Builder role(JsonField<String> role)

Sets Builder.role to an arbitrary JSON value.

@Deprecated(message = "deprecated")
public final Interaction.Builder role(String role)

Output only. The role of the interaction.

Link copied to clipboard
public final Interaction.Builder serviceTier(JsonField<Interaction.ServiceTier> serviceTier)

Sets Builder.serviceTier to an arbitrary JSON value.

The service tier for the interaction.

Link copied to clipboard
public final Interaction.Builder status(JsonField<Interaction.Status> status)

Sets Builder.status to an arbitrary JSON value.

Required. Output only. The status of the interaction.

Link copied to clipboard
public final Interaction.Builder steps(JsonField<List<Step>> steps)

Sets Builder.steps to an arbitrary JSON value.

public final Interaction.Builder steps(List<Step> steps)

Required. Output only. The steps that make up the interaction.

Link copied to clipboard
public final Interaction.Builder systemInstruction(JsonField<String> systemInstruction)

Sets Builder.systemInstruction to an arbitrary JSON value.

public final Interaction.Builder systemInstruction(String systemInstruction)

System instruction for the interaction.

Link copied to clipboard
public final Interaction.Builder tools(JsonField<List<Tool>> tools)

Sets Builder.tools to an arbitrary JSON value.

public final Interaction.Builder tools(List<Tool> tools)

A list of tool declarations the model may call during interaction.

Link copied to clipboard
public final Interaction.Builder updated(JsonField<OffsetDateTime> updated)

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).

Link copied to clipboard
public final Interaction.Builder usage(JsonField<Usage> usage)

Sets Builder.usage to an arbitrary JSON value.

public final Interaction.Builder usage(Usage usage)

Output only. Statistics on the interaction request's token usage.

Link copied to clipboard
public final Interaction.Builder webhookConfig(JsonField<Interaction.WebhookConfig> webhookConfig)

Sets Builder.webhookConfig to an arbitrary JSON value.

Optional. Webhook configuration for receiving notifications when the interaction completes.