Class ApigeeLlm.Builder

java.lang.Object
com.google.adk.models.ApigeeLlm.Builder
Enclosing class:
ApigeeLlm

public static class ApigeeLlm.Builder extends Object
Builder for ApigeeLlm.
  • Constructor Details

    • Builder

      protected Builder()
  • Method Details

    • modelName

      @CanIgnoreReturnValue public ApigeeLlm.Builder modelName(String modelName)
      Sets the model string. The model string specifies the LLM provider (e.g., Vertex AI, Gemini), API version, and the model ID.

      Format: apigee/[<provider>/][<version>/]<model_id>

      Components:

      • provider (optional): vertex_ai or gemini. If omitted, behavior depends on the GOOGLE_GENAI_USE_VERTEXAI environment variable. If that is not set to TRUE or 1, it defaults to gemini.
      • version (optional): The API version (e.g., v1, v1beta). If omitted, the default version for the provider is used.
      • model_id (required): The model identifier (e.g., gemini-2.5-flash).

      Examples:

      • apigee/gemini-2.5-flash
      • apigee/v1/gemini-2.5-flash
      • apigee/vertex_ai/gemini-2.5-flash
      • apigee/gemini/v1/gemini-2.5-flash
      • apigee/vertex_ai/v1beta/gemini-2.5-flash
      Parameters:
      modelName - the model string.
      Returns:
      this builder.
    • proxyUrl

      @CanIgnoreReturnValue public ApigeeLlm.Builder proxyUrl(String proxyUrl)
      Sets the URL of the Apigee proxy. If not set, it will be read from the APIGEE_PROXY_URL environment variable.
      Parameters:
      proxyUrl - the Apigee proxy URL.
      Returns:
      this builder.
    • customHeaders

      @CanIgnoreReturnValue public ApigeeLlm.Builder customHeaders(Map<String,String> customHeaders)
      Sets a dictionary of headers to be sent with the request.
      Parameters:
      customHeaders - the custom headers.
      Returns:
      this builder.
    • build

      public ApigeeLlm build()
      Builds the ApigeeLlm instance.
      Returns:
      a new ApigeeLlm instance.
      Throws:
      NullPointerException - if modelName is null.
      IllegalArgumentException - if the model string is invalid.