Metadata-Version: 2.4
Name: pie-client
Version: 0.3.0
Summary: Pie Client
Author-email: In Gim <in.gim@yale.edu>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/pie-project/pie
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websockets>=15.0
Requires-Dist: msgpack>=0.5.6
Requires-Dist: blake3>=1.0.4
Requires-Dist: cryptography>=42.0.0
Requires-Dist: typer>=0.9.0
Requires-Dist: toml>=0.10.0

# pie-client

Python WebSocket client for a running `pie serve` engine.

## Install

```bash
pip install pie-client
```

From this checkout:

```bash
pip install -e client/python
```

## Example

```python
import asyncio
from pie_client import Event, PieClient

async def main():
    async with PieClient("ws://127.0.0.1:8080") as client:
        await client.authenticate("local-dev")

        proc = await client.launch_process(
            "text-completion",
            input={"prompt": "The capital of France is"},
        )

        while True:
            event, value = await proc.recv()
            if event in {Event.Return, Event.Error}:
                print(value)
                break

asyncio.run(main())
```

Use public-key authentication when server auth is enabled. For local
development, start the server with `pie serve --no-auth`.
