Skip to main content

typesafe-decisions

Small, typed building blocks for semantic decisions in Python.

Tests Python 3.11+ Status: Experimental

typesafe-decisions is an experimental convenience layer around TypeSafe System One. It turns semantic judgments into ordinary Python values that an application can use for routing, thresholds, and other decisions.

The project currently contains a DecisionClient for TypeSafe-backed decisions and a small, independent llm() helper for text generation through Cloudflare AI Gateway.

Quick start

Install the current development version from a checkout:

python -m pip install -e .
export TYPESAFE_API_KEY="your-api-key"
from typesafe_decisions import DecisionClient

with DecisionClient() as decisions:
    team = decisions.match(
        "I was charged twice for the same order.",
        "Which team should handle this ticket?",
        {
            "Billing": "Charges, invoices, and payment problems",
            "Returns": "Refunds, exchanges, and damaged items",
        },
    )

print(team)

See the documentation for setup, application examples, concepts, guides, and the API reference.

Development

Create a virtual environment, install the project in editable mode, and run the test suite from the repository root:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[docs]"
python -m unittest
zensical build --clean

The source lives in src/typesafe_decisions, documentation examples live in docs, and tests live in tests.

Metadata

Release files for typesafe-decisions 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typesafe-decisions 0.1.0
File Size Uploaded Provenance Actions
typesafe_decisions-0.1.0.tar.gz 10.5 kB Without provenance Details for typesafe_decisions-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for typesafe-decisions 0.1.0
File Interpreter ABI Platform Actions
typesafe_decisions-0.1.0-py3-none-any.whl Python 3 none any Details for typesafe_decisions-0.1.0-py3-none-any.whl

Total release size: 18.4 kB

Release files / typesafe_decisions-0.1.0.tar.gz

Download URL typesafe_decisions-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e28496b24fd16c5a22cd593f8d4006dcf4ebcdafc7f482b01c63445dde8b7780
BLAKE2b-256 checksum
How to use checksums
237dc5fe79d2d5f8f72f47d4c0be47d40c54882df854b5cb935e71e232ce525b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / typesafe_decisions-0.1.0-py3-none-any.whl

Download URL typesafe_decisions-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f3f2a070eb5942c594f45df54680d833c2b126e7f2b706df3a8a8c697e87a4e
BLAKE2b-256 checksum
How to use checksums
13fe9fe21fb0acebf94129e2509c496a8a96d157cfbef756ae4fc8cd045d6258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for typesafe-decisions 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page