Package io.agentscope.core.a2a.server
Class AgentScopeA2aServer.Builder
java.lang.Object
io.agentscope.core.a2a.server.AgentScopeA2aServer.Builder
- Enclosing class:
- AgentScopeA2aServer
-
Method Summary
Modifier and TypeMethodDescriptionagentCard(ConfigurableAgentCard agentCard) Set developer configured agent card.agentExecuteProperties(AgentExecuteProperties agentExecuteProperties) Set agent execute properties.build()Build a new instance ofAgentScopeA2aServer.deploymentProperties(DeploymentProperties deploymentProperties) Set deployment properties to generate default transport interface information in agentCard.deploymentProperties(Integer port) Set deployment port to generate default transport interface information in agentCard.Set executor for handle a2a request.pushConfigStore(io.a2a.server.tasks.PushNotificationConfigStore pushConfigStore) Set implementations ofPushNotificationConfigStore.pushSender(io.a2a.server.tasks.PushNotificationSender pushSender) Set implementations ofPushNotificationSender.queueManager(io.a2a.server.events.QueueManager queueManager) Set implementations ofQueueManager.taskStore(io.a2a.server.tasks.TaskStore taskStore) Set implementations ofTaskStore.withAgentRegistry(AgentRegistry agentRegistry) AddAgentRegistryimplementation which should register this agent to registry.withTransport(TransportProperties transportProperties) Add supported transport for this A2A server, and input this transport's properties.
-
Method Details
-
agentCard
Set developer configured agent card.- Parameters:
agentCard- configured agent card- Returns:
- builder instance of
AgentScopeA2aServer
-
withTransport
Add supported transport for this A2A server, and input this transport's properties.- Parameters:
transportProperties- properties of supported transport- Returns:
- builder instance of
AgentScopeA2aServer
-
taskStore
Set implementations ofTaskStore.use
InMemoryTaskStoreby default.- Parameters:
taskStore- task store- Returns:
- builder instance of
AgentScopeA2aServer
-
queueManager
Set implementations ofQueueManager.use
InMemoryQueueManagerby default.- Parameters:
queueManager- queue manager- Returns:
- builder instance of
AgentScopeA2aServer
-
pushConfigStore
public AgentScopeA2aServer.Builder pushConfigStore(io.a2a.server.tasks.PushNotificationConfigStore pushConfigStore) Set implementations ofPushNotificationConfigStore.use
InMemoryPushNotificationConfigStoreby default.- Parameters:
pushConfigStore- push notification config store- Returns:
- builder instance of
AgentScopeA2aServer
-
pushSender
public AgentScopeA2aServer.Builder pushSender(io.a2a.server.tasks.PushNotificationSender pushSender) Set implementations ofPushNotificationSender.use
BasePushNotificationSenderby default.- Parameters:
pushSender- push notification sender- Returns:
- builder instance of
AgentScopeA2aServer
-
executor
Set executor for handle a2a request.use
Executors.newCachedThreadPool()by default.- Parameters:
executor- executor- Returns:
- builder instance of
AgentScopeA2aServer
-
deploymentProperties
Set deployment port to generate default transport interface information in agentCard.- Parameters:
port- deployment port- Returns:
- builder instance of
AgentScopeA2aServer
-
deploymentProperties
Set deployment properties to generate default transport interface information in agentCard.- Parameters:
deploymentProperties- deployment properties- Returns:
- builder instance of
AgentScopeA2aServer
-
withAgentRegistry
AddAgentRegistryimplementation which should register this agent to registry.- Parameters:
agentRegistry- agent registry implementation- Returns:
- builder instance of
AgentScopeA2aServer
-
agentExecuteProperties
public AgentScopeA2aServer.Builder agentExecuteProperties(AgentExecuteProperties agentExecuteProperties) Set agent execute properties.- Parameters:
agentExecuteProperties- agent execute properties- Returns:
- builder instance of
AgentScopeA2aServer
-
build
Build a new instance ofAgentScopeA2aServer.This Builder will build with follow steps:
- Build
AgentCardfrom input agent card properties and transports properties. - Build AgentExecutor with input
AgentRunnerand build RequestHandler. - Build all transport request handle wrapper by input properties and SPI load transport builders
- Build
AgentRegistryServicefrom inputAgentRegistry.
- Returns:
- a new instance of
AgentScopeA2aServer - Throws:
IllegalArgumentException- ifAgentRunneris missing or no available transport found.
- Build
-