mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
* refactor: scrollToEnd * fix(validateConvoAccess): search conversation by ID for proper validation * feat: Add unique index for conversationId and user in convoSchema * refactor: Update font sizes 1 rem -> font-size-base in style.css * fix: Assistants map type issues * refactor: Remove obsolete scripts * fix: Update DropdownNoState component to handle both string and OptionType values * refactor: Remove config/loader.js file * fix: remove crypto.randomBytes(); refactor: Create reusable function for generating token and hash
28 lines
863 B
TypeScript
28 lines
863 B
TypeScript
import { EModelEndpoint } from 'librechat-data-provider';
|
|
import type { TAssistantsMap } from 'librechat-data-provider';
|
|
import { useListAssistantsQuery } from '~/data-provider';
|
|
import { mapAssistants } from '~/utils';
|
|
|
|
export default function useAssistantsMap({
|
|
isAuthenticated,
|
|
}: {
|
|
isAuthenticated: boolean;
|
|
}): TAssistantsMap | undefined {
|
|
const { data: assistants = {} } = useListAssistantsQuery(EModelEndpoint.assistants, undefined, {
|
|
select: (res) => mapAssistants(res.data),
|
|
enabled: isAuthenticated,
|
|
});
|
|
const { data: azureAssistants = {} } = useListAssistantsQuery(
|
|
EModelEndpoint.azureAssistants,
|
|
undefined,
|
|
{
|
|
select: (res) => mapAssistants(res.data),
|
|
enabled: isAuthenticated,
|
|
},
|
|
);
|
|
|
|
return {
|
|
[EModelEndpoint.assistants]: assistants,
|
|
[EModelEndpoint.azureAssistants]: azureAssistants,
|
|
};
|
|
}
|