Skip to main content

tacet

Official Python client for the Tacet API.

Install

pip install tacet
# or
uv add tacet

Quickstart

from tacet import Tacet, choice, score, noul

client = Tacet(api_key="tacet_sk_...")  # or set TACET_API_KEY

result = client.decide(
    state="Customer says their export has been stuck at 'processing' for two days.",
    questions={
        "routing_team": choice(
            "Which team should own this ticket?",
            {"billing": "Payment or invoicing issues", "support": "Product or account issues"},
        ),
        "urgency": score(
            "How urgent is this ticket?",
            ["low", "medium", "high", "critical"],
        ),
        "needs_human": noul("Does this ticket need a human to step in?"),
    },
)

print(result.answers["routing_team"].choice)
print(result.answers["urgency"].score)
print(result.answers["needs_human"].noul)
print(result.usage.input_tokens)

An AsyncTacet client with the same methods, awaited, is available for async code.

Question types

  • choice: pick one option out of a named set. criteria maps option names to descriptions. The answer carries choice, probabilities (one per option), and confidence.
  • score: an expected level over an ordered list of levels. criteria is that list. The answer carries score, probabilities (one per level index), and confidence.
  • noul: yes or no. noul is the probability of yes, from 0 to 1, and an optional criteria object says what "true" and "false" mean. The answer carries noul and confidence, no probabilities.

The choice, score, and noul helpers build the question dict for you; you can also pass the dict shape directly.

Errors and retries

Every non-2xx response raises a subclass of TacetError, which carries status, code, error_type, param, request_id, and message:

  • AuthenticationError: 401 (missing, invalid, or revoked API key)
  • InsufficientCreditError: 402 (out of credit)
  • RateLimitError: 429, also carries retry_after seconds
  • InvalidRequestError: 400/404/413 (bad request, unknown model, state too large, etc.)
  • APIError: 5xx
  • APIConnectionError: the request failed before a response came back

The client retries 429s (honoring the Retry-After header) and 500/502/503/504 responses and connection failures, with exponential backoff and jitter, up to max_retries times (default 2). Other 4xx errors fail immediately and are never retried.

Idle starts

If the API hasn't been called in a while, the first request after that idle period can take tens of seconds while it starts back up. The default timeout (90 seconds) accounts for this; don't lower it unless you know your traffic is steady.

Pricing

$0.042 per 1M input tokens, and output is free. Details are in the API docs.

Release files for tacet 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 tacet 0.1.0
File Size Uploaded
tacet-0.1.0.tar.gz 22.2 kB Details

Built distribution (wheel)

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

Total release size: 33.7 kB

Release files / tacet-0.1.0.tar.gz

Download URL tacet-0.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
36acaa074892b3ed994c95dd073f75ca814b43b22c23277512c59bac38442f43
BLAKE2b-256 checksum
How to use checksums
475d04fcb29cf45a0cc2f2bf8fc3a43bc2cb82b6dcedf3f4b8a56234f51a0019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL tacet-0.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c5440f1dc7ac58ebba3b54df57b2d0b41357b034cf5ee34b37df708fa6cfef2
BLAKE2b-256 checksum
How to use checksums
ad7e4ceaf7c9201cf73d422233627314cb3b6160f100d96563bbe55e717d26dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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