aw_agents¶
aw_agents - AI Agents for Agentic Workflows
A collection of AI agents that can be easily deployed to multiple chatbot platforms (Claude, ChatGPT, etc.) through adapters.
Agents:
DownloadAgent: Smart content downloader with context-aware naming
Adapters:
MCPAdapter: For Claude Desktop (MCP protocol)
OpenAPIAdapter: For ChatGPT Custom GPTs (OpenAPI/FastAPI)
Example
>>> from aw_agents.agents.download import DownloadAgent
>>> from aw_agents.adapters import MCPAdapter
>>>
>>> agent = DownloadAgent()
>>> adapter = MCPAdapter(agent, "download-agent")
>>> # adapter.run() serves the agent via MCP for Claude (blocks; not run here)
Functions
|
Helper to create JSON schema for tool parameters. |
|
Generate an MCP server script for an agent. |
|
Generate an API server script for an agent. |
Classes
Base class for all AW agents. |
|
|
Standard result format for tool execution. |
|
Adapter to expose an AgentBase as an MCP server. |
|
Adapter to expose an AgentBase as a FastAPI/OpenAPI service. |
|
Smart download agent with context-aware naming and intelligent link handling. |
- class aw_agents.AgentBase[source]¶
Bases:
ABCBase class for all AW agents.
Agents should inherit from this and implement the core methods. Adapters (MCP, OpenAPI) will wrap these agents for deployment.
- class aw_agents.DownloadAgent(default_download_dir=None, **kwargs)[source]¶
Bases:
AgentBaseSmart download agent with context-aware naming and intelligent link handling.
Features:
Detects landing pages and finds actual download links
Special handling for GitHub, HuggingFace, Kaggle
Context-aware file naming
Multiple content type support
>>> agent = DownloadAgent() >>> tools = agent.get_tools() >>> len(tools) >= 3 True
- class aw_agents.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.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)
- class aw_agents.ToolExecutionResult(success, data=None, message=None, warnings=None, metadata=None)[source]¶
Bases:
objectStandard result format for tool execution.
- classmethod error_result(message, data=None, **kwargs)[source]¶
Create an error result.
- Return type:
- aw_agents.create_api_server_script(agent_class, output_path, *, default_port=8000)[source]¶
Generate an API server script for an agent.
- aw_agents.create_json_schema(properties, required=None, **kwargs)[source]¶
Helper to create JSON schema for tool parameters.
>>> schema = create_json_schema( ... properties={ ... 'url': {'type': 'string', 'description': 'URL to process'}, ... 'context': {'type': 'string', 'description': 'Context info'} ... }, ... required=['url'] ... ) >>> schema['type'] 'object' >>> 'url' in schema['required'] True
- aw_agents.create_mcp_server_script(agent_class, server_name, output_path)[source]¶
Generate an MCP server script for an agent.
Modules
Adapters for exposing agents to different platforms. |
|
Agents for agentic workflows. |
|
Base classes and protocols for AW agents. |
|
Utils for aw_agents |