Class GoogleGenAiClientConfiguration

java.lang.Object
io.micronaut.langchain4j.googlegenai.GoogleGenAiClientConfiguration

@ConfigurationProperties("langchain4j.google-gen-ai") public final class GoogleGenAiClientConfiguration extends Object
Configures the Google Gen AI Client shared by the Google Gen AI models: the Gemini API with an API key, or Vertex AI with a project, a location and the application's GoogleCredentials.
Since:
2.4.0
  • Field Details

  • Constructor Details

    • GoogleGenAiClientConfiguration

      public GoogleGenAiClientConfiguration()
  • Method Details

    • getApiKey

      public @Nullable String getApiKey()
      Returns:
      The API key of the Gemini API
    • setApiKey

      public void setApiKey(@Nullable String apiKey)
      Parameters:
      apiKey - The API key of the Gemini API
    • isVertexAi

      public boolean isVertexAi()
      Returns:
      Whether Vertex AI is used instead of the Gemini API
    • setVertexAi

      public void setVertexAi(boolean vertexAi)
      Parameters:
      vertexAi - Whether Vertex AI is used instead of the Gemini API. Defaults to false.
    • getProjectId

      public @Nullable String getProjectId()
      Returns:
      The Google Cloud project of Vertex AI
    • setProjectId

      public void setProjectId(@Nullable String projectId)
      Parameters:
      projectId - The Google Cloud project of Vertex AI
    • getLocation

      public @Nullable String getLocation()
      Returns:
      The location of Vertex AI
    • setLocation

      public void setLocation(@Nullable String location)
      Parameters:
      location - The location of Vertex AI, for example us-central1 or global
    • getBaseUrl

      public @Nullable String getBaseUrl()
      Returns:
      The base URL of the API
    • setBaseUrl

      public void setBaseUrl(@Nullable String baseUrl)
      Parameters:
      baseUrl - The base URL of the API, for example a proxy. Defaults to the URL of the Gemini API or Vertex AI.
    • getApiVersion

      public @Nullable String getApiVersion()
      Returns:
      The version of the API
    • setApiVersion

      public void setApiVersion(@Nullable String apiVersion)
      Parameters:
      apiVersion - The version of the API, for example v1. Defaults to the SDK's version.
    • getTimeout

      public @Nullable Duration getTimeout()
      Returns:
      The timeout of the requests
    • setTimeout

      public void setTimeout(@Nullable Duration timeout)
      Parameters:
      timeout - The timeout of the requests
    • getMaxConnections

      public @Nullable Integer getMaxConnections()
      Returns:
      The maximum number of connections of the HTTP client
    • setMaxConnections

      public void setMaxConnections(@Nullable Integer maxConnections)
      Parameters:
      maxConnections - The maximum number of concurrent connections of the HTTP client
    • getMaxConnectionsPerHost

      public @Nullable Integer getMaxConnectionsPerHost()
      Returns:
      The maximum number of connections of the HTTP client per host
    • setMaxConnectionsPerHost

      public void setMaxConnectionsPerHost(@Nullable Integer maxConnectionsPerHost)
      Parameters:
      maxConnectionsPerHost - The maximum number of concurrent connections of the HTTP client per host