Skip to main content

Wauldo Python SDK

PyPI Downloads Python License: MIT

Verified AI answers from your documents. Every response includes source citations, a confidence score and an audit trail — and when your documents don't hold the answer, it says so.

Official Python SDK for the Wauldo API — answers grounded in your documents, with sources, a confidence score and smart model routing.

Why Wauldo?

  • Grounded answers — every answer is checked against your source documents, with citations
  • Smart model routing — auto-selects the cheapest model that meets quality
  • One API, 7+ providers — OpenAI, Anthropic, Google, Qwen, Meta, Mistral, DeepSeek with automatic fallback
  • OpenAI-compatible — swap your base_url, keep your existing code
  • Full audit trail — confidence score, grounded status, model used, latency on every response

Quick Start

from wauldo import HttpClient

client = HttpClient(base_url="https://api.wauldo.com", api_key="YOUR_API_KEY")

reply = client.chat_simple("auto", "What is Python?")
print(reply)

Got your key from RapidAPI? Use the RapidAPI host instead — see RapidAPI.

Installation

pip install wauldo

Requirements: Python 3.9+

Features

Chat Completions

from wauldo import HttpClient, ChatRequest, HttpChatMessage

client = HttpClient(base_url="https://api.wauldo.com", api_key="YOUR_API_KEY")

request = ChatRequest(
    model="auto",
    messages=[
        HttpChatMessage.system("You are a helpful assistant."),
        HttpChatMessage.user("Explain Python decorators"),
    ],
)
response = client.chat(request)
print(response.choices[0].message.content)

RAG — Upload & Query

# Upload a document
upload = client.rag_upload(content="Contract text here...", filename="contract.txt")
print(f"Indexed {upload.chunks_count} chunks")

# Query with verified answer
result = client.rag_query("What are the payment terms?")
print(f"Answer: {result.answer}")
print(f"Confidence: {result.get_confidence():.0%}")
print(f"Grounded: {result.audit.grounded}")
for source in result.sources:
    print(f"  Source ({source.score:.0%}): {source.content[:80]}")

Guard — Fact-Check Any Text

# Verify a response against ground-truth sources
result = client.fact_check(
    text="Returns are accepted within 60 days.",
    source_context="Our return policy: 14 days.",
)
print(result.verdict)  # rejected
print(result.action)   # block

# Optional: score relevance to the original question (decoupled from factuality)
result = client.fact_check(
    text="Rust was first released in 2010 by Mozilla Research.",
    source_context="Rust is a systems language released in 2010 by Mozilla Research.",
    query="What year was Rust released?",
)
print(result.verdict)  # verified
if result.relevance:   # None when relevance could not be computed (see relevance_warning)
    print(result.relevance.verdict)  # relevant | partial | off_topic
    print(result.relevance.score)    # cosine similarity — interpret through verdict, not absolute value

A response can be fully verified against sources and still off-topic for the question asked — the relevance block never influences the factual verdict. Currently only relevance_mode="fast" (embedding cosine) is supported.

Streaming (SSE)

from wauldo import ChatRequest, HttpChatMessage

request = ChatRequest(model="auto", messages=[HttpChatMessage.user("Hello!")])
for chunk in client.chat_stream(request):
    print(chunk, end="", flush=True)

Conversation Helper

conv = client.conversation(system="You are an expert on Python.", model="auto")
reply = conv.say("What are list comprehensions?")
follow_up = conv.say("Give me a nested example")

Error Handling

from wauldo import WauldoError, ServerError, AgentTimeoutError

try:
    response = client.chat(ChatRequest.quick("auto", "Hello"))
except ServerError as e:
    print(f"Server error: {e}")
except AgentTimeoutError:
    print("Request timed out")
except WauldoError as e:
    print(f"SDK error: {e}")

RapidAPI

Keys from the free RapidAPI plan work on the RapidAPI host, not on api.wauldo.com (Enterprise keys):

client = HttpClient(
    base_url="https://smart-rag-api.p.rapidapi.com",
    headers={
        "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
        "X-RapidAPI-Host": "smart-rag-api.p.rapidapi.com",
    },
)

Get your free API key (500 verifications/month): RapidAPI

Contributing

Found a bug? Have a feature request? Open an issue.

License

MIT — see LICENSE

Metadata

Release files for wauldo 0.21.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 wauldo 0.21.1
File Size Uploaded Provenance Actions
wauldo-0.21.1.tar.gz 69.8 kB With provenance Details for wauldo-0.21.1.tar.gz

Built distribution (wheel)

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

Total release size: 130.5 kB

Release files / wauldo-0.21.1.tar.gz

Download URL wauldo-0.21.1.tar.gz
Size 69.8 kB
Tags Source
SHA-256 checksum
How to use checksums
91eac50d9f2ee4c246174ede61aa9a85ac8f7348957534691ba232edc2bbcf5b
BLAKE2b-256 checksum
How to use checksums
6014afb7f933ac0564b59ae24b84e2a2f06fbc3b1e4c6122e97fa5fb84bd3d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 15, 2026.

Transparency log

Release files / wauldo-0.21.1-py3-none-any.whl

Download URL wauldo-0.21.1-py3-none-any.whl
Size 60.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f5598225f07db7c2bb5a3f0d5d10ce852b16bfd929523b24a98993669f82bca
BLAKE2b-256 checksum
How to use checksums
e95161a625dc57a078ba7eed04c0663c15678a8aa24f92d2dfbe88bc6ea7ec35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 15, 2026.

Transparency log

Security for wauldo 0.21.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wauldo-0.21.1.tar.gz

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 Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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