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.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 sarnai 0.1.0
File Size Uploaded
sarnai-0.1.0.tar.gz 10.1 kB Details

Built distribution (wheel)

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

Total release size: 18.7 kB

Release files / sarnai-0.1.0.tar.gz

Download URL sarnai-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7a7f5a272397884bbc8c03cbd1ed5c838a905dbf6027f5e7b780b7aa5c64dbb6
BLAKE2b-256 checksum
How to use checksums
fa294e8d573a714572c3d6388130acdf28ac79eefae41a0755265283b43827e8
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 10, 2026.

Transparency log

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

Download URL sarnai-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3671c5a9cf8140babd319ac6bd8eff9c7a8b2b589f4a5292d547d95313abc566
BLAKE2b-256 checksum
How to use checksums
c3edd9215f8a29a804ad420eabba3e1744c8a51e743c9776dd0688e7412ed8e8
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

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