Skip to content

Conversation

@GlobalStar117
Copy link
Contributor

Summary

This PR adds ASR (Automatic Speech Recognition) support to the Floating Widget embedded chat, providing feature parity with the Fullscreen Chat.

Related Issue

Fixes #12709

Changes

  • Import AudioButton component into floating-chat-widget.tsx
  • Add microphone button to window mode input area
  • Add microphone button to full mode input area
  • Transcribed text is appended to the input field (allowing users to edit before sending)

Expected Behavior

  • Microphone button appears next to the text input in the Floating Widget
  • User can click to start/stop recording
  • Transcribed text is inserted into the input field
  • Graceful handling if microphone permission is denied (handled by existing AudioButton component)

Screenshots

The implementation reuses the existing AudioButton component which already has:

  • Voice visualizer during recording
  • Recording timer
  • Processing indicator
  • API call to /sequence2txt endpoint

Testing

  1. Embed the Floating Widget on a page
  2. Click the microphone button
  3. Grant microphone permission
  4. Speak and stop recording
  5. Verify transcribed text appears in the input field

Add microphone button to the Floating Widget embedded chat, providing
feature parity with the Fullscreen Chat. Users can now use voice input
in the Intercom-style widget.

Changes:
- Import AudioButton component
- Add microphone button to window mode input area
- Add microphone button to full mode input area
- Transcribed text is appended to the input field

Fixes infiniflow#12709

This is a Gittensor contribution
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Jan 19, 2026
@KevinHuSh KevinHuSh requested a review from asiroliu January 20, 2026 02:03
@asiroliu
Copy link
Collaborator

Thank you for your submission. Unfortunately, while verifying your changes, we encountered a separate issue that interrupted our testing. We will resume the verification of your PR once this new issue has been resolved.

img_v3_02u4_5fad5f80-0db7-43fa-a360-9760ef22928g

@Oranggge
Copy link
Contributor

Maybe my two cents will help.

I think this is connected to issue #12602.
I also got this 401 error from this endpoint but in the fullscreen chat.

I managed to solve it locally with the following change:

--- a/api/apps/__init__.py
+++ b/api/apps/__init__.py
@@ -107,7 +107,12 @@ def _load_user():
         try:
             authorization = request.headers.get("Authorization")
             if len(authorization.split()) == 2:
-                objs = APIToken.query(token=authorization.split()[1])
+                token_value = authorization.split()[1]
+                # Try 'token' field first (standard API tokens)
+                objs = APIToken.query(token=token_value)
+                # Fallback to 'beta' field (shared chat tokens)
+                if not objs:
+                    objs = APIToken.query(beta=token_value)
                 if objs:
                     user = UserService.query(id=objs[0].tenant_id, status=StatusEnum.VALID.value)
                     if user:

I didn’t test it extensively, so I might be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💞 feature Feature request, pull request that fullfill a new feature. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: support for the ASR in Floating Widget embedded chat

3 participants