Skip to main content

Prisma AI platform client for validations, datasets, and jobs

Project description

Palqee Prisma Client

Typed async Python client for the Palqee Prisma oversight intelligence platform.

PyPI version Python versions License Documentation


What is this?

palqee-prisma-client is the low-level HTTP client for Palqee Prisma — the oversight intelligence platform that replaces manual review with automated, regulatory-grade validation across human and AI workflows. Use it to drive Prisma resources directly from Python: projects, runs, datasets, jobs, analytics, and validations.

Most applications should reach for palqee-prisma-ai — the high-level SDK that wires OpenTelemetry and validators into your stack with one call. Pick palqee-prisma-client when you need:

  • Direct platform control — backfill historical data, orchestrate batch validation jobs, build admin tooling.
  • Custom integrations — power BI dashboards, custom UIs, internal compliance tools, or CLI utilities.
  • Async-first ergonomicshttpx-based, fully typed via Pydantic, designed for high-throughput pipelines.

Installation

pip install palqee-prisma-client

Imports as palqee_prisma_client:

from palqee_prisma_client import PrismaClient

Requires Python 3.10+.

Quickstart

import asyncio
import os
from palqee_prisma_client import PrismaClient

async def main():
    async with PrismaClient(
        api_key=os.environ["PALQEE_PRISMA_API_KEY"],
        workspace_id=os.environ["PALQEE_PRISMA_WORKSPACE_ID"],
        base_url=os.environ["PALQEE_PRISMA_BASE_URL"],
    ) as client:
        project = await client.projects.get_or_create("complaints-review")
        run = await client.runs.create(project.id)
        print(f"Created run {run.id} under project {project.id}")

asyncio.run(main())

With env vars set, the constructor collapses to PrismaClient().

Resources

The client exposes one resource per Prisma domain object. Every method is async and returns a typed Pydantic model.

Projects

projects = await client.projects.list()                       # Page[Project]
project  = await client.projects.get(project_id)
project  = await client.projects.update(project_id, name="new-name")
stats    = await client.projects.stats(project_id)            # total_runs, total_traces, ...
await client.projects.delete(project_id)

Runs

runs    = await client.runs.list(project_id, status="completed", limit=50)
run     = await client.runs.get(run_id)
run     = await client.runs.update(run_id, status="completed")
metrics = await client.runs.metrics(run_id)                   # validator scores per run
await client.runs.delete(run_id)

Datasets

datasets = await client.datasets.list(project_id)
dataset  = await client.datasets.create(project_id, name="golden-set", items=[...])
items    = await client.datasets.items(dataset.id)

Jobs

job   = await client.jobs.create(project_id, dataset_id=dataset.id, validators=["correctness"])
job   = await client.jobs.get(job.id)
jobs  = await client.jobs.list(project_id, status="running")

Validations

# Trigger validators on a run
result = await client.evaluations.run(run_id, evaluators=["correctness", "hallucination"])
print(result.status, result.total_evaluated)

# Project-wide validation summary
summary = await client.evaluations.summary(project_id, period="7d")
print(summary.avg_score, summary.scores_by_evaluator)

# List validators configured for a project
validators = await client.evaluations.evaluators(project_id)

Note: the API surface uses client.evaluations.* for backwards compatibility. The platform now describes this domain as validations — both terms refer to the same resource.

Analytics

result = await client.analytics.query(
    dimensions=["model_name"],
    measures=["trace_count", "avg_latency_ms"],
    filters=[{"field": "project_id", "op": "eq", "value": project_id}],
)
overview = await client.analytics.overview(project_id, period="7d")
costs    = await client.analytics.costs(project_id, period="30d")
export   = await client.analytics.export("csv", project_id=project_id)

Pagination

List endpoints return a Page[T]:

page = await client.projects.list(limit=20, offset=0)
print(page.total, page.has_more)
for project in page.items:
    ...

Configuration

Parameter Environment variable Description
api_key PALQEE_PRISMA_API_KEY Prisma API key (pq_prisma_sk_...)
workspace_id PALQEE_PRISMA_WORKSPACE_ID Workspace UUID
base_url PALQEE_PRISMA_BASE_URL Base URL of your Prisma deployment
timeout Request timeout in seconds (default 30)
max_retries Retries for transient errors (default 2)

Full reference: docs.palqee.com/docs/overview.

Error handling

All exceptions inherit from PrismaError. Catch the specific class you care about, fall through to the parent:

from palqee_prisma_client import PrismaNotFoundError, PrismaAPIError, PrismaError

try:
    project = await client.projects.get(project_id)
except PrismaNotFoundError:
    ...
except PrismaAPIError as e:
    print(f"API error {e.status_code}: {e.message}")
except PrismaError:
    ...
Exception HTTP status Meaning
PrismaAuthenticationError Invalid or missing API key (client-side)
PrismaAuthorizationError 401, 403 Server rejected 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

When to use this vs palqee-prisma-ai

Need Reach for
Instrument an app once, ship traces and run validators palqee-prisma-ai
Drive Prisma resources directly (projects, runs, jobs, datasets) palqee-prisma-client (this package)
Both Install both — the SDK uses this client under the hood

Links

License

Apache 2.0 © Palqee Ltd.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palqee_prisma_client-0.4.2.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palqee_prisma_client-0.4.2-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file palqee_prisma_client-0.4.2.tar.gz.

File metadata

  • Download URL: palqee_prisma_client-0.4.2.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for palqee_prisma_client-0.4.2.tar.gz
Algorithm Hash digest
SHA256 b173daf6375d77c6cabca64915446109d4b170f31cf8d8dcd0907e83943e206b
MD5 dc89de1d5bb5926436b78c5342037747
BLAKE2b-256 69e78efabb6ebd2d69eed0355162e209107d18a0c114719e305059e2027fbfd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for palqee_prisma_client-0.4.2.tar.gz:

Publisher: publish.yml on Palqee/prisma-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file palqee_prisma_client-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for palqee_prisma_client-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 548cd3384246157197f04af9c32f4916636e648076581a736c3f07a5ab046a7e
MD5 832b7501fa24dc4937840614a075df78
BLAKE2b-256 42ca45dee91a056592a5a6296b0d9933681752f978875ae53bc8536ed74e9658

See more details on using hashes here.

Provenance

The following attestation bundles were made for palqee_prisma_client-0.4.2-py3-none-any.whl:

Publisher: publish.yml on Palqee/prisma-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page