feat: Add multi-modal chat support (file uploads + voice input)#51
Open
Isaccseven wants to merge 2 commits into
Open
feat: Add multi-modal chat support (file uploads + voice input)#51Isaccseven wants to merge 2 commits into
Isaccseven wants to merge 2 commits into
Conversation
Add file upload and voice-to-text input capabilities to the chat widget:
- File upload: paperclip button opens native file picker, files uploaded
to Langflow server via POST /api/v1/files/upload/{flow_id}, file
references included in tweaks object for the configured component
- Voice input: microphone button uses Web Speech API for speech-to-text,
transcribed text inserted into input field for review before sending
- Both features opt-in via boolean props (file_upload, voice_input)
- New props: file_component (target component ID), voice_language (BCP 47)
- File previews with thumbnails for images, remove button for each file
- Voice button hidden in browsers without SpeechRecognition support
- Pulsing animation on mic button during active recording
Closes langflow-ai#27
Author
|
Ready for review. |
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 file upload and voice-to-text input capabilities to the embedded chat widget, addressing #27.
File Upload
file_uploadprop is false)POST /api/v1/files/upload/{flow_id}on sendfile_componentpropVoice Input
voice_languageprop for BCP 47 language codeNew Props
file_uploadfile_componentvoice_inputvoice_languageFiles Changed
src/index.tsx— New prop registrationssrc/chatWidget/index.tsx— Pass props + new CSS classessrc/chatWidget/chatWindow/index.tsx— File picker, voice input, upload integrationsrc/controllers/uploadFiles.ts— New file upload controllersrc/types/chatWidget/index.ts— FileAttachment typeREADME.md— Document new propsTesting
npm run build:react+npm run build:bundle)file_upload="true"andfile_component="<your-component-id>"voice_input="true"(test in Chrome/Edge)Closes #27