Add Krisp VIVA Turn as a user turn-stop strategy#178
Draft
weiz9 wants to merge 1 commit into
Draft
Conversation
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
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.
Summary
Adds Krisp VIVA Turn (pipecat's
KrispVivaTurn, VIVA SDK turn detection v3 / Tt API) as a selectableturn_stop_strategyin the cascade pipeline, alongside the existingLocalSmartTurnAnalyzerV3. 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— newkrisp_viva_turnbranch increate_turn_stop_strategy(). Forwardsthreshold/frame_duration_mstoKrispTurnParamsandmodel_path/api_key/sample_rateto theKrispVivaTurnconstructor (all fall back to env vars). The pipecat module is imported lazily because it hard-requires the proprietarykrisp_audioSDK — 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.simulation_version2.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
test_turn_config.pyunit tests pass; ruff + version-bump checks pass; no new mypy errors.TurnAnalyzerUserTurnStopStrategywith correct param routing; (3)RunConfigvalidateskrisp_viva_turnend-to-end.Draft: pending a live end-to-end run with a real Krisp API key +
.kefmodel.