Class Interaction.Builder

java.lang.Object
com.google.genai.gaos.models.interactions.Interaction.Builder
Enclosing class:
Interaction

public static final class Interaction.Builder extends Object
  • Method Details

    • agent

      public Interaction.Builder agent(@Nullable AgentOption agent)
      The agent to interact with.
    • agentConfig

      public Interaction.Builder agentConfig(@Nullable InteractionAgentConfig agentConfig)
      Configuration parameters for the agent interaction.
    • cachedContent

      @Deprecated public Interaction.Builder cachedContent(@Nullable String cachedContent)
      Deprecated.
      field: This will be removed in a future release, please migrate away from it as soon as possible.
      The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings.

      Format: cachedContents/{cachedContent}

    • continuationToken

      public Interaction.Builder continuationToken(@Nullable String continuationToken)
      Opaque token to resume a long decode. Output: set when status is INCOMPLETE and decoding can be resumed. Input: pass the latest token back unchanged in CreateInteraction to continue decoding.
    • created

      public Interaction.Builder created(@Nullable String created)
      Required. Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
    • environment

      public Interaction.Builder environment(@Nullable InteractionEnvironment environment)
      The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
    • environmentId

      public Interaction.Builder environmentId(@Nullable String environmentId)
      Output only. The environment ID for the interaction. Only populated if environment config is set in the request.
    • errors

      public Interaction.Builder errors(@Nullable List<Error> errors)
      Output only. Diagnostic faults / platform errors recorded on the interaction.
    • generationConfig

      public Interaction.Builder generationConfig(@Nullable GenerationConfig generationConfig)
      Configuration parameters for model interactions.
    • id

      public Interaction.Builder id(@Nullable String id)
      Required. Output only. A unique identifier for the interaction completion.
    • input

      public Interaction.Builder input(@Nullable InteractionsInput input)
      The input for the interaction.
    • labels

      public Interaction.Builder labels(@Nullable Map<String,String> labels)
      The labels with user-defined metadata for the request.

      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.

    • model

      public Interaction.Builder model(@Nullable Model model)
      The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
    • outputAudio

      public Interaction.Builder outputAudio(@Nullable AudioContent outputAudio)
      An audio content block.
    • outputImage

      public Interaction.Builder outputImage(@Nullable ImageContent outputImage)
      An image content block.
    • outputText

      public Interaction.Builder outputText(@Nullable String outputText)
      Concatenated text from the last model output in response to the current request.

      Note: this is added by the SDK.

    • outputVideo

      public Interaction.Builder outputVideo(@Nullable VideoContent outputVideo)
      A video content block.
    • previousInteractionId

      public Interaction.Builder previousInteractionId(@Nullable String previousInteractionId)
      The ID of the previous interaction, if any.
    • responseFormat

      public Interaction.Builder responseFormat(@Nullable InteractionResponseFormat responseFormat)
      Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
    • responseMimeType

      @Deprecated public Interaction.Builder responseMimeType(@Nullable String responseMimeType)
      Deprecated.
      field: This will be removed in a future release, please migrate away from it as soon as possible.
      The mime type of the response. This is required if response_format is set.
    • responseModalities

      @Deprecated public Interaction.Builder responseModalities(@Nullable List<ResponseModality> responseModalities)
      Deprecated.
      field: This will be removed in a future release, please migrate away from it as soon as possible.
      The requested modalities of the response (TEXT, IMAGE, AUDIO).
    • safetySettings

      public Interaction.Builder safetySettings(@Nullable List<SafetySetting> safetySettings)
      Safety settings for the interaction.
    • serviceTier

      public Interaction.Builder serviceTier(@Nullable ServiceTier serviceTier)
    • status

      public Interaction.Builder status(@Nonnull InteractionStatus status)
      Required. Output only. The status of the interaction.
    • steps

      public Interaction.Builder steps(@Nullable List<Step> steps)
      Required. Output only. The steps that make up the interaction, when included in the response.
    • systemInstruction

      public Interaction.Builder systemInstruction(@Nullable String systemInstruction)
      System instruction for the interaction.
    • tools

      public Interaction.Builder tools(@Nullable List<Tool> tools)
      A list of tool declarations the model may call during interaction.
    • updated

      public Interaction.Builder updated(@Nullable String updated)
      Required. Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
    • usage

      public Interaction.Builder usage(@Nullable Usage usage)
      Statistics on the interaction request's token usage.
    • webhookConfig

      public Interaction.Builder webhookConfig(@Nullable WebhookConfig webhookConfig)
      Message for configuring webhook events for a request.
    • build

      public Interaction build()