Skip to main content

Typed builder for Dograh voice-AI workflows

Project description

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 options value 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dograh_sdk-0.1.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dograh_sdk-0.1.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file dograh_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: dograh_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dograh_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d74422791ffa083a3089132d1639c5df8e20c797386da3be85461e3f58d07a6
MD5 4b822e1d00d5087c5ea5117c1f51f8a0
BLAKE2b-256 150f7f051c669221ed5dd45f1b32dfb85a834ce4684d0a691f9345d93b74292c

See more details on using hashes here.

File details

Details for the file dograh_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dograh_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dograh_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66d81f5640d33df8b80dfc5bfcc68c8ebafb77c0e333e8d70d5e32437ae80bfa
MD5 785b431d2d6b7469fc39933b3a09fd49
BLAKE2b-256 02f6c7ded50db79a2f250cf17c3f44ae96edc250415803512794077afce9c1e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page