mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🗨️ feat: Prompt Slash Commands (#3219)
* chore: Update prompt description placeholder text * fix: promptsPathPattern to not include new * feat: command input and styling change for prompt views * fix: intended validation * feat: prompts slash command * chore: localizations and fix add command during creation * refactor(PromptsCommand): better label * feat: update `allPrompGroups` cache on all promptGroups mutations * refactor: ensure assistants builder is first within sidepanel * refactor: allow defining emailVerified via create-user script
This commit is contained in:
parent
b8f2bee3fc
commit
83619de158
33 changed files with 764 additions and 80 deletions
|
|
@ -32,22 +32,13 @@ export default function useSideNavLinks({
|
|||
endpoint?: EModelEndpoint | null;
|
||||
interfaceConfig: Partial<TInterfaceConfig>;
|
||||
}) {
|
||||
const hasAccess = useHasAccess({
|
||||
const hasAccessToPrompts = useHasAccess({
|
||||
permissionType: PermissionTypes.PROMPTS,
|
||||
permission: Permissions.USE,
|
||||
});
|
||||
|
||||
const Links = useMemo(() => {
|
||||
const links: NavLink[] = [];
|
||||
if (hasAccess) {
|
||||
links.push({
|
||||
title: 'com_ui_prompts',
|
||||
label: '',
|
||||
icon: MessageSquareQuote,
|
||||
id: 'prompts',
|
||||
Component: PromptsAccordion,
|
||||
});
|
||||
}
|
||||
if (
|
||||
isAssistantsEndpoint(endpoint) &&
|
||||
assistants &&
|
||||
|
|
@ -64,6 +55,16 @@ export default function useSideNavLinks({
|
|||
});
|
||||
}
|
||||
|
||||
if (hasAccessToPrompts) {
|
||||
links.push({
|
||||
title: 'com_ui_prompts',
|
||||
label: '',
|
||||
icon: MessageSquareQuote,
|
||||
id: 'prompts',
|
||||
Component: PromptsAccordion,
|
||||
});
|
||||
}
|
||||
|
||||
links.push({
|
||||
title: 'com_sidepanel_attach_files',
|
||||
label: '',
|
||||
|
|
@ -81,7 +82,14 @@ export default function useSideNavLinks({
|
|||
});
|
||||
|
||||
return links;
|
||||
}, [assistants, keyProvided, hidePanel, endpoint, interfaceConfig.parameters, hasAccess]);
|
||||
}, [
|
||||
assistants,
|
||||
keyProvided,
|
||||
hidePanel,
|
||||
endpoint,
|
||||
interfaceConfig.parameters,
|
||||
hasAccessToPrompts,
|
||||
]);
|
||||
|
||||
return Links;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue