mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
🗂️ feat: Add File Search Toggle Permission for Chat Area Badge (#8605)
This commit is contained in:
parent
5178507b1c
commit
e5d08ccdf1
11 changed files with 184 additions and 19 deletions
|
|
@ -36,6 +36,10 @@ export enum PermissionTypes {
|
|||
* Type for using the "Web Search" feature
|
||||
*/
|
||||
WEB_SEARCH = 'WEB_SEARCH',
|
||||
/**
|
||||
* Type for using the "File Search" feature
|
||||
*/
|
||||
FILE_SEARCH = 'FILE_SEARCH',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,6 +107,11 @@ export const webSearchPermissionsSchema = z.object({
|
|||
});
|
||||
export type TWebSearchPermissions = z.infer<typeof webSearchPermissionsSchema>;
|
||||
|
||||
export const fileSearchPermissionsSchema = z.object({
|
||||
[Permissions.USE]: z.boolean().default(true),
|
||||
});
|
||||
export type TFileSearchPermissions = z.infer<typeof fileSearchPermissionsSchema>;
|
||||
|
||||
// Define a single permissions schema that holds all permission types.
|
||||
export const permissionsSchema = z.object({
|
||||
[PermissionTypes.PROMPTS]: promptPermissionsSchema,
|
||||
|
|
@ -113,4 +122,5 @@ export const permissionsSchema = z.object({
|
|||
[PermissionTypes.TEMPORARY_CHAT]: temporaryChatPermissionsSchema,
|
||||
[PermissionTypes.RUN_CODE]: runCodePermissionsSchema,
|
||||
[PermissionTypes.WEB_SEARCH]: webSearchPermissionsSchema,
|
||||
[PermissionTypes.FILE_SEARCH]: fileSearchPermissionsSchema,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue