Metadata-Version: 2.4
Name: adeptiv-ai-evaluator-sdk
Version: 1.66.0.dev1
Summary: Adeptiv GenAI tracing SDK for LLMs, agents, and AI workflows
Author-email: Adeptiv AI <contact@adeptiv-ai.com>
License: Apache-2.0
Description-Content-Type: text/markdown
Requires-Dist: opentelemetry-api
Requires-Dist: opentelemetry-sdk
Requires-Dist: opentelemetry-exporter-otlp-proto-common
Requires-Dist: opentelemetry-instrumentation-logging
Requires-Dist: websockets<17,>=13
Provides-Extra: openai
Requires-Dist: openinference-instrumentation-openai; extra == "openai"
Provides-Extra: openai-agents
Requires-Dist: openinference-instrumentation-openai-agents; extra == "openai-agents"
Provides-Extra: anthropic
Requires-Dist: openinference-instrumentation-anthropic; extra == "anthropic"
Provides-Extra: litellm
Requires-Dist: openinference-instrumentation-litellm; extra == "litellm"
Provides-Extra: langchain
Requires-Dist: openinference-instrumentation-langchain; extra == "langchain"
Provides-Extra: llama-index
Requires-Dist: openinference-instrumentation-llama-index; extra == "llama-index"
Provides-Extra: vertexai
Requires-Dist: openinference-instrumentation-vertexai; extra == "vertexai"
Provides-Extra: bedrock
Requires-Dist: openinference-instrumentation-bedrock; extra == "bedrock"
Provides-Extra: google-genai
Requires-Dist: openinference-instrumentation-google-genai; extra == "google-genai"
Provides-Extra: mistralai
Requires-Dist: openinference-instrumentation-mistralai; extra == "mistralai"
Provides-Extra: groq
Requires-Dist: openinference-instrumentation-groq; extra == "groq"
Provides-Extra: dspy
Requires-Dist: openinference-instrumentation-dspy; extra == "dspy"
Provides-Extra: crewai
Requires-Dist: openinference-instrumentation-crewai; extra == "crewai"
Provides-Extra: haystack
Requires-Dist: openinference-instrumentation-haystack; extra == "haystack"
Provides-Extra: smolagents
Requires-Dist: openinference-instrumentation-smolagents; extra == "smolagents"
Provides-Extra: autogen
Requires-Dist: openinference-instrumentation-autogen; extra == "autogen"
Provides-Extra: instructor
Requires-Dist: openinference-instrumentation-instructor; extra == "instructor"
Provides-Extra: all
Requires-Dist: openinference-instrumentation-openai; extra == "all"
Requires-Dist: openinference-instrumentation-openai-agents; extra == "all"
Requires-Dist: openinference-instrumentation-anthropic; extra == "all"
Requires-Dist: openinference-instrumentation-litellm; extra == "all"
Requires-Dist: openinference-instrumentation-langchain; extra == "all"
Requires-Dist: openinference-instrumentation-llama-index; extra == "all"
Requires-Dist: openinference-instrumentation-vertexai; extra == "all"
Requires-Dist: openinference-instrumentation-bedrock; extra == "all"
Requires-Dist: openinference-instrumentation-google-genai; extra == "all"
Requires-Dist: openinference-instrumentation-mistralai; extra == "all"
Requires-Dist: openinference-instrumentation-groq; extra == "all"
Requires-Dist: openinference-instrumentation-dspy; extra == "all"
Requires-Dist: openinference-instrumentation-crewai; extra == "all"
Requires-Dist: openinference-instrumentation-haystack; extra == "all"
Requires-Dist: openinference-instrumentation-smolagents; extra == "all"
Requires-Dist: openinference-instrumentation-autogen; extra == "all"
Requires-Dist: openinference-instrumentation-instructor; extra == "all"

# Adeptiv GenAI Tracing SDK

**Adeptiv GenAI** is a lightweight, vendor-neutral **OpenTelemetry tracing SDK** for **LLMs, agents, and AI workflows**.

It captures **latency, execution flow, hashes, and metadata** for all AI use cases.

---

## Key Features

-  **Trace-only observability** (no response normalization)
- Works with **any LLM** (OpenAI, Anthropic, Gemini, local models)
- Supports **chat, summarization, agents, tools, RAG**
- **Sync & async** compatible
- **Enterprise-safe** (hashing, redaction, previews)
- **OpenTelemetry compatible**
---

This ensures **zero lock-in** and **maximum compatibility**.

---

## Installation

```bash

pip install adeptiv-ai-evaluator-sdk

```

# Adeptiv GenAI Tracing SDK


Tracing an LLM Call

```python


SDK configuration

config.endpoint = "wss://<adeptiv host>/ws/sdk/" # Adeptiv endpoint (set before the key)
config.api_key = "" #project Key 
config.project_name = "customer-support-bot" # Project Name


from adeptiv_evaluator_sdk import trace_llm

@trace_llm(model="gpt-4o", operation="chat", workflow_id="")
def chat(prompt):
    return llm.invoke(prompt)

chat("Hello world")

```


```python
# Adeptiv GenAI Tracing Agents SDK

from adeptiv_evaluator_sdk import trace_llm

@trace_agent("support_agent", model="gpt-4o",workflow_id="")
async def run_agent(query):
    return await agent.run(query)


```


---

## Containment

Containment rules (pause an agent, block a tool, approved models only, slow
down, budgets) are enforced by a separate package, `adeptiv-ai-gateway`:

```bash
pip install adeptiv-ai-gateway
```

```python
from adeptiv_gateway import Adeptiv

client = Adeptiv()          # once, at start-up
```

It works alongside this SDK, in either order.

## Transport

Traces go over **one WebSocket per process** to Adeptiv, opened in the
background. You give the SDK two things: the endpoint
and your project API key.

```python
from adeptiv_evaluator_sdk import init_telemetry

init_telemetry(
    api_key="<project api key>",
    endpoint="wss://<adeptiv host>/ws/sdk/",
)
```

or `ADEPTIV_API_KEY` and `ADEPTIV_ENDPOINT` in the environment. The key is
sent once, on the `Authorization` header when the connection opens.

While the connection is down your app never waits on it: trace batches are
held in memory (up to 32 MB, gzipped) and sent when it is back.

| Setting | Env var | Default |
|---|---|---|
| `endpoint` | `ADEPTIV_ENDPOINT` | none (required) |
| `api_key` | `ADEPTIV_API_KEY` | none (required) |
| `realtime_ack_timeout_seconds` | `ADEPTIV_REALTIME_ACK_TIMEOUT` | `10` (then the batch is held and sent again) |
| `realtime_connect_timeout_seconds` | `ADEPTIV_REALTIME_CONNECT_TIMEOUT` | `5` |
| `realtime_max_backoff_seconds` | `ADEPTIV_REALTIME_MAX_BACKOFF` | `60` (reconnect backoff cap) |

## Media (images, audio, video, PDF, Word)

Off by default: files sent to a model can hold personal data. Turn it on with
`init_telemetry(capture_media=True)` or `ADEPTIV_CAPTURE_MEDIA=true`.

- A file found inline in a model call (a base64 data URI, or a provider's
  base64 source such as Anthropic's) is uploaded to Adeptiv **apart from the
  trace**, straight to storage with a one-time form, in a background thread.
  The trace keeps a short reference: `[media image/png 812 KB sha256:…]`.
- A file larger than `media_max_bytes` is noted, not uploaded:
  `[application/pdf omitted: 7.2 MB, over the 5.0 MB limit]`.
- A file already uploaded (same SHA-256) is not sent again.
- With capture off, an inline file is replaced by `[inline image/png omitted, 812 KB]`.

| Option | Environment | Default |
|---|---|---|
| `capture_media` | `ADEPTIV_CAPTURE_MEDIA` | `false` |
| `media_max_bytes` | `ADEPTIV_MEDIA_MAX_BYTES` | `5242880` (5 MB) |
