Skip to main content

Open agent handoff protocol and verification infrastructure.

Project description

ChainThread Python SDK

Open agent handoff protocol and verification infrastructure.

Install

pip install chainthread

Quick Start

from chainthread import ChainThread

ct = ChainThread()

# Create a chain
chain = ct.create_chain(
    name="my-agent-pipeline",
    description="Research to writer handoff"
)

# Send a handoff envelope
envelope = ct.send_envelope(
    chain_id=chain["chain_id"],
    sender_id="research-agent",
    sender_role="researcher",
    receiver_id="writer-agent",
    receiver_role="writer",
    payload={"summary": "AI is transforming software.", "confidence": 0.95},
    summary="Research complete, handing off to writer",
    provenance=[{"field": "summary", "source": "model_generated", "confidence": 0.95}],
    contract={
        "required_fields": ["summary", "confidence"],
        "assertions": [{"field": "confidence", "type": "range", "value": {"min": 0.0, "max": 1.0}}],
        "on_fail": "block"
    }
)

print(envelope["contract_passed"])
print(ct.stats())

Links

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

chainthread-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

chainthread-0.3.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file chainthread-0.3.0.tar.gz.

File metadata

  • Download URL: chainthread-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chainthread-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8f7e48d15fa864d77bf9d7ca91887f6566c83aa422852b1efeef2494f344d2e0
MD5 6bb2e9ec2bbbae0bdac11ddaa0908094
BLAKE2b-256 7417958877c7542a08904aec2fbcbb9808196c9f4767efd91add4b509d09a9f1

See more details on using hashes here.

File details

Details for the file chainthread-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: chainthread-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chainthread-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a84b32d7eacdfbe90e9a4f03a43725b72b51b1217a32e56e947390cec05955a4
MD5 82adb98fc36671d90cb67fdd885c67d6
BLAKE2b-256 11c92626c9eb93a0ca201169c20d975b3feebc5d1cedbc46035db5e3e8c6977e

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