Class GoogleGenAIPluginOptions

java.lang.Object
com.google.genkit.plugins.googlegenai.GoogleGenAIPluginOptions

public class GoogleGenAIPluginOptions extends Object
Options for configuring the Google GenAI plugin.

The plugin can be configured to use either:

  • Gemini Developer API (default): Set the API key
  • Vertex AI API: Set project, location, and enable vertexAI
  • Method Details

    • builder

      public static GoogleGenAIPluginOptions.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
    • getApiKey

      public String getApiKey()
      Gets the API key.
      Returns:
      the API key
    • getProject

      public String getProject()
      Gets the Google Cloud project ID (for Vertex AI).
      Returns:
      the project ID
    • getLocation

      public String getLocation()
      Gets the Google Cloud location (for Vertex AI).
      Returns:
      the location
    • isVertexAI

      public boolean isVertexAI()
      Returns whether to use Vertex AI backend.
      Returns:
      true if using Vertex AI, false for Gemini Developer API
    • getApiVersion

      public String getApiVersion()
      Gets the API version.
      Returns:
      the API version
    • getBaseUrl

      public String getBaseUrl()
      Gets the base URL override.
      Returns:
      the base URL
    • getTimeout

      public int getTimeout()
      Gets the request timeout in milliseconds.
      Returns:
      the timeout in milliseconds
    • toHttpOptions

      public com.google.genai.types.HttpOptions toHttpOptions()
      Converts these options to HttpOptions for the Google GenAI SDK.
      Returns:
      HttpOptions