feat(didi): BigQuery fixes, ElevenLabs provider, no-call blocklist, agent prompts, full template seeding - #21
Open
DZDasherKTB wants to merge 8 commits into
Conversation
- ElevenLabs integration with campaign-level provider switch (Vocallabs/ElevenLabs) - ElevenLabsSettings singleton doctype for credentials and per-language agents - VoiceCallBlocklist doctype - blocks numbers at call time with audit trail - bigquery_sync: scope fix (readonly to full), sp_assigment_id casing fix, filter @results noise - hooks.py: Mon-Sat BigQuery sync schedule
Full situation-based prompts for English, Hindi, Marathi, Punjabi. Each has 8 nudge type branches, context quality filtering, grade group handling, call attempt handling, and all guardrails. Ready to paste into Vocallabs dashboard pending Manu approval.
…edup, recording fields
…venLabsSettings, BigQuerySettings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! Here are all the changes since PR #20 got merged.
BigQuery Sync Fixes
Fixed the field name casing for sp_assigment_id which was causing last_assignment_name to come back null for every student. Added filtering for @results template garbage and reset values that Glific writes when a flow does not complete. Fixed the BigQuery scope from readonly to full since running a query job needs more than just read access.
ElevenLabs Provider
Added ElevenLabs as a second voice call provider alongside Vocallabs. Campaigns now have a provider dropdown and the background worker routes automatically. ElevenLabs uses a single API call with dynamic variables injected directly which is simpler than the Vocallabs two step flow. Added ElevenLabsSettings singleton doctype for credentials and per language agent mapping, same pattern as BigQuerySettings.
No-call Blocklist
Added a VoiceCallBlocklist doctype where admin can add phone numbers that should never be called. The check happens at call initiation time for both providers, not just at queue generation. Also added cross-campaign daily deduplication so if a student was already called today by any campaign, subsequent campaigns skip them automatically. Both checks write an audit trail to VoiceCallHistory.
Recording Pull
Added fetch_recordings() on VoiceCallCampaign that pulls recording URLs from the provider after a campaign completes and stores them on each VoiceCallHistory row. Added vocallabs_call_id, recording_url, and duration_seconds fields to VoiceCallHistory.
Agent Prompts
Wrote full updated Vocallabs agent prompts for all four languages stored in docs/agent_prompts/. All four have situation based branching for all 8 nudge types, context quality filtering so the agent ignores emoji and button tap noise from Glific, grade group handling for younger vs older students, and call attempt handling for follow up calls. Waiting on approval before pushing to the Vocallabs dashboard.
Full Template Seeding
seed_language_templates.py was previously a stub. Replaced with full seeding logic that automatically creates all 24 ParentCallConfig records for English, Marathi and Punjabi across all 8 nudge types on bench migrate, and links all 4 languages in the VoiceNudgeLanguageTemplate child table on each VoiceNudgeConfig. Safe to run on servers already set up manually as it skips existing records.