Skip to main content

Histeeria SDK — observe and score your AI agent's judgement. Zero latency, zero dependencies.

Project description

Histeeria — Python SDK

Observe and score your AI agent's judgement. Wrap any LLM call, send the decision, and Histeeria evaluates it asynchronously.

  • Zero latency — every send is async, fire and forget.
  • Zero dependencies — standard library only.
  • Failure silent — if the API is down, your agent keeps running.

Install

pip install histeeria

Quickstart

from histeeria import Histeeria

h = Histeeria(api_key="hst_live_xxxx")  # or set HISTEERIA_API_KEY

response = your_llm_call(messages)

h.observe(
    input=messages,            # what went into the agent
    output=response,           # what came out
    agent_id="agent_001",      # which agent
    session_id="sess_abc",     # conversation/session id
    domain="customer_support", # evaluation context
)

That's it. observe() returns immediately and the decision is delivered in the background.

Configuration

Argument Env var Default
api_key HISTEERIA_API_KEY
base_url HISTEERIA_BASE_URL https://api.histeeria.com
timeout 5.0 seconds
max_queue_size 10000
enabled True
debug False

Advanced usage

h.observe(
    input=messages,
    output=response,
    agent_id="agent_001",
    session_id="sess_abc",
    domain="customer_support",
    input_tokens=1240,
    output_tokens=340,
    metadata={
        "user_id": "usr_123",
        "channel": "web",
        "escalated": False,
        "resolved": True,
        "tags": ["billing", "refund"],
    },
)

Multi-step agents (tracing)

with h.trace(agent_id="agent_001", session_id="sess_abc", domain="general") as trace:
    step1 = your_llm_call(messages)
    trace.step("research", input=messages, output=step1)

    step2 = your_llm_call(step1 + followup)
    trace.step("response", input=step1, output=step2)

    trace.complete(final_output=step2, resolved=True)

A trace emits a single decision containing all steps in its metadata.

Flushing and shutdown

The client flushes automatically at interpreter exit. To flush explicitly (e.g. in short-lived scripts or serverless functions):

h.flush(timeout=3)   # wait up to 3s for pending sends
h.close()            # flush + stop the background sender

You can also use it as a context manager:

with Histeeria(api_key="hst_live_xxxx") as h:
    h.observe(input=messages, output=response)
# flushed on exit

License

Apache-2.0

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

histeeria-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

histeeria-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file histeeria-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for histeeria-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c4aae8e22646bf640c4730a6e0ebb10f39b415a1c5712951e19d8c889a59697
MD5 aae6c2d5e1787654336307d33087f469
BLAKE2b-256 32ce9b8048041033b1c32aa20d92b97c8f91e67ff8b9e804f01e39582f5edf5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for histeeria-0.1.0.tar.gz:

Publisher: release.yml on histeeria/histeeria-sdk

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

File details

Details for the file histeeria-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: histeeria-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for histeeria-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86aa45b6f6d36c496591192543d6d060a37b3ce01cdf43292bc2e0ca65626f9d
MD5 169834d0feb4b904747380518e04d8ef
BLAKE2b-256 56cc7d441648e4da7906e5342c136d25329cc28d21a92ea21d0fc8ea6d076278

See more details on using hashes here.

Provenance

The following attestation bundles were made for histeeria-0.1.0-py3-none-any.whl:

Publisher: release.yml on histeeria/histeeria-sdk

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