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

MIT © Palqee

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.1.tar.gz (38.6 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.1-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: palqee_prisma_client-0.4.1.tar.gz
  • Upload date:
  • Size: 38.6 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.1.tar.gz
Algorithm Hash digest
SHA256 507aae174190f56aac32cd39c4dd0e905b55d7fa6a1774fdb04d66f919c0237f
MD5 275745f31638e876b83d569fc69a1ca2
BLAKE2b-256 7d69998bbe358b01d6bab92323f6e8a118025153d105a7078501e473dd3b6199

See more details on using hashes here.

Provenance

The following attestation bundles were made for palqee_prisma_client-0.4.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for palqee_prisma_client-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38b59a0234f6c2b77f2564bf7c70c7ece81a40dfc5c06a656c83ad2e964830b8
MD5 050b1c2c871504e39cfb3fd77651d206
BLAKE2b-256 0dbc12940d54c226b8ebc0a7958a8230dd6b03327812de00f2f58031b63b2c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for palqee_prisma_client-0.4.1-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