feat: add FunASR transcription component - #14225
Conversation
WalkthroughAdds a self-hosted FunASR speech-to-text component with secure local audio handling, validated endpoints, multipart requests, lazy exports, package extras, migration metadata, and tests. ChangesFunASR transcription
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant FunASRTranscriptionComponent
participant LocalAudioFile
participant FunASREndpoint
FunASRTranscriptionComponent->>LocalAudioFile: securely open and read audio
FunASRTranscriptionComponent->>FunASREndpoint: multipart POST to /audio/transcriptions
FunASREndpoint-->>FunASRTranscriptionComponent: JSON response with text
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 9✅ Passed checks (9 passed)
✨ 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 |
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 `@src/bundles/lfx-bundles/src/lfx_bundles/funasr/funasr_transcription.py`:
- Around line 104-136: The _open_audio_file method must open the
already-validated resolved_path rather than requested_path, and avoid
re-resolving the raw input for the post-open comparison. Use resolved_path for
the open/stat flow so the opened file remains within the validated scope, while
preserving the existing access checks and same-file validation.
In `@src/lfx/src/lfx/extension/migration/migration_table.json`:
- Around line 4913-4918: Extend the migration table entries for
FunASRTranscriptionComponent to include import-path mappings for both
lfx_bundles.funasr.funasr_transcription.FunASRTranscriptionComponent and
lfx_bundles.funasr.FunASRTranscriptionComponent, preserving the same target and
added_in values as the existing bare_class_name mapping.
🪄 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: CHILL
Plan: Pro Plus
Run ID: a3584d42-dd42-4c02-9e1e-c0ad0622f256
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
src/bundles/lfx-bundles/pyproject.tomlsrc/bundles/lfx-bundles/src/lfx_bundles/funasr/__init__.pysrc/bundles/lfx-bundles/src/lfx_bundles/funasr/funasr_transcription.pysrc/bundles/lfx-bundles/tests/test_funasr_transcription.pysrc/lfx/src/lfx/extension/migration/migration_table.json
5f4b5f3 to
036ecbd
Compare
|
Refreshed this PR onto current Fresh exact-head verification:
GitHub's refreshed full matrix currently reports 160 passed, 0 failed, with only Python 3.10 group 3 still running. @erichare, could you review this bundle integration when convenient? Your recent bundle and connector SSRF work is the closest ownership match. Python 3.10 Group 5 timeout diagnosis (2026-07-30)The only code-level red check is an unrelated runner/fixture timeout, not a FunASR assertion failure. Both retry attempts reached 90%, then started This PR changes only the FunASR bundle component/tests, the migration table/completeness test, and Maintainer action needed: please rerun the failed jobs for https://github.com/langflow-ai/langflow/actions/runs/30499744096. The author token cannot rerun this repository workflow (GitHub requires admin rights). |
Signed-off-by: zhifu gao <18321252+LauraGPT@users.noreply.github.com>
Summary
/v1endpoint andsensevoice, with optional gateway auth and language selectionCloses #13426
Validation
lfx-bundlestests)lfxextension, loader, schema, and migration testsuv lock --check, andgit diff --checklfx-bundlessdist/wheel, verified both archives contain the FunASR component, and imported the installed wheel in an isolated Python 3.14 environmentmainat48aac68e99e436520e901a4e3e05e4d6d183bb9cwith no source conflictssample.wavtranscribed as我想问我在滨海新区有房Deployment note
When Langflow SSRF protection is enabled, operators should add their self-hosted FunASR host to
LANGFLOW_SSRF_ALLOWED_HOSTS; this is surfaced in the component input help.Summary by CodeRabbit
New Features
Bug Fixes