Prisma AI platform client for evaluations, datasets, and jobs
Reason this release was yanked:
Released under MIT. Project relicensed to Apache 2.0 in v0.4.2 — install palqee-prisma-otel>=0.4.2.
Project description
palqee-prisma-client
Python client for the Prisma AI platform. Provides async access to projects, runs, analytics, and evaluations through a typed API.
Prerequisites
- Python 3.10 or later
- A Prisma AI API key
Installation
pip install palqee-prisma-client
Quick start
from palqee_prisma_client import PrismaClient
async with PrismaClient(
api_key="pq_prisma_sk_...",
workspace_id="<workspace-uuid>",
base_url="https://your-prisma-host",
) as client:
# Create a project and a run
project = await client.projects.get_or_create("my-app")
run = await client.runs.create(project.id)
Projects
# List all projects in the workspace
page = await client.projects.list()
for project in page.items:
print(project.id, project.name)
# Get a single project
project = await client.projects.get(project_id)
# Update a project
project = await client.projects.update(project_id, name="new-name", description="...")
# Get aggregate stats
stats = await client.projects.stats(project_id)
print(stats.total_runs, stats.total_traces)
# Delete a project
await client.projects.delete(project_id)
Runs
# List runs in a project (with optional filters)
page = await client.runs.list(project_id, status="completed", limit=50)
for run in page.items:
print(run.id, run.status)
# Get a single run
run = await client.runs.get(run_id)
# Update a run
run = await client.runs.update(run_id, status="completed")
# Get stats and evaluation metrics
stats = await client.runs.stats(run_id)
metrics = await client.runs.metrics(run_id)
print(metrics.metrics) # {"correctness": 0.88, ...}
# Delete a run
await client.runs.delete(run_id)
Analytics
# Structured query
result = await client.analytics.query(
dimensions=["model_name"],
measures=["trace_count", "avg_latency_ms"],
filters=[{"field": "project_id", "op": "eq", "value": project_id}],
)
for row in result.rows:
print(row.dimensions, row.measures)
# Project overview
overview = await client.analytics.overview(project_id, period="7d")
print(overview.total_traces, overview.total_cost_usd)
# Cost breakdown
costs = await client.analytics.costs(project_id, period="30d")
for item in costs.breakdown:
print(item.label, item.cost_usd)
# Export data
export = await client.analytics.export("csv", project_id=project_id)
print(export.download_url)
Evaluations
# Trigger evaluations on a run
result = await client.evaluations.run(run_id, evaluators=["correctness", "hallucination"])
print(result.status, result.total_evaluated)
# Get evaluation summary for a project
summary = await client.evaluations.summary(project_id, period="7d")
print(summary.avg_score, summary.scores_by_evaluator)
# List evaluators configured for a project
evaluators = await client.evaluations.evaluators(project_id)
for ev in evaluators:
print(ev.type, ev.name)
Pagination
List methods return a Page[T] object:
page = await client.projects.list(limit=20, offset=0)
print(page.total, page.has_more)
projects = page.items # list[Project]
Configuration
| Parameter | Environment variable | Description |
|---|---|---|
api_key |
PALQEE_PRISMA_API_KEY |
API key (pq_prisma_sk_...) |
workspace_id |
PALQEE_PRISMA_WORKSPACE_ID |
Workspace UUID |
base_url |
PALQEE_PRISMA_BASE_URL |
API gateway base URL |
timeout |
— | Request timeout in seconds (default 30) |
max_retries |
— | Max retries for transient errors (default 2) |
Error handling
All exceptions inherit from PrismaError:
from palqee_prisma_client import PrismaNotFoundError, PrismaAPIError, PrismaError
try:
project = await client.projects.get(project_id)
except PrismaNotFoundError:
print("Project not found")
except PrismaAPIError as e:
print(f"API error {e.status_code}: {e.message}")
except PrismaError:
print("SDK error")
| Exception | HTTP status | Description |
|---|---|---|
PrismaAuthenticationError |
— | Invalid or missing API key (client-side) |
PrismaAuthorizationError |
401, 403 | Server rejected the credentials |
PrismaNotFoundError |
404 | Resource does not exist |
PrismaConflictError |
409 | Conflict with existing state |
PrismaUnprocessableEntityError |
422 | Server-side validation failure |
PrismaAPIError |
other | Any other HTTP error |
PrismaTimeoutError |
— | Request timed out |
PrismaNetworkError |
— | Connection or transport failure |
PrismaValidationError |
— | Client-side input validation failure |
Version
from palqee_prisma_client import __version__
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file palqee_prisma_client-0.4.0.tar.gz.
File metadata
- Download URL: palqee_prisma_client-0.4.0.tar.gz
- Upload date:
- Size: 37.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
010fb2f5be2616348085f9b56aa9e33d6ff893a1a16c3820b0c62c421287749f
|
|
| MD5 |
95df92fd29c03bcbdc869caa50417fb8
|
|
| BLAKE2b-256 |
45b6c709e370f5fd9d1c44c46e8e21cc83aa83e527bf213a7cdb977aff28413c
|
Provenance
The following attestation bundles were made for palqee_prisma_client-0.4.0.tar.gz:
Publisher:
publish.yml on Palqee/prisma-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palqee_prisma_client-0.4.0.tar.gz -
Subject digest:
010fb2f5be2616348085f9b56aa9e33d6ff893a1a16c3820b0c62c421287749f - Sigstore transparency entry: 1630873282
- Sigstore integration time:
-
Permalink:
Palqee/prisma-ai@563f80ae3c69901b9d6615b81bc968dbf726411a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Palqee
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@563f80ae3c69901b9d6615b81bc968dbf726411a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file palqee_prisma_client-0.4.0-py3-none-any.whl.
File metadata
- Download URL: palqee_prisma_client-0.4.0-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aebb3fc124ff70ce8787cc9d58916a1b057b295bfcd7f5cb507d3c31d9cd8a9
|
|
| MD5 |
4070e8ae72bc8354999b43456e287c3e
|
|
| BLAKE2b-256 |
10f2a5d1719e96389d8ecda4f1e8302a9d613d3389d651d21f0edf92f35e4931
|
Provenance
The following attestation bundles were made for palqee_prisma_client-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on Palqee/prisma-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palqee_prisma_client-0.4.0-py3-none-any.whl -
Subject digest:
9aebb3fc124ff70ce8787cc9d58916a1b057b295bfcd7f5cb507d3c31d9cd8a9 - Sigstore transparency entry: 1630873309
- Sigstore integration time:
-
Permalink:
Palqee/prisma-ai@563f80ae3c69901b9d6615b81bc968dbf726411a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Palqee
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@563f80ae3c69901b9d6615b81bc968dbf726411a -
Trigger Event:
workflow_dispatch
-
Statement type: