Class CustomDemoRegistry
java.lang.Object
com.google.adk.utils.ComponentRegistry
com.example.CustomDemoRegistry
Custom ComponentRegistry for the user-defined config agent demo.
This registry is used to add custom tools and agents to the ADK Web Server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CustomDemoRegistrySingleton instance for easy access -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ComponentRegistry
get, get, getInstance, getToolNamesWithPrefix, register, resolveAfterAgentCallback, resolveAfterModelCallback, resolveAfterToolCallback, resolveAgentClass, resolveAgentInstance, resolveBeforeAgentCallback, resolveBeforeModelCallback, resolveBeforeToolCallback, resolveToolClass, resolveToolInstance, resolveToolsetClass, resolveToolsetInstance, setInstanceModifier and TypeMethodDescriptionRetrieves an object by name without type checking.<T> Optional<T> Retrieves an object by name and attempts to cast it to the specified type.static ComponentRegistryReturns the global singleton instance of ComponentRegistry.getToolNamesWithPrefix(String prefix) voidRegisters an object with the given name.static Optional<Callbacks.AfterAgentCallback> static Optional<Callbacks.AfterModelCallback> static Optional<Callbacks.AfterToolCallback> resolveAgentClass(String agentClassName) Resolves the agent class based on the agent class name from the configuration.resolveAgentInstance(String name) Resolves an agent instance from the registry.static Optional<Callbacks.BeforeToolCallback> resolveToolClass(String toolClassName) Resolves the tool class based on the tool class name from the configuration.resolveToolInstance(String name) static Optional<Class<? extends BaseToolset>> resolveToolsetClass(String toolsetClassName) Resolves a toolset class by name from the registry or by attempting to load it.static Optional<BaseToolset> resolveToolsetInstance(String name) Resolves a toolset instance by name from the registry.static voidsetInstance(ComponentRegistry newInstance) Updates the global singleton instance with a new ComponentRegistry.
-
Field Details
-
INSTANCE
Singleton instance for easy access
-
-
Constructor Details
-
CustomDemoRegistry
public CustomDemoRegistry()Private constructor to initialize custom components
-