mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-09 11:04:23 +01:00
✨ feat: Add WebSocket functionality and integrate call features in the chat component
This commit is contained in:
parent
6b90817ae0
commit
d5bc8d3869
21 changed files with 460 additions and 20 deletions
|
|
@ -239,3 +239,5 @@ export const addTagToConversation = (conversationId: string) =>
|
|||
export const userTerms = () => '/api/user/terms';
|
||||
export const acceptUserTerms = () => '/api/user/terms/accept';
|
||||
export const banner = () => '/api/banner';
|
||||
|
||||
export const websocket = () => '/api/websocket';
|
||||
|
|
|
|||
|
|
@ -780,3 +780,7 @@ export function acceptTerms(): Promise<t.TAcceptTermsResponse> {
|
|||
export function getBanner(): Promise<t.TBannerResponse> {
|
||||
return request.get(endpoints.banner());
|
||||
}
|
||||
|
||||
export function getWebsocketUrl(): Promise<t.TWebsocketUrlResponse> {
|
||||
return request.get(endpoints.websocket());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export enum QueryKeys {
|
|||
health = 'health',
|
||||
userTerms = 'userTerms',
|
||||
banner = 'banner',
|
||||
websocketUrl = 'websocketUrl',
|
||||
}
|
||||
|
||||
export enum MutationKeys {
|
||||
|
|
|
|||
|
|
@ -376,3 +376,14 @@ 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,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -482,3 +482,7 @@ export type TRealtimeEphemeralTokenResponse = {
|
|||
token: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
export type TWebsocketUrlResponse = {
|
||||
url: string;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue