mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
✨ feat: auto send text slider (#3312)
* feat: convert main component to float * feat: convert the remaining components * feat: use `recoilState` instead of `recoilValue` * feat: replaced `AutoSendTextSwitch` to `AutoSendTextSelector` * feat: use `autoSendText` in the `useSpeechToTextExternal` hook * fix: `autoSendText` timeout
This commit is contained in:
parent
d5d188eebf
commit
d5782ac66c
14 changed files with 737 additions and 749 deletions
|
|
@ -10,7 +10,7 @@ const useSpeechToTextExternal = (onTranscriptionComplete: (text: string) => void
|
|||
const { externalSpeechToText } = useGetAudioSettings();
|
||||
const [speechToText] = useRecoilState<boolean>(store.speechToText);
|
||||
const [autoTranscribeAudio] = useRecoilState<boolean>(store.autoTranscribeAudio);
|
||||
const [autoSendText] = useRecoilState<boolean>(store.autoSendText);
|
||||
const [autoSendText] = useRecoilState(store.autoSendText);
|
||||
const [text, setText] = useState<string>('');
|
||||
const [isListening, setIsListening] = useState(false);
|
||||
const [permission, setPermission] = useState(false);
|
||||
|
|
@ -27,10 +27,11 @@ const useSpeechToTextExternal = (onTranscriptionComplete: (text: string) => void
|
|||
const extractedText = data.text;
|
||||
setText(extractedText);
|
||||
setIsRequestBeingMade(false);
|
||||
if (autoSendText && speechToText && extractedText.length > 0) {
|
||||
|
||||
if (autoSendText > -1 && speechToText && extractedText.length > 0) {
|
||||
setTimeout(() => {
|
||||
onTranscriptionComplete(extractedText);
|
||||
}, 3000);
|
||||
}, autoSendText * 1000);
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue