GoogleKoogProperties

constructor(enabled: Boolean, apiKey: String, baseUrl: String, retry: RetryConfigKoogProperties? = null)(source)

Parameters

enabled

Indicates whether the Google LLM integration is enabled.

apiKey

The API key used for authenticating requests to Google's services.

baseUrl

The base URL of the Google LLM API.

retry

Optional configuration for retrying failed API calls.

Usage: These properties are automatically bound to the Spring environment when specified in application configuration (e.g., application.yml or application.properties).

Example configuration snippet in application.yml or application.properties:

ai.koog.google.enabled=true
ai.koog.google.api-key=your-google-api-key
ai.koog.google.base-url=https://api.google.com/llm
ai.koog.google.retry.enabled=true
ai.koog.google.retry.max-attempts=3
ai.koog.google.retry.initial-delay=2s
ai.koog.google.retry.max-delay=10s
ai.koog.google.retry.backoff-multiplier=2.0
ai.koog.google.retry.jitter-factor=0.5

Advanced Features:

  • The retry configuration supports customizable retries for handling transient failures.

  • Dedicated masking utility ensures that sensitive information, such as the API key, is not exposed when serialized or logged.

This class is primarily used in conjunction with the GoogleLLMAutoConfiguration auto-configuration class to initialize and configure the necessary beans for interacting with Google's LLM API.

For more details on retry behavior, refer to the RetryConfigKoogProperties class. For shared configuration attributes, see the KoogLlmClientProperties interface.