Metadata-Version: 2.4
Name: acp-sdk
Version: 0.1.0rc6
Summary: Agent Communication Protocol SDK
Requires-Python: <4.0,>=3.11
Requires-Dist: opentelemetry-api>=1.31.1
Requires-Dist: pydantic>=2.11.1
Provides-Extra: client
Requires-Dist: httpx-sse>=0.4.0; extra == 'client'
Requires-Dist: httpx>=0.28.1; extra == 'client'
Requires-Dist: opentelemetry-instrumentation-httpx>=0.52b1; extra == 'client'
Provides-Extra: server
Requires-Dist: fastapi[standard]>=0.115.8; extra == 'server'
Requires-Dist: janus>=2.0.0; extra == 'server'
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.31.1; extra == 'server'
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.52b1; extra == 'server'
Requires-Dist: opentelemetry-sdk>=1.31.1; extra == 'server'
Description-Content-Type: text/markdown

# Agent Communication Protocol SDK for Python

Agent Communication Protocol SDK for Python provides allows developers to serve and consume agents over the Agent Communication Protocol.

## Prerequisites

✅ Python >= 3.11

## Installation

Install to use client:

```shell
pip install acp-sdk[client]
```

Install to use server:

```shell
pip install acp-sdk[server]
```

## Overview

### Client

The `client` submodule exposes [httpx]() based client with simple methods for communication over ACP.

```python
async with Client(base_url="http://localhost:8000") as client:
    run = await client.run_sync(agent="echo", input=Message(TextMessagePart(content="Howdy!")))
    print(run.output)
```

### Server

The `server` submodule exposes [fastapi] application factory that makes it easy to expose any agent over ACP.

```python
class EchoAgent(Agent):
    @property
    def name(self) -> str:
        return "echo"

    @property
    def description(self) -> str:
        return "Echoes everything"

    async def run(self, input: Message, *, context: Context) -> AsyncGenerator[Message | Await, AwaitResume]:
        for part in input:
            await asyncio.sleep(0.5)
            yield {"thought": "I should echo everyting"}
            yield Message(part)


serve(EchoAgent())
```

➡️ Explore more in our [examples library](/python/examples).
