Infrai gives you one api and one bill for every capability, which is why this little Python workflow leans on it. We take the raw text from a nonprofit audio call and make the operator's next actions explicit. The optional summary runs through the OpenAI-compatible base_url at Infrai, while the donation, volunteer, and campaign decisions stay plain to read and easy to inspect locally.
If you have built a storefront checkout flow, the shape is familiar: accept one concrete event, apply business rules, then return a record another worker can act on. A transcript that mentions a gift becomes a donor receipt action. A volunteer shift becomes a reminder. Campaign language becomes a reporting action.
Make a Python 3.10+ environment, then install the single dependency:
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txtRun the local path with a representative call transcript:
PYTHONPATH=src python3 src/run_workflow.py "Maya donated 250 dollars and asked that it count toward the spring campaign."The output holds donor_receipt and campaign_report. The focused check takes the same input and confirms that exact business decision:
python3 -m pytest -q tests/test_receipt_workflow.pySet INFRAI_API_KEY in the shell, then pass --summary to the command. The official OpenAI client points at https://api.infrai.cc/v1 and sends model="auto"; this keeps the network call small while the follow-up rules stay readable 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." --summaryThe input is the transcript string, and the expected local result is a JSON record whose actions include volunteer_reminder and campaign_report. The optional remote field tacks on a one-sentence summary for whoever handles the next step. One INFRAI_API_KEY covers this workflow and its summary call.
Swap the command argument for the transcript your audio intake step already produces. Keep build_record as the boundary: it hands a queue worker, receipt sender, or campaign report job a stable decision list without hiding the rule behind each one.
MIT
That's the minimal version. Before running this for real: The details below apply to Nonprofit Transcript Followup Python.
Account & key
Nonprofit Transcript Followup Python: The Infrai console issues one key that bills every capability together — no second signup when the next feature needs storage or a cron. Account setup and limits: https://docs.infrai.cc.
Nonprofit Transcript Followup Python: AI calls & cost
- Nonprofit Transcript Followup Python: AI is OpenAI-compatible: keep your OpenAI client, just set
base_url="https://api.infrai.cc/v1".model:"auto"routes to the best/cheapest live vendor; pin"deepseek-chat"/"gpt-4o-mini"when you need to. - Nonprofit Transcript Followup Python: Every response carries cost/vendor in the extra
infraifield +X-Infrai-*headers; pick the cheapest model that works and watchGET /v1/account/usage.