A2aAgentServer
autogen.a2a.A2aAgentServer #
A2aAgentServer(agent, *, url='http://localhost:8000', agent_card=None, card_modifier=None, extended_agent_card=None, extended_card_modifier=None)
A server wrapper for running an AG2 agent via the A2A protocol.
This class provides functionality to wrap an AG2 ConversableAgent into an A2A server that can be used to interact with the agent through A2A requests.
Initialize the A2aAgentServer.
PARAMETER | DESCRIPTION |
---|---|
agent | The Autogen ConversableAgent to serve. TYPE: |
url | The base URL for the A2A server. TYPE: |
agent_card | Configuration for the base agent card. TYPE: |
card_modifier | Function to modify the base agent card. TYPE: |
extended_agent_card | Configuration for the extended agent card. TYPE: |
extended_card_modifier | Function to modify the extended agent card. TYPE: |
Source code in autogen/a2a/server.py
card instance-attribute
#
card = model_validate({'name': name, 'description': description, 'url': url, 'supports_authenticated_extended_card': extended_agent_card is not None, None: model_dump(exclude_none=True)})
build_request_handler #
build_request_handler(*, task_store=None, queue_manager=None, push_config_store=None, push_sender=None, request_context_builder=None)
Build a request handler for A2A application.
PARAMETER | DESCRIPTION |
---|---|
task_store | The task store to use. TYPE: |
queue_manager | The queue manager to use. TYPE: |
push_config_store | The push notification config store to use. TYPE: |
push_sender | The push notification sender to use. TYPE: |
request_context_builder | The request context builder to use. TYPE: |
RETURNS | DESCRIPTION |
---|---|
RequestHandler | A configured RequestHandler instance. |
Source code in autogen/a2a/server.py
build_starlette_app #
Build a Starlette A2A application for ASGI server.
PARAMETER | DESCRIPTION |
---|---|
request_handler | The request handler to use. TYPE: |
context_builder | The context builder to use. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Starlette | A configured Starlette application instance. |