aw_agents.adapters¶
Adapters for exposing agents to different platforms.
Functions
|
Generate an MCP server script for an agent. |
|
Generate an API server script for an agent. |
Classes
|
Adapter to expose an AgentBase as an MCP server. |
|
Adapter to expose an AgentBase as a FastAPI/OpenAPI service. |
- class aw_agents.adapters.MCPAdapter(agent, server_name, **server_options)[source]¶
Bases:
objectAdapter to expose an AgentBase as an MCP server.
Usage:
agent = YourAgent() adapter = MCPAdapter(agent, server_name="your-agent") adapter.run_sync()adapter.serveris thepy2mcp(FastMCP) server;adapter.toolsthe functions it serves, one per agent tool.
- class aw_agents.adapters.OpenAPIAdapter(agent, *, title='AI Agent API', description='AI Agent exposed via OpenAPI', version='1.0.0', server_url=None)[source]¶
Bases:
objectAdapter to expose an AgentBase as a FastAPI/OpenAPI service.
Usage:
agent = YourAgent() adapter = OpenAPIAdapter(agent, title="Your Agent API") adapter.run(port=8000)
- aw_agents.adapters.create_api_server_script(agent_class, output_path, *, default_port=8000)[source]¶
Generate an API server script for an agent.
- aw_agents.adapters.create_mcp_server_script(agent_class, server_name, output_path)[source]¶
Generate an MCP server script for an agent.
Modules
MCP (Model Context Protocol) adapter for AW agents. |
|
OpenAPI/FastAPI adapter for AW agents. |