Class ReadonlyContext

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

public class ReadonlyContext extends Object
Provides read-only access to the context of an agent run.
  • Field Details

  • Constructor Details

  • Method Details

    • invocationId

      public String invocationId()
      Returns the ID of the current invocation.
    • agentName

      public String agentName()
      Returns the name of the agent currently running.
    • state

      public Map<String,Object> state()
      Returns a read-only view of the state of the current session.

      This is a shallow copy and if the underlying values of the map are modified, the read-only view will also be modified.