Metadata-Version: 2.4
Name: paive-agents
Version: 0.2.0
Summary: Official Python SDK for the Paive patent intelligence report API
License: Proprietary
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28
Requires-Dist: httpx>=0.24

# paive-agents

Official Python SDK for the Paive patent intelligence report API.

## Install

```bash
pip install paive-agents
```

## Before publishing publicly

`src/paive_agents/client.py` currently defaults to a staging server:

```python
DEFAULT_BASE_URL = "http://34.29.194.252:8000"
```

This is a working staging link (plain HTTP, IP-based). Before publishing this package
anywhere public (PyPI, external customers), swap this for your real production domain
over HTTPS. Until then, this default is fine for internal testing.

## Sync usage

```python
from paive_agents import Client

client = Client(api_key="YOUR_API_KEY")

report = client.generate_report(
    patent_id="US12093418B2",
    tech_sector="Biotech / Therapeutics",
    clp_factors=["Application Effect", "Benchmarking Data"],
    market_factors=["Application Effect"],
    licensing_factors=["Application Effect"],
)

print(report.pdf_file)
```

## Async usage

```python
from paive_agents import AsyncClient

client = AsyncClient(api_key="YOUR_API_KEY")
report = await client.generate_report(patent_id="US12093418B2")
```

## PDF upload instead of patent_id

```python
report = client.generate_report(pdf_path="/path/to/patent.pdf")
```

## Errors

All errors subclass `paive_agents.PaiveError` and carry `.status_code` and `.response_body`:

- `AuthenticationError` — invalid/missing API key (401)
- `PermissionDeniedError` — user lacks permission (403)
- `InvalidRequestError` — bad request (400/404)
- `RateLimitError` — usage limit exceeded (429)
- `ServerError` — server-side failure (500+)
- `APIConnectionError` — network/connection failure

## What this SDK does NOT change

This package only talks to the existing `/api/keys/generate_report` endpoint over HTTP,
using the same field names and the same `X-API-Key` auth your Django backend already expects.
No backend files were modified to build this SDK.
