Official Python SDK for Wauldo — Verified AI answers from your documents
Project description
Wauldo Python SDK
Verified AI answers from your documents. Every response includes source citations, confidence scores, and an audit trail — or we don't answer at all.
Official Python SDK for the Wauldo API — the AI inference layer with smart model routing and zero hallucinations.
Why Wauldo?
- Zero hallucinations — every answer is verified against source documents
- Smart model routing — auto-selects the cheapest model that meets quality (save 40-80% on AI costs)
- 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)
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]}")
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
client = HttpClient(
base_url="https://api.wauldo.com",
headers={
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "smart-rag-api.p.rapidapi.com",
},
)
Get your free API key (300 req/month): RapidAPI
Links
Contributing
Found a bug? Have a feature request? Open an issue.
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wauldo-0.1.1.tar.gz.
File metadata
- Download URL: wauldo-0.1.1.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf49fb370a2dde6b2019de43fa6e57e5506b34b0303c4fe050c691f667d805ef
|
|
| MD5 |
5796aff0727829773afa09139b88dd28
|
|
| BLAKE2b-256 |
9f38e28bd1cd9210a41f5d34b31ade0709ede9422239af6316af650af385ac74
|
File details
Details for the file wauldo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wauldo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07cf6ea3b3c3cf7bd370fe5c67b7645a79c8e9e75c12140906d51e1666953c09
|
|
| MD5 |
7af235532e7c1c71d43de0fab96d3a07
|
|
| BLAKE2b-256 |
7febdefc66705240770a389a5f6306e85875f887a194e084e4be35045078925d
|