# Uses of Class
com.google.adk.agents.CallbackContext

Packages that use CallbackContext
Package
Description
com.google.adk.agents
com.google.adk.plugins
com.google.adk.plugins.agentanalytics
com.google.adk.tools

- ## Uses of CallbackContext in com.google.adk.agents

  Methods in com.google.adk.agents with parameters of type CallbackContext
  Modifier and Type
  Method
  Description
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  Callbacks.AfterAgentCallback.`call(CallbackContext callbackContext)`
  Async callback after agent runs.
  `Optional<com.google.genai.types.Content>`
  Callbacks.AfterAgentCallbackSync.`call(CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Callbacks.AfterModelCallback.`call(CallbackContext callbackContext, LlmResponse llmResponse)`
  Async callback after LLM response.
  `Optional<LlmResponse>`
  Callbacks.AfterModelCallbackSync.`call(CallbackContext callbackContext, LlmResponse llmResponse)`
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  Callbacks.BeforeAgentCallback.`call(CallbackContext callbackContext)`
  Async callback before agent runs.
  `Optional<com.google.genai.types.Content>`
  Callbacks.BeforeAgentCallbackSync.`call(CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Callbacks.BeforeModelCallback.`call(CallbackContext callbackContext, LlmRequest.Builder llmRequestBuilder)`
  Async callback before LLM invocation.
  `Optional<LlmResponse>`
  Callbacks.BeforeModelCallbackSync.`call(CallbackContext callbackContext, LlmRequest.Builder llmRequestBuilder)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Callbacks.OnModelErrorCallback.`call(CallbackContext callbackContext, LlmRequest llmRequest, Exception error)`
  Async callback when model call fails.
  `Optional<LlmResponse>`
  Callbacks.OnModelErrorCallbackSync.`call(CallbackContext callbackContext, LlmRequest llmRequest, Exception error)`

- ## Uses of CallbackContext in com.google.adk.plugins

  Methods in com.google.adk.plugins with parameters of type CallbackContext
  Modifier and Type
  Method
  Description
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  LoggingPlugin.`afterAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  Plugin.`afterAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  Callback executed after an agent's primary logic has completed.
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  PluginManager.`afterAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  LoggingPlugin.`afterModelCallback(CallbackContext callbackContext, LlmResponse llmResponse)`
  `default io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Plugin.`afterModelCallback(CallbackContext callbackContext, LlmResponse llmResponse)`
  Callback executed after a response is received from the model.
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  PluginManager.`afterModelCallback(CallbackContext callbackContext, LlmResponse llmResponse)`
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  LoggingPlugin.`beforeAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  Plugin.`beforeAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  Callback executed before an agent's primary logic is invoked.
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  PluginManager.`beforeAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  ContextFilterPlugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  Filters the LLM request context by trimming recent turns and applying any custom filter.
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  GlobalInstructionPlugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  LoggingPlugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  `default io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Plugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  Callback executed before a request is sent to the model.
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  PluginManager.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  ReplayPlugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  LoggingPlugin.`onModelErrorCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest, Throwable error)`
  `default io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  Plugin.`onModelErrorCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest, Throwable error)`
  Callback executed when a model call encounters an error.
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  PluginManager.`onModelErrorCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest, Throwable error)`
  Constructor parameters in com.google.adk.plugins with type arguments of type CallbackContext
  Modifier
  Constructor
  Description
  ``
  `GlobalInstructionPlugin(Function<CallbackContext, io.reactivex.rxjava3.core.Maybe<String>> instructionProvider)`
  ``
  `GlobalInstructionPlugin(Function<CallbackContext, io.reactivex.rxjava3.core.Maybe<String>> instructionProvider, String name)`

- ## Uses of CallbackContext in com.google.adk.plugins.agentanalytics

  Methods in com.google.adk.plugins.agentanalytics with parameters of type CallbackContext
  Modifier and Type
  Method
  Description
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  BigQueryAgentAnalyticsPlugin.`afterAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  BigQueryAgentAnalyticsPlugin.`afterModelCallback(CallbackContext callbackContext, LlmResponse llmResponse)`
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Content>`
  BigQueryAgentAnalyticsPlugin.`beforeAgentCallback(BaseAgent agent, CallbackContext callbackContext)`
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  BigQueryAgentAnalyticsPlugin.`beforeModelCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest)`
  Callback before LLM call.
  `io.reactivex.rxjava3.core.Maybe<LlmResponse>`
  BigQueryAgentAnalyticsPlugin.`onModelErrorCallback(CallbackContext callbackContext, LlmRequest.Builder llmRequest, Throwable error)`

- ## Uses of CallbackContext in com.google.adk.tools

  Subclasses of CallbackContext in com.google.adk.tools
  Modifier and Type
  Class
  Description
  `class`
  `ToolContext`
  ToolContext object provides a structured context for executing tools or functions.