Skip to main content

Polarity SDK (Python). Install alias for polarity-keystone — same package, new name.

Project description

polarity-sdk

Python SDK for Polarity — agent evaluation, sandboxed execution, and LLM observability.

This is the canonical install name. It's a thin alias that pulls in polarity-keystone, which ships the actual code. Both names refer to the same package; use whichever feels right.

Install

pip install polarity-sdk

Quickstart

import polarity as plr
from openai import OpenAI

client = plr.wrap(OpenAI())

@plr.traced("workflow")
def run(prompt: str):
    return client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}],
    )

run("hello world")

Traces appear at https://app.polarity.so.

Configuration

Env var Purpose
POLARITY_API_KEY Required. Get one at https://app.polarity.so
POLARITY_BASE_URL Optional. Defaults to https://api.plr.sh

Legacy KEYSTONE_* env vars continue to work indefinitely.

More

Full docs at https://docs.polarity.so.

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

polarity_sdk-0.3.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

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

polarity_sdk-0.3.1-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file polarity_sdk-0.3.1.tar.gz.

File metadata

  • Download URL: polarity_sdk-0.3.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for polarity_sdk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2f1d6c99931edc0b5ce3029850bd3ccb4861664e6e606fa2f4bdf5a9dffcc146
MD5 21f5de18e1f05eabb7f1f16eb7316871
BLAKE2b-256 2d9d8e56e5fbde81b6c75fc6ba90a34dcad2e523f49d0cdfb856ba8bd682d73e

See more details on using hashes here.

File details

Details for the file polarity_sdk-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: polarity_sdk-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for polarity_sdk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d0ce05e0f18830b54b05e9769c79bfd902f3e213775b7108dd58a70f91055c2
MD5 df380b2af31286e931a8bdad4cb819a0
BLAKE2b-256 d816d5da5f59c4f12462b489686cbbef055e18538229a2dcf4a7204b71ea5f4a

See more details on using hashes here.

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