AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:188–484

构建器,用于构建并配置目标实例。位于 io.agentscope.core.a2a.server 包。核心成员包括 agentCard、withTransport、taskStore、queueManager、pushConfigStore、pushSender。

A class in io.agentscope.core.a2a.server that supports discovery, delegation and collaboration between agents. Declared in io.agentscope.core.a2a.server.

方法摘要Method Summary

方法Method说明Description
public Builder agentCard(ConfigurableAgentCard agentCard)
设置智能体卡片。
Set developer configured agent card.
public Builder withTransport(TransportProperties transportProperties)
设置使用传输层。
Add supported transport for this A2A server, and input this transport's properties.
public Builder taskStore(TaskStore taskStore)
设置任务存储。
Set implementations of `TaskStore`.
public Builder queueManager(QueueManager queueManager)
设置队列管理器。
Set implementations of `QueueManager`.
public Builder pushConfigStore(PushNotificationConfigStore pushConfigStore)
设置推送配置存储。
Set implementations of `PushNotificationConfigStore`.
public Builder pushSender(PushNotificationSender pushSender)
设置该配置项。
Set implementations of `PushNotificationSender`.
public Builder executor(Executor executor)
设置执行器。
Set executor for handle a2a request.
public Builder deploymentProperties(Integer port)
设置部署属性。
Set deployment port to generate default transport interface information in agentCard.
public Builder deploymentProperties(DeploymentProperties deploymentProperties)
设置部署属性。
Set deployment properties to generate default transport interface information in agentCard.
public Builder withAgentRegistry(AgentRegistry agentRegistry)
设置使用智能体注册表。
Add `AgentRegistry` implementation which should register this agent to registry.
public Builder agentExecuteProperties(AgentExecuteProperties agentExecuteProperties)
设置智能体执行属性。
Set agent execute properties.
public AgentScopeA2aServer build()
构建新的实例的`AgentScopeA2aServer`。
Build a new instance of `AgentScopeA2aServer`.

方法详情Method Detail

agentCard

public Builder agentCard(ConfigurableAgentCard agentCard)

设置智能体卡片。

Set developer configured agent card.

参数Parameters
名称Name类型Type说明Description
agentCardConfigurableAgentCard智能体卡片(类型 `ConfigurableAgentCard`)。configured agent card
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:224–227

withTransport

public Builder withTransport(TransportProperties transportProperties)

设置使用传输层。

Add supported transport for this A2A server, and input this transport's properties.

参数Parameters
名称Name类型Type说明Description
transportPropertiesTransportProperties传输层属性(类型 `TransportProperties`)。properties of supported transport
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:235–238

taskStore

public Builder taskStore(TaskStore taskStore)

设置任务存储。

Set implementations of TaskStore.

参数Parameters
名称Name类型Type说明Description
taskStoreTaskStore任务存储(类型 `TaskStore`)。task store
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:248–251

queueManager

public Builder queueManager(QueueManager queueManager)

设置队列管理器。

Set implementations of QueueManager.

参数Parameters
名称Name类型Type说明Description
queueManagerQueueManager队列管理器(类型 `QueueManager`)。queue manager
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:261–264

pushConfigStore

public Builder pushConfigStore(PushNotificationConfigStore pushConfigStore)

设置推送配置存储。

Set implementations of PushNotificationConfigStore.

参数Parameters
名称Name类型Type说明Description
pushConfigStorePushNotificationConfigStore推送配置存储(类型 `PushNotificationConfigStore`)。push notification config store
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:274–277

pushSender

public Builder pushSender(PushNotificationSender pushSender)

设置该配置项。

Set implementations of PushNotificationSender.

参数Parameters
名称Name类型Type说明Description
pushSenderPushNotificationSender推送 Sender(类型 `PushNotificationSender`)。push notification sender
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:287–290

executor

public Builder executor(Executor executor)

设置执行器。

Set executor for handle a2a request.

参数Parameters
名称Name类型Type说明Description
executorExecutor执行器(类型 `Executor`)。executor
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:300–303

deploymentProperties

public Builder deploymentProperties(Integer port)

设置部署属性。

Set deployment port to generate default transport interface information in agentCard.

参数Parameters
名称Name类型Type说明Description
portIntegerport(类型 `Integer`)。deployment port
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:311–314

deploymentProperties

public Builder deploymentProperties(DeploymentProperties deploymentProperties)

设置部署属性。

Set deployment properties to generate default transport interface information in agentCard.

参数Parameters
名称Name类型Type说明Description
deploymentPropertiesDeploymentProperties部署属性(类型 `DeploymentProperties`)。deployment properties
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:322–325

withAgentRegistry

public Builder withAgentRegistry(AgentRegistry agentRegistry)

设置使用智能体注册表。

Add AgentRegistry implementation which should register this agent to registry.

参数Parameters
名称Name类型Type说明Description
agentRegistryAgentRegistry智能体注册表(类型 `AgentRegistry`)。agent registry implementation
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:333–336

agentExecuteProperties

public Builder agentExecuteProperties(AgentExecuteProperties agentExecuteProperties)

设置智能体执行属性。

Set agent execute properties.

参数Parameters
名称Name类型Type说明Description
agentExecutePropertiesAgentExecuteProperties智能体执行属性(类型 `AgentExecuteProperties`)。agent execute properties
返回Returns Builder
`AgentScopeA2aServer`的构建器实例。builder instance of `AgentScopeA2aServer`
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:344–347

build

public AgentScopeA2aServer build()

构建新的实例的AgentScopeA2aServer。

Build a new instance of AgentScopeA2aServer.

返回Returns AgentScopeA2aServer
一种新的实例的`AgentScopeA2aServer`。a new instance of `AgentScopeA2aServer`
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if `AgentRunner` is missing or no available transport found.
源码Source io/agentscope/core/a2a/server/AgentScopeA2aServer.java:363–418
基于官方固定版本源码静态生成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.