Class ConfigManager
java.lang.Object
uno.anahata.ai.config.ConfigManager
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 Summary
ConstructorsConstructorDescriptionConfigManager(Chat chat) Constructs a new ConfigManager for the given Chat instance. -
Method Summary
Modifier and TypeMethodDescriptiongetContextProviders(ContextPosition position, boolean enabled) Gets a list of context providers that match the specified position and enabled state.com.google.genai.types.GenerateContentConfigConstructs theGenerateContentConfigfor an API call.
-
Constructor Details
-
ConfigManager
Constructs a new ConfigManager for the given Chat instance.- Parameters:
chat- The Chat instance to manage configuration for.
-
-
Method Details
-
getContextProviders
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 theGenerateContentConfigfor 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.
-
