Class CreateModelInteraction

java.lang.Object
com.google.genai.gaos.models.interactions.CreateModelInteraction

public class CreateModelInteraction extends Object
CreateModelInteraction

Interaction for generating the completion using models.

  • Constructor Details

  • Method Details

    • background

      public Optional<Boolean> background()
      Input only. Whether to run the model interaction in the background.
    • cachedContent

      @Deprecated public Optional<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 Optional<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.
    • environment

      The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
    • generationConfig

      public Optional<GenerationConfig> generationConfig()
      Configuration parameters for model interactions.
    • input

      public Optional<InteractionsInput> input()
      The input for the interaction.
    • labels

      public Optional<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 Optional<Model> model()
      The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
    • previousInteractionId

      public Optional<String> previousInteractionId()
      The ID of the previous interaction, if any.
    • responseFormat

      Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
    • responseMimeType

      @Deprecated public Optional<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 Optional<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 Optional<List<SafetySetting>> safetySettings()
      Safety settings for the interaction.
    • serviceTier

      public Optional<ServiceTier> serviceTier()
    • store

      public Optional<Boolean> store()
      Input only. Whether to store the response and request for later retrieval.
    • stream

      public Optional<Boolean> stream()
      Input only. Whether the interaction will be streamed.
    • systemInstruction

      public Optional<String> systemInstruction()
      System instruction for the interaction.
    • tools

      public Optional<List<Tool>> tools()
      A list of tool declarations the model may call during interaction.
    • webhookConfig

      public Optional<WebhookConfig> webhookConfig()
      Message for configuring webhook events for a request.
    • builder

      public static CreateModelInteraction.Builder builder()
    • withBackground

      public CreateModelInteraction withBackground(@Nullable Boolean background)
      Input only. Whether to run the model interaction in the background.
    • withCachedContent

      @Deprecated public CreateModelInteraction withCachedContent(@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}

    • withContinuationToken

      public CreateModelInteraction withContinuationToken(@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.
    • withEnvironment

      public CreateModelInteraction withEnvironment(@Nullable CreateModelInteractionEnvironment environment)
      The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
    • withGenerationConfig

      public CreateModelInteraction withGenerationConfig(@Nullable GenerationConfig generationConfig)
      Configuration parameters for model interactions.
    • withInput

      public CreateModelInteraction withInput(@Nullable InteractionsInput input)
      The input for the interaction.
    • withLabels

      public CreateModelInteraction withLabels(@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.

    • withModel

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

      public CreateModelInteraction withPreviousInteractionId(@Nullable String previousInteractionId)
      The ID of the previous interaction, if any.
    • withResponseFormat

      public CreateModelInteraction withResponseFormat(@Nullable CreateModelInteractionResponseFormat responseFormat)
      Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
    • withResponseMimeType

      @Deprecated public CreateModelInteraction withResponseMimeType(@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.
    • withResponseModalities

      @Deprecated public CreateModelInteraction withResponseModalities(@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).
    • withSafetySettings

      public CreateModelInteraction withSafetySettings(@Nullable List<SafetySetting> safetySettings)
      Safety settings for the interaction.
    • withServiceTier

      public CreateModelInteraction withServiceTier(@Nullable ServiceTier serviceTier)
    • withStore

      public CreateModelInteraction withStore(@Nullable Boolean store)
      Input only. Whether to store the response and request for later retrieval.
    • withStream

      public CreateModelInteraction withStream(@Nullable Boolean stream)
      Input only. Whether the interaction will be streamed.
    • withSystemInstruction

      public CreateModelInteraction withSystemInstruction(@Nullable String systemInstruction)
      System instruction for the interaction.
    • withTools

      public CreateModelInteraction withTools(@Nullable List<Tool> tools)
      A list of tool declarations the model may call during interaction.
    • withWebhookConfig

      public CreateModelInteraction withWebhookConfig(@Nullable WebhookConfig webhookConfig)
      Message for configuring webhook events for a request.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object