Metadata-Version: 2.4
Name: interpretai
Version: 0.1.0
Summary: Official Python SDK for the InterpretAI public API.
Project-URL: Homepage, https://interpretai.tech
Project-URL: Documentation, https://interpretai.tech/docs
Project-URL: Source, https://github.com/interpretai/interpretai
Project-URL: Issues, https://github.com/interpretai/interpretai/issues
Author-email: InterpretAI <support@interpretai.tech>
License: Apache-2.0
Keywords: ai,evaluation,interpretai,rca,review
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: anyio>=4.5
Requires-Dist: distro<2,>=1.7
Requires-Dist: httpx>=0.27
Requires-Dist: jiter<1,>=0.4
Requires-Dist: tenacity<10,>=8.2.3
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# interpretai

Official Python SDK for the [InterpretAI](https://interpretai.tech) public API.

This package wraps three feature surfaces — **Public Reviewer**, **SSC SRS Review**,
and **RCA** — behind a resource-oriented client modelled on the OpenAI and
Anthropic Python SDKs. Every long-running surface follows the same
`submit → get → wait` shape.

## Install

```bash
pip install interpretai
```

## Quickstart

```python
import os
from interpretai import Client
from interpretai.types.public_reviewer import ReviewRequest, Subject

client = Client(api_key=os.environ["INTERPRETAI_API_KEY"])

job = client.public_reviewer.submit(ReviewRequest(
    subjects=[
        Subject(text="Loves trail running and surfing.", label="a"),
        Subject(text="Mostly reads indoors.", label="b"),
    ],
    prompt="Which subject is more outdoorsy?",
    model_tier="tlarge",
))

result = client.public_reviewer.wait(job.job_id, timeout_s=120)
print(result.score, result.reasoning)
```

### Async

```python
import asyncio
from interpretai import AsyncClient
from interpretai.types.public_reviewer import ReviewRequest, Subject

async def main() -> None:
    async with AsyncClient() as client:
        job = await client.public_reviewer.submit(ReviewRequest(
            subjects=[Subject(text="..."), Subject(text="...")],
            prompt="...",
            model_tier="tlarge",
        ))
        result = await client.public_reviewer.wait(job.job_id)
        print(result.score)

asyncio.run(main())
```

### Per-request overrides

```python
fast = client.with_options(timeout=10.0, max_retries=0)
fast.public_reviewer.submit(...)
```

## Configuration

The SDK reads two environment variables when the constructor parameters are
not supplied:

- `INTERPRETAI_API_KEY` — your API key (must start with `iai_`).
- `INTERPRETAI_BASE_URL` — base URL (defaults to `https://stage-app.interpretai.tech`).

## Resources

| Resource | Methods |
|---|---|
| `client.auth` | `me()` |
| `client.public_reviewer` | `submit()`, `get(job_id)`, `wait(job_id, ...)` |
| `client.ssc` | `submit()`, `get(job_id)`, `wait(job_id, ...)` |
| `client.rca` | `submit()`, `get(job_id)`, `wait(job_id, ...)` |

See the [top-level SDK README](https://github.com/interpretai/interpretai/blob/main/interpret/sdk/README.md)
for design notes and roadmap.

## License

Apache-2.0
