Class CallbackContext

java.lang.Object
com.google.adk.agents.ReadonlyContext
com.google.adk.agents.CallbackContext
Direct Known Subclasses:
ToolContext

public class CallbackContext extends ReadonlyContext
The context of various callbacks for an agent invocation.
  • Field Details

  • Constructor Details

  • Method Details

    • state

      public State state()
      Returns the delta-aware state of the current callback.
      Overrides:
      state in class ReadonlyContext
    • userContent

      public Optional<com.google.genai.types.Content> userContent()
      Returns the user content that initiated this invocation.
    • eventActions

      public EventActions eventActions()
      Returns the EventActions associated with this context.
    • loadArtifact

      public io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(String filename, Optional<Integer> version)
      Loads an artifact from the artifact service associated with the current session.
    • saveArtifact

      public void saveArtifact(String filename, com.google.genai.types.Part artifact)
      Saves an artifact and records it as a delta for the current session.