Metadata-Version: 2.4
Name: prismai-sdk
Version: 4.14.4
Summary: PrismAI Python SDK - LLM observability/tracing, datasets, experiments, LLM-as-a-judge evaluation, and prompt management
Author-email: prismai <raizadaabhishek@mooglelabs.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: <4.0,>=3.10
Requires-Dist: backoff>=1.10.0
Requires-Dist: httpx<1.0,>=0.15.4
Requires-Dist: opentelemetry-api<2,>=1.33.1
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.33.1
Requires-Dist: opentelemetry-sdk<2,>=1.33.1
Requires-Dist: packaging<27.0,>=23.2
Requires-Dist: pydantic<3,>=2
Requires-Dist: wrapt<3,>=1.14
Description-Content-Type: text/markdown


# PrismAI Python SDK

The PrismAI Python SDK covers the full platform: **observability/tracing** (OpenTelemetry-based, with OpenAI and LangChain integrations), **datasets & experiments** (offline evaluation and regression testing of prompt/model changes), **LLM-as-a-judge and custom evaluations/scores**, **prompt management**, and a **full REST API client**.

## Installation

> [!IMPORTANT]
> The SDK was rewritten in v4 and released in March 2026.

```
pip install prismai
```

## Quickstart

```python
# env: PRISMAI_PUBLIC_KEY, PRISMAI_SECRET_KEY, PRISMAI_BASE_URL

from prismai import get_client

prismai = get_client()

# Create a span using a context manager
with prismai.start_as_current_observation(as_type="span", name="process-request") as span:
    # Your processing logic here
    span.update(output="Processing complete")

    # Create a nested generation for an LLM call
    with prismai.start_as_current_observation(as_type="generation", name="llm-response", model="gpt-5.6") as generation:
        # Your LLM call logic here
        generation.update(output="Generated response")

# All spans are automatically closed when exiting their context blocks


# Flush events in short-lived applications
prismai.flush()
```


