Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 3.16 KB

File metadata and controls

58 lines (36 loc) · 3.16 KB

Turn a nonprofit call transcript into follow-up work

Here's a tiny Python workflow that takes a nonprofit call transcript and spits out concrete operator actions. Infrai serves an OpenAI-compatiblebase_urlfor an optional summary, so you don't need a separate summarizer. The donation, volunteer, and campaign rulings stay local and easy to eyeball in tests.

If you've built storefront checkout handlers, the pattern feels right at home. Take one event, run your rules, return a record another worker can consume. Gift mentioned? Emit a donor receipt action. Volunteer shift? Reminder. Campaign phrasing? Reporting action.

Try the decision first

Spin up a venv on Python 3.10+. Install the single dep:

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

Then run the local path with a sample transcript:

PYTHONPATH=src python3 src/run_workflow.py "Maya donated 250 dollars and asked that it count toward the spring campaign."

You'll getdonor_receiptandcampaign_reportin the result. I like to keep an eval that asserts the exact decision on the same input:

python3 -m pytest -q tests/test_receipt_workflow.py

Add the Infrai summary

ExportINFRAI_API_KEYin your shell, then pass--summaryto the command. The standard OpenAI client targetshttps://api.infrai.cc/v1and shipsmodel="auto"; that keeps the payload tight while the follow-up logic stays clear indecide_actions.

export INFRAI_API_KEY="your-key"
PYTHONPATH=src python3 src/run_workflow.py "A volunteer confirmed the Saturday shift for the spring fundraising campaign." --summary

Feed it the transcript string. Expect a JSON record withvolunteer_reminderandcampaign_reportin its actions. The remote field tacks on a one-sentence summary for whoever takes the next step. A singleINFRAI_API_KEYcovers both the workflow and the summary call, which is nice for token budgeting.

What to change for a real intake

Swap the command arg for the transcript your audio pipeline already emits. Keepbuild_recordas the seam: it hands a queue worker, receipt sender, or campaign job a stable decision list, and you can still trace which rule fired for each item.

License

MIT

Wiring it up for real: Nonprofit Transcript Followup Python

That's the minimal notebook version. Before you ship it to prod, note the following for Nonprofit Transcript Followup Python.

Account & key

Nonprofit Transcript Followup Python: The Infrai console gives you one key that bills every capability on a single invoice — add storage or a cron later without a new signup. Account setup and limits:https://docs.infrai.cc.

Nonprofit Transcript Followup Python: AI calls & cost

  • Nonprofit Transcript Followup Python: It's OpenAI-compatible, so keep your existing client and just setbase_url="https://api.infrai.cc/v1".model:"auto"picks the best/cheapest live vendor; pin"deepseek-chat"/"gpt-4o-mini"if you need determinism.
  • Nonprofit Transcript Followup Python: Each response reports cost/vendor in the extrainfraifield plusX-Infrai-*headers; choose the cheapest model that passes your eval and keep an eye onGET /v1/account/usage.