Skip to main content

Typed builder for Fora voice-AI workflows

Project description

fora-sdk

Typed builder for Fora voice-AI workflows. Fetches the node-spec catalog from the Fora backend at session start, validates every call against it at the call site, and produces ReactFlowDTO-compatible JSON.

Install

pip install fora-sdk

For local development against a checked-out monorepo:

pip install -e sdk/python/

Usage

from fora_sdk import ForaClient, Workflow

with ForaClient(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

FORA_API_URL=http://localhost:8000   # default (legacy DOGRAH_API_URL also accepted)
FORA_API_KEY=sk-...                  # sent as X-API-Key (legacy DOGRAH_API_KEY also accepted)

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

fora_sdk-0.1.7.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

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

fora_sdk-0.1.7-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file fora_sdk-0.1.7.tar.gz.

File metadata

  • Download URL: fora_sdk-0.1.7.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fora_sdk-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1fd919a4458ab5709f4b58652ffe448bf374e285f34d6b579895a2d1ab3325f3
MD5 9b9432248e32c567cb211fb3f89a19c1
BLAKE2b-256 4b2b788ef798bb9fd87e11e218bec320487fd6d081af4d0228a8a7772bf07e87

See more details on using hashes here.

File details

Details for the file fora_sdk-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: fora_sdk-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fora_sdk-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 455aacfd70aa42acdb2068ee653e724df46d7e65ad57c28b72eb4e95a29357e6
MD5 a741c56651a3479c7f53ce34480152fd
BLAKE2b-256 d2350c0902576db0f54c9c18ed429dcbee77796bd1bae20d466ab0eeca546040

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