接口 Agent

所有超级接口:
CallableAgent, ObservableAgent, StreamableAgent
所有已知实现类:
AgentBase, ReActAgent, StructuredOutputCapableAgent, UserAgent

public interface Agent extends CallableAgent, StreamableAgent, ObservableAgent
Complete agent interface combining all capabilities.

This interface defines the core contract for agents, combining:

Design Philosophy:

  • Memory management is NOT part of the core Agent interface - it's the responsibility of specific agent implementations (e.g., ReActAgent)
  • Structured output is a specialized capability provided by specific agents
  • Observe pattern allows agents to receive messages without generating a reply, enabling multi-agent collaboration

All agents in the AgentScope framework should implement this interface.

  • 方法详细资料

    • getAgentId

      String getAgentId()
      Get the unique identifier for this agent.
      返回:
      Agent ID
    • getName

      String getName()
      Get the name of this agent.
      返回:
      Agent name
    • getDescription

      default String getDescription()
      Get the description of this agent.
      返回:
      Agent description
    • interrupt

      void interrupt()
      Interrupt the current agent execution. This method sets an interrupt flag that will be checked by the agent at appropriate checkpoints during execution. The interruption is cooperative and may not take effect immediately.
    • interrupt

      void interrupt(Msg msg)
      Interrupt the current agent execution with a user message. This method sets an interrupt flag and associates a user message with the interruption. The interruption is cooperative and may not take effect immediately.
      参数:
      msg - User message associated with the interruption