mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-28 22:28:51 +01:00
✨ feat: move useGetWebsocketUrlQuery for websocket URL retrieval; update imports and add Google provider to RealtimeVoiceProviders enum
This commit is contained in:
parent
483a7da4c8
commit
77ca00c87b
5 changed files with 22 additions and 13 deletions
|
|
@ -532,3 +532,18 @@ export const useUserTermsQuery = (
|
|||
...config,
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetWebsocketUrlQuery = (
|
||||
config?: UseQueryOptions<t.TWebsocketUrlResponse>,
|
||||
): QueryObserverResult<t.TWebsocketUrlResponse> => {
|
||||
return useQuery<t.TWebsocketUrlResponse>(
|
||||
[QueryKeys.websocketUrl],
|
||||
() => dataService.getWebsocketUrl(),
|
||||
{
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
...config,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useGetWebsocketUrlQuery } from 'librechat-data-provider/react-query';
|
||||
import { useGetWebsocketUrlQuery } from '~/data-provider';
|
||||
import type { MessagePayload } from '~/common';
|
||||
import { io, Socket } from 'socket.io-client';
|
||||
import { EventEmitter } from 'events';
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,10 @@ export enum RealtimeVoiceProviders {
|
|||
* Provider for OpenAI Realtime Voice API
|
||||
*/
|
||||
OPENAI = 'openai',
|
||||
/**
|
||||
* Provider for Google Realtime Voice API
|
||||
*/
|
||||
GOOGLE = 'google',
|
||||
}
|
||||
|
||||
/** Enum for app-wide constants */
|
||||
|
|
|
|||
|
|
@ -376,14 +376,3 @@ export const useGetCustomConfigSpeechQuery = (
|
|||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const useGetWebsocketUrlQuery = (
|
||||
config?: UseQueryOptions<t.TWebsocketUrlResponse>,
|
||||
): QueryObserverResult<t.TWebsocketUrlResponse> => {
|
||||
return useQuery<t.TWebsocketUrlResponse>([QueryKeys.websocketUrl], () => dataService.getWebsocketUrl(), {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
...config,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import type {
|
|||
TConversationTag,
|
||||
TBanner,
|
||||
} from './schemas';
|
||||
import { string } from 'zod';
|
||||
|
||||
export type TOpenAIMessage = OpenAI.Chat.ChatCompletionMessageParam;
|
||||
|
||||
export * from './schemas';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue