mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
🔉 feat: TTS/STT rate limiters (#2925)
* fix: remove double initialization of speech routes * refactor(useMessageHelpers): more consistent latestMessage updates based on unique textKey and early returns when setting * feat: TTS/STT rate limiters * chore: remove console log * fix: make modular chat true by default
This commit is contained in:
parent
08d6bea359
commit
8318f26d66
12 changed files with 265 additions and 35 deletions
|
|
@ -7,6 +7,7 @@ import type { TMessage } from 'librechat-data-provider';
|
|||
import { useCustomAudioRef, MediaSourceAppender, usePauseGlobalAudio } from '~/hooks/Audio';
|
||||
import { useAuthContext } from '~/hooks';
|
||||
import { globalAudioId } from '~/common';
|
||||
import { getLatestText } from '~/utils';
|
||||
import store from '~/store';
|
||||
|
||||
function timeoutPromise(ms: number, message?: string) {
|
||||
|
|
@ -47,13 +48,14 @@ export default function StreamAudio({ index = 0 }) {
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
const latestText = getLatestText(latestMessage);
|
||||
const shouldFetch =
|
||||
token &&
|
||||
automaticPlayback &&
|
||||
isSubmitting &&
|
||||
latestMessage &&
|
||||
!latestMessage.isCreatedByUser &&
|
||||
(latestMessage.text || latestMessage.content) &&
|
||||
latestText &&
|
||||
latestMessage.messageId &&
|
||||
!latestMessage.messageId.includes('_') &&
|
||||
!isFetching &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue