Metadata-Version: 2.4
Name: autogen-pathcourse
Version: 0.1.0
Summary: AutoGen / AG2 integration for PathCourse Health — multi-agent inference with autonomous USDC billing on Base L2
Project-URL: Homepage, https://pathcoursehealth.com
Project-URL: Repository, https://github.com/pathcourse-health/autogen-pathcourse
Project-URL: Documentation, https://docs.pathcoursehealth.com
License: MIT
Keywords: ag2,ai-agents,autogen,autonomous,llm,multi-agent,pathcourse
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Provides-Extra: ag2
Requires-Dist: ag2>=0.3.0; extra == 'ag2'
Provides-Extra: autogen
Requires-Dist: pyautogen>=0.2.0; extra == 'autogen'
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Description-Content-Type: text/markdown

# autogen-pathcourse

AutoGen / [AG2](https://ag2.ai) integration for PathCourse Health. Run multi-agent
conversations with autonomous USDC billing on Base L2 — no accounts, no credit cards,
no KYC.

## Install

```bash
# AutoGen (legacy package name)
pip install autogen-pathcourse pyautogen

# AG2 (the new fork)
pip install autogen-pathcourse ag2
```

## Quick Start

```python
from autogen import AssistantAgent, UserProxyAgent
from autogen_pathcourse import pch_config

config_list = pch_config(model="pch-pro")
llm_config = {"config_list": config_list, "temperature": 0.7}

assistant = AssistantAgent(
    name="assistant",
    llm_config=llm_config,
    system_message="You are a helpful AI assistant.",
)

user_proxy = UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=3,
    code_execution_config=False,
)

user_proxy.initiate_chat(assistant, message="Explain x402 in two sentences.")
```

## Mixed-model multi-agent setup

Use different PCH models for different agents in the same conversation:

```python
from autogen import AssistantAgent
from autogen_pathcourse import pch_config

planner = AssistantAgent(
    name="planner",
    llm_config={"config_list": pch_config(model="pch-pro")},
    system_message="You plan multi-step research.",
)

coder = AssistantAgent(
    name="coder",
    llm_config={"config_list": pch_config(model="pch-coder")},
    system_message="You implement what the planner specifies.",
)

reviewer = AssistantAgent(
    name="reviewer",
    llm_config={"config_list": pch_config(model="pch-fast")},
    system_message="You spot-check work for issues.",
)
```

## Models

| Model | Rate | Notes |
|---|---|---|
| `pch-fast` | $0.44/M tokens | Fast reasoning, classification, routing |
| `pch-pro` | $1.96/M tokens | Deep reasoning, multi-step planning (Bronze+) |
| `pch-coder` | $3.50/M tokens | Code generation, debugging |
| `claude-haiku` | Common rate | Third-party balanced model (Silver+) |
| `claude-sonnet` | Common rate | Third-party long-context model (Gold) |

Choosing a model:

- Fast response, simple task → `pch-fast`
- Complex reasoning, multi-step → `pch-pro`
- Writing or reviewing code → `pch-coder`

## Authentication

Set `PCH_API_KEY` in your environment, or pass `pch_api_key=` to `pch_config`.

```bash
export PCH_API_KEY=pch_prod_b_...
```

Get an API key at [pathcoursehealth.com](https://pathcoursehealth.com).

## How it works

AutoGen's `config_list` accepts any OpenAI-compatible endpoint via the `base_url` and
`api_type: "openai"` fields. The PCH gateway is fully OpenAI API-compatible, so this adapter
is purely configuration — every AutoGen feature (group chat, code execution, function
calling, custom agents) works unchanged.

## Links

- Platform: [pathcoursehealth.com](https://pathcoursehealth.com)
- AutoGen: [microsoft.github.io/autogen](https://microsoft.github.io/autogen)
- AG2: [ag2.ai](https://ag2.ai)
- Python SDK: [pypi.org/project/pathcourse-sdk](https://pypi.org/project/pathcourse-sdk/)
- Integration examples: [github.com/pathcourse-health/pch-integration-examples](https://github.com/pathcourse-health/pch-integration-examples)

## License

MIT
