Metadata-Version: 2.4
Name: dr-providers
Version: 0.1.1
Summary: OpenRouter LLM query client with typed requests and responses.
Project-URL: Repository, https://github.com/danielle-rothermel/dr-providers
Project-URL: Issues, https://github.com/danielle-rothermel/dr-providers/issues
Author-email: Danielle Rothermel <danielle.rothermel@gmail.com>
License-Expression: MIT
License-File: LICENSE
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.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.13.4
Provides-Extra: cli
Requires-Dist: typer>=0.26.7; extra == 'cli'
Description-Content-Type: text/markdown

# dr-providers

OpenRouter LLM query client with typed requests and responses. Requires Python 3.12+.

## Install

```bash
pip install dr-providers
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv add dr-providers
```

### Optional CLI

```bash
pip install "dr-providers[cli]"
python -m dr_providers.cli --help
```

## Authentication

Set your OpenRouter API key:

```bash
export OPENROUTER_API_KEY="sk-or-..."
```

## Library usage

```python
from dr_providers import (
    LlmRequest,
    Message,
    MessageRole,
    OpenRouterProvider,
    ProviderName,
)

with OpenRouterProvider() as provider:
    response = provider.generate(
        LlmRequest(
            provider=ProviderName.OPENROUTER,
            model="openai/gpt-4o-mini",
            messages=[
                Message(role=MessageRole.USER, content="Say hello in one word."),
            ],
        )
    )
    print(response.text)
```

### Prompt helper

For scripts and demos, `query_from_prompt` builds a request from plain strings:

```python
from dr_providers import OpenRouterProvider, ProviderName
from dr_providers.query.from_prompt import query_from_prompt

with OpenRouterProvider() as provider:
    response = query_from_prompt(
        provider,
        ProviderName.OPENROUTER,
        model="openai/gpt-4o-mini",
        prompt="Say hello in one word.",
    )
```

This helper is not re-exported from the top-level package.

## Public API

Import stable symbols from the top-level package:

```python
from dr_providers import LlmRequest, OpenRouterProvider, ReasoningSpec
```

See `dr_providers.__all__` for the full list.

## Development

```bash
uv sync --frozen
uv run pre-commit install
uv run pre-commit run --all-files
```

Run the CLI from the repo without installing:

```bash
uv run python -m dr_providers.cli --model openai/gpt-4o-mini -m "hi"
```

### Audit corpus ground truth

This repo includes a small audit-output corpus and curated ground-truth
normalization artifacts under `data/audit-corpus/`. Regenerate the parsed audit
and analysis files with:

```bash
uv run python scripts/generate_audit_ground_truth.py \
  --corpus-dir data/audit-corpus \
  --output-dir data/audit-corpus/ground-truth
```
