Class ConfigAgentUtils
java.lang.Object
com.google.adk.agents.ConfigAgentUtils
Utility class for loading agent configurations from YAML files.
TODO: Config agent features are not yet ready for public use.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when configuration is invalid. -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseAgentfromConfig(String configPath) Load agent from a YAML config file path.static com.google.common.collect.ImmutableList<BaseAgent> resolveSubAgents(List<BaseAgentConfig.AgentRefConfig> subAgentConfigs, String configAbsPath) Resolves subagent configurations into actual BaseAgent instances.
-
Method Details
-
fromConfig
public static BaseAgent fromConfig(String configPath) throws ConfigAgentUtils.ConfigurationException Load agent from a YAML config file path.- Parameters:
configPath- the path to a YAML config file- Returns:
- the created agent instance as a
BaseAgent - Throws:
ConfigAgentUtils.ConfigurationException- if loading fails
-
resolveSubAgents
public static com.google.common.collect.ImmutableList<BaseAgent> resolveSubAgents(List<BaseAgentConfig.AgentRefConfig> subAgentConfigs, String configAbsPath) throws ConfigAgentUtils.ConfigurationException Resolves subagent configurations into actual BaseAgent instances. This method is used by concrete agent implementations to resolve their subagents.- Parameters:
subAgentConfigs- The list of subagent configurationsconfigAbsPath- The absolute path to the parent config file for resolving relative paths- Returns:
- A list of resolved BaseAgent instances
- Throws:
ConfigAgentUtils.ConfigurationException- if any subagent fails to resolve
-