feat(nodes): add audio_transcribe_live source node for live microphone STT#979
feat(nodes): add audio_transcribe_live source node for live microphone STT#979ali-amjad52114 wants to merge 1 commit into
Conversation
…e STT Captures microphone audio and emits rolling partial transcription on the text lane using local faster-whisper, enabling chainable live STT pipelines. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughThis PR introduces a complete live speech-to-text transcription node using Whisper and microphone audio capture. It includes an audio streaming engine with buffering and incremental text emission, a global Whisper model manager, endpoint orchestration for pipeline integration, configuration schema, dependencies, and example usage. ChangesLive Speech-to-Text Node Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No description provided. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nodes/src/nodes/audio_transcribe_live/IGlobal.py`:
- Around line 122-123: The f-string constructing the debug message for "Live
transcribe" uses double quotes inside the config.get calls; update the
expressions in that f-string so the config keys use single quotes (e.g., change
config.get("chunk_interval", 1.5) and config.get("window_seconds", 4) to use
single-quoted keys) in the Live transcribe message construction found in
IGlobal.py so it adheres to the project's single-quote convention.
In `@nodes/src/nodes/audio_transcribe_live/IInstance.py`:
- Around line 27-28: Add a one-line PEP 257 docstring to the stub class
IInstance describing its purpose (e.g., 'Interface for live audio transcription
instance.') using single quotes and a triple-quoted string directly under the
class declaration; ensure the docstring is concise, follows PEP 257 style, and
that the file is formatted/linted (ruff) for Python 3.10+ after the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: bbe5752c-50da-4cda-a6fa-d24685f48bcf
📒 Files selected for processing (9)
docs/README-nodes.mdnodes/src/nodes/audio_transcribe_live/IEndpoint.pynodes/src/nodes/audio_transcribe_live/IGlobal.pynodes/src/nodes/audio_transcribe_live/IInstance.pynodes/src/nodes/audio_transcribe_live/__init__.pynodes/src/nodes/audio_transcribe_live/live_transcribe.pynodes/src/nodes/audio_transcribe_live/requirements.txtnodes/src/nodes/audio_transcribe_live/services.jsonpipelines/live_stt_to_text.pipe
| f' Live transcribe: model={model_name}, language={language}, ' | ||
| f'interval={config.get("chunk_interval", 1.5)}s, window={config.get("window_seconds", 4)}s' |
There was a problem hiding this comment.
Use single quotes for the config.get(...) keys in this debug message.
This currently mixes in double-quoted regular string literals and will violate the node Python quote convention.
Proposed fix
debug(
f' Live transcribe: model={model_name}, language={language}, '
- f'interval={config.get("chunk_interval", 1.5)}s, window={config.get("window_seconds", 4)}s'
+ f'interval={config.get('chunk_interval', 1.5)}s, window={config.get('window_seconds', 4)}s'
)As per coding guidelines, nodes/**/*.py: use single quotes, ruff for linting/formatting, PEP 257 docstrings, target Python 3.10+.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| f' Live transcribe: model={model_name}, language={language}, ' | |
| f'interval={config.get("chunk_interval", 1.5)}s, window={config.get("window_seconds", 4)}s' | |
| debug( | |
| f' Live transcribe: model={model_name}, language={language}, ' | |
| f'interval={config.get(\'chunk_interval\', 1.5)}s, window={config.get(\'window_seconds\', 4)}s' | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@nodes/src/nodes/audio_transcribe_live/IGlobal.py` around lines 122 - 123, The
f-string constructing the debug message for "Live transcribe" uses double quotes
inside the config.get calls; update the expressions in that f-string so the
config keys use single quotes (e.g., change config.get("chunk_interval", 1.5)
and config.get("window_seconds", 4) to use single-quoted keys) in the Live
transcribe message construction found in IGlobal.py so it adheres to the
project's single-quote convention.
| class IInstance(IInstanceBase): | ||
| pass |
There was a problem hiding this comment.
Add a short class docstring for the stub IInstance.
The stub is fine, but this class is currently undocumented in a nodes/**/*.py module.
Proposed fix
class IInstance(IInstanceBase):
+ """Node-local instance stub required by the pipeline framework."""
passAs per coding guidelines, nodes/**/*.py: use single quotes, ruff for linting/formatting, PEP 257 docstrings, target Python 3.10+.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| class IInstance(IInstanceBase): | |
| pass | |
| class IInstance(IInstanceBase): | |
| """Node-local instance stub required by the pipeline framework.""" | |
| pass |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@nodes/src/nodes/audio_transcribe_live/IInstance.py` around lines 27 - 28, Add
a one-line PEP 257 docstring to the stub class IInstance describing its purpose
(e.g., 'Interface for live audio transcription instance.') using single quotes
and a triple-quoted string directly under the class declaration; ensure the
docstring is concise, follows PEP 257 style, and that the file is
formatted/linted (ruff) for Python 3.10+ after the change.
Summary
audio_transcribe_livesource node that captures microphone audio and emits rolling partial transcription on thetextlane using local faster-whisperpipelines/live_stt_to_text.pipe) chaining live STT toresponse_textdocs/README-nodes.mdTest plan
pipelines/live_stt_to_text.pipeor a custom pipeline withaudio_transcribe_liveas sourcetextlaneresponse_text) receive transcribed outputSummary by CodeRabbit
Release Notes
New Features
Documentation