# Class ConfigMapper

java.lang.Object
com.google.adk.models.springai.ConfigMapper

public class ConfigMapper extends Object
Maps ADK GenerateContentConfig to Spring AI ChatOptions.

This mapper handles the translation between ADK's GenerateContentConfig and Spring AI's ChatOptions, enabling configuration parameters like temperature, max tokens, and stop sequences to be passed through to Spring AI models.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConfigMapper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.springframework.ai.chat.prompt.ChatOptions`
  `createDefaultChatOptions()`
  Creates default ChatOptions for cases where no ADK config is provided.
  `boolean`
  `isConfigurationValid(Optional<com.google.genai.types.GenerateContentConfig> config)`
  Validates that the configuration is compatible with Spring AI.
  `org.springframework.ai.chat.prompt.ChatOptions`
  `toSpringAiChatOptions(Optional<com.google.genai.types.GenerateContentConfig> config)`
  Converts ADK GenerateContentConfig to Spring AI ChatOptions.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ConfigMapper

    public ConfigMapper()

- ## Method Details

  - ### toSpringAiChatOptions

    public org.springframework.ai.chat.prompt.ChatOptions toSpringAiChatOptions(Optional<com.google.genai.types.GenerateContentConfig> config)
    Converts ADK GenerateContentConfig to Spring AI ChatOptions.
    Parameters:
      `config` - The ADK configuration to convert
    Returns:
      Spring AI ChatOptions or null if no config provided

  - ### createDefaultChatOptions

    public org.springframework.ai.chat.prompt.ChatOptions createDefaultChatOptions()
    Creates default ChatOptions for cases where no ADK config is provided.
    Returns:
      Basic ChatOptions with reasonable defaults

  - ### isConfigurationValid

    public boolean isConfigurationValid(Optional<com.google.genai.types.GenerateContentConfig> config)
    Validates that the configuration is compatible with Spring AI.
    Parameters:
      `config` - The ADK configuration to validate
    Returns:
      true if configuration is valid and supported