Metadata-Version: 2.4
Name: a2a-wrapper
Version: 0.2.0
Summary: Production-friendly helpers for exposing agents as A2A servers and consuming them through the official A2A SDK.
Author: Ayush
License: MIT
Project-URL: Homepage, https://github.com/Abhitheshek/a2a-wrapper
Project-URL: Documentation, https://github.com/Abhitheshek/a2a-wrapper#readme
Project-URL: Repository, https://github.com/Abhitheshek/a2a-wrapper
Keywords: a2a,agent,sdk,langchain,crewai,wrapper
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: a2a-sdk[http-server]
Requires-Dist: httpx>=0.27
Requires-Dist: uvicorn>=0.30
Provides-Extra: langchain
Requires-Dist: langchain; extra == "langchain"
Requires-Dist: langchain-community; extra == "langchain"
Requires-Dist: langchain-openai; extra == "langchain"
Requires-Dist: langgraph; extra == "langchain"
Requires-Dist: python-dotenv; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai; extra == "crewai"
Requires-Dist: crewai-tools; extra == "crewai"
Requires-Dist: python-dotenv; extra == "crewai"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"

# a2a-wrapper

`a2a-wrapper` is a lightweight helper layer for exposing custom agents as A2A servers and consuming A2A agents through the official Python `a2a-sdk`.

It is designed for teams who want a faster path from agent logic to an A2A-compatible service without rewriting the same request parsing, task response, and client plumbing every time.

## What it includes

- `src/a2a_wrapper/`
  - installable package with client and server APIs
- `examples/`
  - ready-to-run LangChain and CrewAI sample servers
- `tests/`
  - helper tests and an optional end-to-end smoke test

## Install

Base install:

```bash
pip install -e .
```

Optional extras:

```bash
pip install -e .[langchain]
pip install -e .[crewai]
pip install -e .[dev]
```

## Quick example

```python
from a2a_wrapper import (
    AgentCapability,
    AgentRequest,
    AgentServerConfig,
    ResponseContext,
    create_agent_server,
)


async def handler(request: AgentRequest, responder: ResponseContext) -> None:
    await responder.complete(f"Echo: {request.user_text}")


server = create_agent_server(
    config=AgentServerConfig(
        name="Echo Agent",
        description="Simple echo agent",
        host="0.0.0.0",
        port=10002,
    ),
    capabilities=[
        AgentCapability(
            capability_id="echo",
            name="Echo",
            description="Echoes user input",
        )
    ],
    handler=handler,
)

server.run()
```

## Client example

```python
import asyncio

from a2a_wrapper import AgentClient


async def main():
    async with AgentClient("http://localhost:10002") as client:
        reply = await client.send("Hello")
        print(reply.text)


asyncio.run(main())
```

## Examples

See [examples/README.md](C:\Users\ay936\Downloads\a2a_wrapper\examples\README.md) for exact run steps.

## Docs

See [DOCS.md](C:\Users\ay936\Downloads\a2a_wrapper\DOCS.md) for detailed LangChain, CrewAI, server, and client walkthroughs.

## Testing

Run:

```bash
pytest
```

Notes:

- unit tests work without a live A2A server
- the smoke test runs only when `a2a-sdk` is installed and importable
