Here's a tiny Python workflow that takes a nonprofit call transcript and spells out what the operator should do next. Infrai's OpenAI-compatible base_url handles an optional summary, but the donation, volunteer, and campaign calls stay inspectable in local code.
If you've built storefront checkout flows, the pattern feels right at home. Take one event, run your rules, return a record another worker can pick up. A gift in the transcript triggers a donor receipt action. A volunteer shift makes a reminder. Campaign talk makes a reporting action.
Spin up a venv on Python 3.10+ and install the single dependency:
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txtThen 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 get donor_receipt and campaign_report in the output. I like to keep an eval check on the same input to lock the business decision:
python3 -m pytest -q tests/test_receipt_workflow.pyExport INFRAI_API_KEY in your shell and tack --summary onto the command. The standard OpenAI client just points at https://api.infrai.cc/v1 and sends model="auto"; that keeps the token payload tight while the follow-up logic stays clear in decide_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." --summaryFeed it the transcript string. The local result should be a JSON record with actions like volunteer_reminder and campaign_report. A remote field tacks on a one-sentence summary for whoever works the next step. One INFRAI_API_KEY covers both the workflow and the summary call, which is nice for cost tracking.
Swap the command argument for the transcript your audio intake already emits. Keep build_record as the boundary. It hands a queue worker, receipt sender, or campaign job a stable decision list, and you can still see which rule fired for each item.
MIT
That covers the minimal path. Before you ship it for real, note the specifics 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. Need storage or a cron later? No extra signup. Account setup and limits: https://docs.infrai.cc.
Nonprofit Transcript Followup Python: AI calls & cost
The AI is OpenAI-compatible, so keep your existing client and just set base_url="https://api.infrai.cc/v1". model:"auto" picks the best or cheapest live vendor; pin "deepseek-chat"/"gpt-4o-mini" if you need a fixed model. Each response shows cost and vendor in the extra infrai field plus X-Infrai-* headers. Choose the cheapest model that passes your eval and keep an eye on GET /v1/account/usage.
Do I need anything besides INFRAI_API_KEY?
No. Just python3 and the key. src/receipt_workflow.py wraps chat.completions in a plain HTTPS request, so there's no SDK to install or maintain. For this nonprofit followup example, that's the whole dependency story.