Metadata-Version: 2.4
Name: voiceeval-sdk
Version: 0.1.7
Summary: Enterprise-grade Observability and Evaluation SDK for Voice Agents
Project-URL: Repository, https://github.com/voiceeval/voiceeval-sdk
Project-URL: Homepage, https://voiceeval.com
Author-email: VoiceEval Team <hello@voiceeval.com>
License: MIT License
        
        Copyright (c) 2025 VoiceEval
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: httpx
Requires-Dist: openai
Requires-Dist: opentelemetry-api
Requires-Dist: opentelemetry-exporter-otlp
Requires-Dist: opentelemetry-instrumentation-anthropic
Requires-Dist: opentelemetry-instrumentation-google-generativeai
Requires-Dist: opentelemetry-instrumentation-openai
Requires-Dist: opentelemetry-sdk
Requires-Dist: pydantic
Requires-Dist: python-dotenv
Description-Content-Type: text/markdown

# VoiceEval SDK (Python)

[![Python](https://img.shields.io/badge/Python-3.11%2B-blue)](https://www.python.org/)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![OpenTelemetry](https://img.shields.io/badge/OpenTelemetry-Native-purple)](https://opentelemetry.io/)

**VoiceEval** is an enterprise-grade observability and evaluation SDK designed specifically for Voice Agents and LLM-powered applications. It provides detailed tracing, latency breakdown, and cost analysis with zero configuration.

## 🚀 Key Features

- **🔎 Zero-Config Auto-Instrumentation**: Automatically detects and traces calls from major LLM providers (OpenAI, Anthropic, Google Gemini) without any code changes.
- **🛡️ Secure Ingestion Proxy**: All traces are sent through a secure proxy (`server/`), separating your application logic from downstream observability backends (like Langfuse). This ensures you maintain full control over your data and API keys.
- **⚡ High Performance**: Built on top of `OpenTelemetry`, utilizing efficient asynchronous Batch exports (`OTLP/HTTP`) to ensure negligible runtime overhead.
- **🧩 Standardized Data Model**: Uses standard OTel semantic conventions, making your data portable and interoperable with any OTel-compatible backend.

## 📦 Installation

Install the SDK via `pip` (or `uv`):

```bash
pip install voiceeval-sdk
# or
uv add voiceeval-sdk
```

For local development:
```bash
git clone https://github.com/voiceeval/voiceeval-sdk.git
cd voiceeval-sdk
pip install -e .
```

## 🏁 Quickstart

### 1. Initialize the Client

Initialize the `Client` at the start of your application. This single line sets up the OTel exporter and enables auto-instrumentation for all installed LLM libraries.

```python
from voiceeval import Client

# Initialize SDK - connects to your local proxy or prod endpoint
client = Client(
    api_key="your_voiceeval_api_key",  # or set VOICE_EVAL_API_KEY env var
    base_url="http://api.voiceeval.com/v1/traces"
)
```

### 2. Run Your Agent

That's it! Any calls to supported libraries like `openai` or `anthropic` are now automatically traced.

```python
from openai import OpenAI

# No manual wrapping needed!
client_openai = OpenAI()
response = client_openai.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello world"}]
)
```

### 3. Manual Tracing (Optional)

For functions that don't call LLMs (like your business logic or RAG pipeline), use the `@observe` decorator:

```python
from voiceeval import observe

@observe(name_override="rag_retrieval")
def retrieve_documents(query: str):
    # Your complex logic here
    return docs
```

## 🔌 Supported Providers

The SDK automatically instruments the following libraries if they are found in your environment:

| Provider | Library | Status |
| :--- | :--- | :--- |
| **OpenAI** | `openai` | ✅ Auto-Instrumented |
| **Anthropic** | `anthropic` | ✅ Auto-Instrumented |
| **Google Gemini** | `google-generativeai` | ✅ Auto-Instrumented |

*Note: If a library is not installed, the SDK gracefully skips it.*

## 📄 License

MIT
