接口 Agent
- 所有超级接口:
CallableAgent,ObservableAgent,StreamableAgent
- 所有已知实现类:
AgentBase,ReActAgent,StructuredOutputCapableAgent,UserAgent
Complete agent interface combining all capabilities.
This interface defines the core contract for agents, combining:
CallableAgent- Process messages and generate responsesStreamableAgent- Stream events during executionObservableAgent- Observe messages without responding
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
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
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
-