Skip to content

kiranfwai/fwai_codex_ai_call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FWAI Codex AI Call

Production-ready AI call agent service that integrates n8n -> application -> Plivo -> user. It supports configurable, per-client question flows, low-latency scripted prompts, and end-of-call summaries.

Features

  • Config-driven question flow per client
  • Preloaded greeting and scripted prompts
  • Optional short acknowledgements before questions (configurable)
  • Plivo call control with speech input
  • Objection handling and interest scoring
  • End-of-call summary + transcript delivery to n8n
  • Optional per-turn transcript webhook to n8n
  • Gemini audio generation for all prompts (no Plivo TTS)
  • Optional Gemini live streaming mode (barge-in)
  • Minimal logging at key integration points

Quick start

  1. python -m venv .venv
  2. source .venv/bin/activate
  3. pip install -r requirements.txt
  4. cp .env.example .env
  5. edit .env
  6. uvicorn app.main:app --host 0.0.0.0 --port 8000

n8n flow

  • Import workflows from n8n_flows/
  • Start call webhook: /webhook/fwai_start_call
  • End webhook: /webhook/fwai_call_end
  • Turn webhook (optional): /webhook/fwai_call_turn
  • Webhook URLs can be set per-client in the client config (preferred), or in .env as defaults.

Plivo setup

  • Set PUBLIC_BASE_URL in .env to your public HTTPS URL (e.g., ngrok).
  • The app uses PUBLIC_BASE_URL for Plivo callbacks.
  • Supported callback paths: /plivo/callback and /plivo/hangup.

Gemini audio modes

  • AUDIO_MODE=gemini: pre-generated Gemini audio played with <Play> (no latency during call).
  • AUDIO_MODE=gemini-live: Gemini Live streaming over WebSocket with barge-in.
  • AUDIO_STRICT=true ensures all prompt audio is generated before the call starts (zero latency during call).
  • USE_GEMINI_AUDIO_CACHE=true and PREWARM_ON_STARTUP=true are recommended for low latency.

Acknowledgements (optional)

  • Set ack_enabled=true and add acknowledgements / ack_rules in the client config.
  • The agent will say a short acknowledgement before the next question while staying in the scripted flow.
  • In strict audio mode, acknowledgement + question combinations are pre-generated for zero latency.

Notes

  • API keys are loaded via environment variables only. Do not commit secrets.
  • For ultra-low latency, keep prompts scripted and preloaded in config.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages