AS AgentScopeAPI 手册 / API Reference

AgentScopeAgentExecutor

public class AgentScopeAgentExecutor implements AgentExecutor
源码Source io/agentscope/core/a2a/server/executor/AgentScopeAgentExecutor.java:71–535

AgentScope 智能体执行器,支持智能体之间的发现、委派与协作。位于 io.agentscope.core.a2a.server.executor 包,实现 AgentExecutor。核心成员包括 cancel、execute、AgentScopeAgentExecutor。

Implementation of A2A AgentExecutor for AgentScope.

For Current Implementation, will create a new io.agentscope.core.agent.Agent for each request.

构造器摘要Constructor Summary

构造器Constructor说明Description
public AgentScopeAgentExecutor(AgentRunner agentRunner, AgentExecuteProperties agentExecuteProperties)
初始化 `AgentScopeAgentExecutor` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError
执行取消相关操作。
Performs the cancel operation.
public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError
执行执行相关操作。
Performs the execute operation.

构造器详情Constructor Detail

AgentScopeAgentExecutor

public AgentScopeAgentExecutor(AgentRunner agentRunner, AgentExecuteProperties agentExecuteProperties)

初始化 AgentScopeAgentExecutor 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
agentRunnerAgentRunner智能体运行器(类型 `AgentRunner`)。The agent runner.
agentExecutePropertiesAgentExecuteProperties智能体执行属性(类型 `AgentExecuteProperties`)。The agent execute properties.
源码Source io/agentscope/core/a2a/server/executor/AgentScopeAgentExecutor.java:81–86

方法详情Method Detail

cancel

public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError

执行取消相关操作。

Performs the cancel operation.

参数Parameters
名称Name类型Type说明Description
contextRequestContext上下文(类型 `RequestContext`)。The context.
eventQueueEventQueue事件队列(类型 `EventQueue`)。The event queue.
抛出Throws
  • JSONRPCError 可能抛出 `JSONRPCError`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/a2a/server/executor/AgentScopeAgentExecutor.java:88–104

execute

public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError

执行执行相关操作。

Performs the execute operation.

参数Parameters
名称Name类型Type说明Description
contextRequestContext上下文(类型 `RequestContext`)。The context.
eventQueueEventQueue事件队列(类型 `EventQueue`)。The event queue.
抛出Throws
  • JSONRPCError 可能抛出 `JSONRPCError`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/a2a/server/executor/AgentScopeAgentExecutor.java:106–135
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.