Metadata-Version: 2.4
Name: prodloop-observability-sdk
Version: 0.1.2
Summary: Python SDK for evaluating AI voice bot calls via Prodloop APIs.
Project-URL: Homepage, https://prodloop.com
Project-URL: Documentation, https://observability-sdk-docs.pages.dev/
Project-URL: Repository, https://github.com/prodloop/prodloop-observability-sdk
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.5.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.25.0; extra == "docs"

# Prodloop Observability SDK

Python SDK to evaluate AI voice bot calls through the Prodloop evaluation service.

## Install

```bash
pip install prodloop-observability-sdk
```

## Quickstart

```python
from prodloop import ProdloopClient, EvaluationParameter

client = ProdloopClient(api_key="sk_live_...")

result = client.evaluate_call(
    audio_file_path="call.mp3",
    parameters=[
        EvaluationParameter.E2E_RESPONSE_TIME,
        EvaluationParameter.HALLUCINATION,
    ],
    thresholds={"e2e_response_time_max_ms": 800},
)

print(result)
```

## Extraction Validation

To validate extraction quality, pass both `extraction_schema` and `bot_captured_variables`:

```python
result = client.evaluate_call(
    audio_file_path="call.mp3",
    parameters=[EvaluationParameter.EXTRACTION_VARIABLES],
    extraction_schema={"customer_name": "string"},
    bot_captured_variables={"customer_name": "ram"},
)
```

Response includes:

- `extraction_variables`
- `extraction_validation`

## Supported Parameters

- `e2e_response_time`
- `turn_by_turn_latency`
- `hallucination`
- `extraction_variables`
- `interruption_behavior`

## Authentication

Pass your Prodloop API key in the SDK constructor.  
The SDK sends it as a `Bearer` token in the `Authorization` header.

## Errors

- `ValidationError`: invalid local inputs (file path, parameters, etc.)
- `APIError`: backend/API-level failures (`status_code`, `message`)

## Documentation Site

Live documentation: https://observability-sdk-docs.pages.dev/
