Skip to content

Add Krisp VIVA Turn as a user turn-stop strategy#178

Draft
weiz9 wants to merge 1 commit into
mainfrom
pr/wz/krisp-viva-turn
Draft

Add Krisp VIVA Turn as a user turn-stop strategy#178
weiz9 wants to merge 1 commit into
mainfrom
pr/wz/krisp-viva-turn

Conversation

@weiz9

@weiz9 weiz9 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Krisp VIVA Turn (pipecat's KrispVivaTurn, VIVA SDK turn detection v3 / Tt API) as a selectable turn_stop_strategy in the cascade pipeline, alongside the existing LocalSmartTurnAnalyzerV3. Unlike Smart Turn (which analyzes audio in batches when VAD detects a pause), KrispVivaTurn processes audio frame-by-frame in real time using an external VAD flag.

Changes

  • turn_config.py — new krisp_viva_turn branch in create_turn_stop_strategy(). Forwards threshold / frame_duration_ms to KrispTurnParams and model_path / api_key / sample_rate to the KrispVivaTurn constructor (all fall back to env vars). The pipecat module is imported lazily because it hard-requires the proprietary krisp_audio SDK — environments without it are unaffected until the strategy is selected.
  • config.py + .env.example — document the new strategy and required env vars (KRISP_VIVA_TURN_MODEL_PATH, KRISP_VIVA_API_KEY).
  • test_turn_config.py — 4 new tests covering the branch (happy path, case-insensitivity, tuning-param routing, constructor-param routing) via an injected fake krisp module.
  • Bumped simulation_version 2.0.1 -> 2.0.2 (affects benchmark outputs).

Usage

Requires the Krisp SDK + model + license provisioned at runtime (not a PyPI dep, so intentionally not added to pyproject.toml):

```bash
pip install krisp_audio # per Krisp's install guide
export KRISP_VIVA_TURN_MODEL_PATH=/path/to/turn.kef KRISP_VIVA_API_KEY=...
eva --domain airline --model.llm gpt-5-mini --model.turn-stop-strategy krisp_viva_turn
```

Testing

  • 27/27 test_turn_config.py unit tests pass; ruff + version-bump checks pass; no new mypy errors.
  • Layered live smoke test confirmed: (1) the real factory branch reaches pipecat and fails with a clean, actionable error when the SDK is absent; (2) with the SDK simulated, it constructs a real TurnAnalyzerUserTurnStopStrategy with correct param routing; (3) RunConfig validates krisp_viva_turn end-to-end.

Draft: pending a live end-to-end run with a real Krisp API key + .kef model.

Wire pipecat's KrispVivaTurn (VIVA SDK turn detection v3) into the cascade
pipeline as a selectable turn_stop_strategy alongside the existing
LocalSmartTurnAnalyzerV3. The analyzer is imported lazily because it depends
on the proprietary krisp_audio SDK plus a .kef model and license key, so
environments without the SDK are unaffected until the strategy is selected.

- turn_config: add 'krisp_viva_turn' branch forwarding threshold/
  frame_duration_ms to KrispTurnParams and model_path/api_key/sample_rate
  to the KrispVivaTurn constructor (both fall back to env vars)
- config + .env.example: document the strategy and required env vars
  (KRISP_VIVA_TURN_MODEL_PATH, KRISP_VIVA_API_KEY)
- tests: cover the new branch via an injected fake krisp module
- bump simulation_version 2.0.1 -> 2.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant