Class ReplayPlugin

java.lang.Object
com.google.adk.plugins.BasePlugin
com.google.adk.plugins.ReplayPlugin
All Implemented Interfaces:
Plugin

public class ReplayPlugin extends BasePlugin
Plugin for replaying ADK agent interactions from recordings.
  • Constructor Details

    • ReplayPlugin

      public ReplayPlugin()
    • ReplayPlugin

      public ReplayPlugin(String name)
  • Method Details

    • beforeRunCallback

      public io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content> beforeRunCallback(InvocationContext invocationContext)
      Description copied from interface: Plugin
      Callback executed before the ADK runner runs.
      Parameters:
      invocationContext - The context for the entire invocation.
      Returns:
      An optional Content to halt execution. Returning Empty to proceed normally.
    • beforeModelCallback

      public io.reactivex.rxjava3.core.Maybe<LlmResponse> beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)
      Description copied from interface: Plugin
      Callback executed before a request is sent to the model.
      Parameters:
      callbackContext - The context for the current agent call.
      llmRequest - The mutable request builder, allowing modification of the request before it is sent to the model.
      Returns:
      An optional LlmResponse to trigger an early exit. Returning Empty to proceed normally.
    • beforeToolCallback

      public io.reactivex.rxjava3.core.Maybe<Map<String,Object>> beforeToolCallback(BaseTool tool, Map<String,Object> toolArgs, ToolContext toolContext)
      Description copied from interface: Plugin
      Callback executed before a tool is called.
      Parameters:
      tool - The tool instance that is about to be executed.
      toolArgs - The dictionary of arguments to be used for invoking the tool.
      toolContext - The context specific to the tool execution.
      Returns:
      An optional Map to stop the tool execution and return this response immediately. Returning Empty to proceed normally.
    • afterRunCallback

      public io.reactivex.rxjava3.core.Completable afterRunCallback(InvocationContext invocationContext)
      Description copied from interface: Plugin
      Callback executed after an ADK runner run has completed.
      Parameters:
      invocationContext - The context for the entire invocation.