dograh-sdk
Typed builder for Dograh voice-AI workflows. Fetches the node-spec catalog from
the Dograh backend at session start, validates every call against it at the
call site, and produces ReactFlowDTO-compatible JSON.
Install
pip install dograh-sdk
For local development against a checked-out monorepo:
pip install -e sdk/python/
Usage
from dograh_sdk import DograhClient, Workflow
with DograhClient(base_url="http://localhost:8000", api_key="...") as client:
wf = Workflow(client=client, name="loan_qualification")
start = wf.add(
type="startCall",
name="greeting",
prompt="You are Sarah from Acme Loans. Greet the caller warmly.",
greeting_type="text",
greeting="Hi {{first_name}}, this is Sarah.",
)
qualify = wf.add(
type="agentNode",
name="qualify",
prompt="Ask about loan amount and timeline.",
)
done = wf.add(type="endCall", name="done", prompt="Thank the caller.")
wf.edge(start, qualify, label="interested", condition="Caller expressed interest.")
wf.edge(qualify, done, label="done", condition="Qualification complete.")
client.save_workflow(workflow_id=123, workflow=wf)
What gets validated at the call site
The SDK fetches the spec for each node type via get_node_type and raises
ValidationError immediately when:
- an unknown field is passed (catches typos)
- a required field is missing or empty
- a scalar type is wrong (e.g., string for a boolean)
- an
optionsvalue isn't in the allowed list
When a spec carries an llm_hint, the hint is appended to the error message so
an LLM agent can self-correct on retry:
tool_uuids: expected tool_refs, got str
Hint: List of tool UUIDs from `list_tools`.
Server-side Pydantic validators run on save and surface anything the SDK lets through (compound invariants, cross-field rules).
Environment
DOGRAH_API_URL=http://localhost:8000 # default
DOGRAH_API_KEY=sk-... # sent as X-API-Key
License
BSD 2-Clause — see LICENSE.
Metadata
Release files for dograh-sdk 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dograh_sdk-0.1.8.tar.gz | 24.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dograh_sdk-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.6 kB
Release files / dograh_sdk-0.1.8.tar.gz
| Download URL | dograh_sdk-0.1.8.tar.gz |
|---|---|
| Size | 24.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db9ab659301a177c2487a04f2a5c4b7bfdc3ae221b8e716f586dbadfea195998
|
|
BLAKE2b-256 checksum How to use checksums |
6a8deb6f9e7882d7de5bcdabcfc1f10207ae6a8e7a6fbf6fe58243bcca9f8375
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / dograh_sdk-0.1.8-py3-none-any.whl
| Download URL | dograh_sdk-0.1.8-py3-none-any.whl |
|---|---|
| Size | 34.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7781fbd6df933461af8866af255090506ab5f3744401ac505459738d3b30adf
|
|
BLAKE2b-256 checksum How to use checksums |
bf7488edc3664491286688640db0845ec5823f0f871b32c1d6b3414949ee4c76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|