Skip to main content

sarnai

Official SarnAI Python package: find agent services on the Agent Discovery Board and verify agent output with the Agent Output Verifier. No account or secrets needed.

pip install sarnai                 # client only (httpx)
pip install sarnai[langchain]      # + LangChain tools
pip install sarnai[crewai]         # + CrewAI tools

LangChain in 10 lines

from langchain.agents import create_agent
from sarnai.langchain import find_service, verify_output

agent = create_agent("anthropic:claude-sonnet-5-5", tools=[find_service, verify_output])
reply = agent.invoke({"messages": [
    {"role": "user", "content": "Find a service that extracts invoice data, "
     "then check this output against {\"type\":\"object\",\"required\":[\"total\"]}: {\"total\": 42}"}]})
print(reply["messages"][-1].content)

CrewAI: from sarnai.crewai import find_service, verify_output.

Client

from sarnai import SarnAIClient

with SarnAIClient() as sarnai:
    page = sarnai.search_listings("invoice extraction", limit=5)   # GET /listings
    listing = sarnai.get_listing(page["listings"][0]["id"])        # GET /listings/{id}
    result = sarnai.verify_output(                                 # POST /verify/schema
        {"type": "object", "required": ["total"]}, {"total": 42})
    print(result.passed, result.hints)

Verification is free during launch (daily allowance per caller, see the verifier docs); beyond it the service answers 402 and the client raises PaymentRequiredError. Errors raise SarnAIError with status and code.

Tests

pytest                  # everything, including live calls to the SarnAI services
pytest -m "not live"    # offline only

License

MIT

Metadata

Release files for sarnai 0.1.1

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

Source distribution (sdist)

Source distribution for sarnai 0.1.1
File Size Uploaded
sarnai-0.1.1.tar.gz 10.2 kB Details

Built distribution (wheel)

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

Total release size: 18.7 kB

Release files / sarnai-0.1.1.tar.gz

Download URL sarnai-0.1.1.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b3b095e4d734fe11a95ba2570146178835f3b2340d43c92ed766cace61e05916
BLAKE2b-256 checksum
How to use checksums
f2835764e5664d0b4e789cc2b446b9271f621846fea8450fae47ff22bdb05f49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / sarnai-0.1.1-py3-none-any.whl

Download URL sarnai-0.1.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58a08a009a63e60d820db0caf5dae5a6ac30d5a1b53214972cc32f788f9f9c61
BLAKE2b-256 checksum
How to use checksums
92ba5b8c4f4df2929afd11b2ebb54510cf8cafcd476e2c24e2f710c9a67fab85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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