fix(python-sdk): send Parakeet finalize when run() is cancelled
Merged
DA
2mo ago+47+47+01234567890123456789-9-9-0123456789
Fixes #13631.
Cancelling ParakeetTranscriber.run() tore down the WebSocket without sending Parakeet's finalize frame. Remaining transcription results can be dropped. Send finalize on caller cancellation, then let the connection close. Server EOF still returns and does not send finalize. Related: Python Deepgram #13626; Dart/RN/TS Parakeet stop() already send finalize.
Validation
- Reproduced on
origin/maind5cbd548f6with a patchedwebsockets.connectfake: cancellingrun()closed the socket with nofinalizeframe. - After the fix,
pytest tests/test_parakeet_lifecycle.pyis 7 passed. Caller cancel recordsfinalizebefore close; server EOF does not. No live Parakeet, credentials, or audio.
AI-assisted contribution. Bounty eligibility remains a maintainer decision.
Made with Cursor