Metadata-Version: 2.4
Name: eolaswork
Version: 0.1.0
Summary: Official Python SDK for the EolasWork agentic platform
Project-URL: Homepage, https://eolaswork.com
Project-URL: Documentation, https://docs.eolaswork.com/sdk/python
Project-URL: Repository, https://github.com/eolasflow/eolaswork-python
Author: EolasWork
License: MIT
Keywords: agents,ai,automation,eolaswork,llm
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
Requires-Python: >=3.11
Requires-Dist: httpx-sse<1.0,>=0.4
Requires-Dist: httpx<1.0,>=0.27
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# eolaswork

Official Python SDK for the [EolasWork](https://eolaswork.com) agentic platform.

## Install

```
pip install eolaswork
```

Python 3.11+. Sync + async clients ship together.

## Quickstart

```python
from eolaswork import Client

client = Client(api_key="nxa_...")        # or set EOLASWORK_API_KEY

# Discover
me     = client.account.whoami()
roles  = client.roles.list()
models = client.models.list()

# Create a task + run an agent
task = client.tasks.create(title="Q2 board prep")
client.files.upload(task.id, "./Q2_sales.xlsx")

run = client.runs.create(
    task_id=task.id,
    prompt="Build a board-ready summary from the Excel I attached.",
    role="research-analyst",
    model="claude-opus-4-7",
    skills=["xlsx-reader"],
    webhook_url="https://my-app.example.com/eolaswork/hook",  # optional
)

# Three ways to wait
final = client.runs.wait(run.id, timeout=300)           # blocks
# or:
for ev in client.runs.stream(run.id):                   # live SSE
    print(ev.kind, ev.payload)
# or: don't wait; let the webhook arrive at your endpoint.

print(final.status, final.output)
```

## Async

```python
import asyncio
from eolaswork import AsyncClient

async def main():
    async with AsyncClient(api_key="nxa_...") as client:
        task = await client.tasks.create(title="async run")
        run = await client.runs.create(task_id=task.id, prompt="...")
        async for ev in client.runs.astream(run.id):
            print(ev)

asyncio.run(main())
```

## Webhook receiver

```python
from eolaswork.webhooks import verify_signature

@app.post("/eolaswork/hook")
def hook(request):
    payload = verify_signature(
        raw_body=request.body,
        signature_header=request.headers["X-EolasWork-Signature"],
        secret=os.environ["EOLASWORK_WEBHOOK_SECRET"],
    )
    print(payload.run_id, payload.status, payload.output)
    return "", 204
```

## Configuration

| Env var | Default | Meaning |
|---|---|---|
| `EOLASWORK_API_KEY` | required | Bearer key (create at /settings/api-keys) |
| `EOLASWORK_BASE_URL` | `https://nexa.aihq.ie` | Backend host (override for self-hosted) |

Explicit constructor args win over env vars:

```python
client = Client(api_key="...", base_url="https://eolaswork.your-co.com",
                timeout=120.0, max_retries=5)
```

## Resource surface

| Resource | What it does |
|---|---|
| `client.account` | `whoami`, `instructions`, `preferences`, `artifacts` |
| `client.api_keys` | list / create / revoke programmatic keys |
| `client.tasks` | conversations CRUD + `send_message` |
| `client.runs` | create / retrieve / list / cancel / `wait` / `stream` / approve / deny |
| `client.files` | upload / list / download / delete / `to_pdf` |
| `client.roles` | catalogue + file content (read-only) |
| `client.teams` | catalogue + file content (read-only) |
| `client.skills` | catalogue + file content (read-only) |
| `client.models` | LLM model catalogue + providers |
| `client.followups` | cross-conversation action items |
| `client.memory` | user-level KV memory |

Async variants share the exact same surface on `AsyncClient` -- every method is awaitable.

## License

MIT.
