Class ConfigManager

java.lang.Object
uno.anahata.ai.config.ConfigManager

public class ConfigManager extends Object
Manages configuration-related tasks for a Chat session.

This class is responsible for aggregating system instructions from various ContextProviders and constructing the final GenerateContentConfig used for Gemini API calls.

  • Constructor Details

    • ConfigManager

      public ConfigManager(Chat chat)
      Constructs a new ConfigManager for the given Chat instance.
      Parameters:
      chat - The Chat instance to manage configuration for.
  • Method Details

    • getContextProviders

      public List<ContextProvider> getContextProviders(ContextPosition position, boolean enabled)
      Gets a list of context providers that match the specified position and enabled state.
      Parameters:
      position - The desired context position (e.g., SYSTEM_INSTRUCTIONS).
      enabled - Whether to filter for enabled or disabled providers.
      Returns:
      A list of matching context providers.
    • makeGenerateContentConfig

      public com.google.genai.types.GenerateContentConfig makeGenerateContentConfig()
      Constructs the GenerateContentConfig for an API call.

      This method assembles the system instructions, configures thinking mode, and sets up tools (local functions or Google Search) based on the current chat state.

      Returns:
      The fully configured GenerateContentConfig object.