Class AgentInterrupt

java.lang.Object
com.google.genkit.ai.agent.AgentInterrupt

public final class AgentInterrupt extends Object
AgentInterrupt represents a tool request that paused agent execution awaiting a caller response.

Extracted from the final message's tool-request parts when a turn finishes with AgentFinishReason.INTERRUPTED. The caller resolves an interrupt by sending a ToolResume.getRespond() via AgentChat.resume(java.util.List).

  • Constructor Details

    • AgentInterrupt

      public AgentInterrupt(String name, Object input, Part part)
      Constructs an AgentInterrupt.
      Parameters:
      name - the tool name
      input - the tool input
      part - the originating tool-request part (preserved for resume correlation)
  • Method Details

    • name

      public String name()
      Returns the interrupted tool's name.
      Returns:
      the tool name, or null if unknown
    • input

      public Object input()
      Returns the interrupted tool's input.
      Returns:
      the tool input, or null
    • part

      public Part part()
      Returns the originating tool-request part.
      Returns:
      the part, or null