4.8.12 test (#3006)
* perf: oneapi error tip * fix: qps limit condition error * perf: Plan tip * fix: permission modal ui * perf: dataset slider ui * perf: api key auth tmbId problem * perf: dataset upload i18n * fix: http json path check
This commit is contained in:
@@ -114,6 +114,35 @@ const ChatInput = ({
|
||||
renderAudioGraph,
|
||||
stream
|
||||
} = useSpeech({ appId, ...outLinkAuthData });
|
||||
const onWhisperRecord = useCallback(() => {
|
||||
const finishWhisperTranscription = (text: string) => {
|
||||
if (!text) return;
|
||||
if (whisperConfig?.autoSend) {
|
||||
onSendMessage({
|
||||
text,
|
||||
files: fileList,
|
||||
autoTTSResponse
|
||||
});
|
||||
replaceFiles([]);
|
||||
} else {
|
||||
resetInputVal({ text });
|
||||
}
|
||||
};
|
||||
if (isSpeaking) {
|
||||
return stopSpeak();
|
||||
}
|
||||
startSpeak(finishWhisperTranscription);
|
||||
}, [
|
||||
autoTTSResponse,
|
||||
fileList,
|
||||
isSpeaking,
|
||||
onSendMessage,
|
||||
replaceFiles,
|
||||
resetInputVal,
|
||||
startSpeak,
|
||||
stopSpeak,
|
||||
whisperConfig?.autoSend
|
||||
]);
|
||||
useEffect(() => {
|
||||
if (!stream) {
|
||||
return;
|
||||
@@ -131,28 +160,6 @@ const ChatInput = ({
|
||||
};
|
||||
renderCurve();
|
||||
}, [renderAudioGraph, stream]);
|
||||
const finishWhisperTranscription = useCallback(
|
||||
(text: string) => {
|
||||
if (!text) return;
|
||||
if (whisperConfig?.autoSend) {
|
||||
onSendMessage({
|
||||
text,
|
||||
files: fileList,
|
||||
autoTTSResponse
|
||||
});
|
||||
replaceFiles([]);
|
||||
} else {
|
||||
resetInputVal({ text });
|
||||
}
|
||||
},
|
||||
[autoTTSResponse, fileList, onSendMessage, replaceFiles, resetInputVal, whisperConfig?.autoSend]
|
||||
);
|
||||
const onWhisperRecord = useCallback(() => {
|
||||
if (isSpeaking) {
|
||||
return stopSpeak();
|
||||
}
|
||||
startSpeak(finishWhisperTranscription);
|
||||
}, [finishWhisperTranscription, isSpeaking, startSpeak, stopSpeak]);
|
||||
|
||||
const RenderTranslateLoading = useMemo(
|
||||
() => (
|
||||
|
||||
Reference in New Issue
Block a user