Class AgentStaticLoader
java.lang.Object
com.google.adk.web.AgentStaticLoader
- All Implemented Interfaces:
AgentLoader
Static Agent Loader for programmatically provided agents.
This loader takes a static list of pre-created agent instances and makes them available through the AgentLoader interface. Perfect for cases where you already have agent instances and just need a convenient way to wrap them in an AgentLoader.
This class is not a Spring component by itself - instances are created programmatically and then registered as beans via factory methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<String> Returns a list of available agent names.Loads the BaseAgent instance for the specified agent name.
-
Constructor Details
-
AgentStaticLoader
-
-
Method Details
-
listAgents
Description copied from interface:AgentLoaderReturns a list of available agent names.- Specified by:
listAgentsin interfaceAgentLoader- Returns:
- ImmutableList of agent names. Must not return null - return an empty list if no agents are available.
-
loadAgent
Description copied from interface:AgentLoaderLoads the BaseAgent instance for the specified agent name.- Specified by:
loadAgentin interfaceAgentLoader- Parameters:
name- the name of the agent to load- Returns:
- BaseAgent instance for the given name
-