Class BasePlugin
java.lang.Object
com.google.adk.plugins.BasePlugin
- All Implemented Interfaces:
Plugin
- Direct Known Subclasses:
ContextFilterPlugin, GlobalInstructionPlugin, LoggingPlugin, PluginManager, ReplayPlugin
Base class for creating plugins.
Plugins provide a structured way to intercept and modify agent, tool, and LLM behaviors at critical execution points in a callback manner. While agent callbacks apply to a particular agent, plugins applies globally to all agents added in the runner. Plugins are best used for adding custom behaviors like logging, monitoring, caching, or modifying requests and responses at key stages.
A plugin can implement one or more methods of callbacks, but should not implement the same method of callback for multiple times.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Plugin
afterAgentCallback, afterModelCallback, afterRunCallback, afterToolCallback, beforeAgentCallback, beforeModelCallback, beforeRunCallback, beforeToolCallback, close, onEventCallback, onModelErrorCallback, onToolErrorCallback, onUserMessageCallback
-
Field Details
-
name
-
-
Constructor Details
-
BasePlugin
Constructs a new plugin with the given name.- Parameters:
name- The name of the plugin.
-
-
Method Details
-
getName
-