mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
📚 feat: Add Source Citations for File Search in Agents (#8652)
* feat: Source Citations for file_search in Agents * Fix: Added citation limits and relevance score to app service. Removed duplicate tests * ✨ feat: implement Role-level toggle to optionally disable file Source Citation in Agents * 🐛 fix: update mock for librechat-data-provider to include PermissionTypes and SystemRoles --------- Co-authored-by: “Praneeth <praneeth.goparaju@slalom.com>
This commit is contained in:
parent
a955097faf
commit
52e59e40be
36 changed files with 1890 additions and 190 deletions
|
|
@ -40,6 +40,10 @@ export enum PermissionTypes {
|
|||
* Type for using the "File Search" feature
|
||||
*/
|
||||
FILE_SEARCH = 'FILE_SEARCH',
|
||||
/**
|
||||
* Type for using the "File Citations" feature in agents
|
||||
*/
|
||||
FILE_CITATIONS = 'FILE_CITATIONS',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -112,6 +116,11 @@ export const fileSearchPermissionsSchema = z.object({
|
|||
});
|
||||
export type TFileSearchPermissions = z.infer<typeof fileSearchPermissionsSchema>;
|
||||
|
||||
export const fileCitationsPermissionsSchema = z.object({
|
||||
[Permissions.USE]: z.boolean().default(true),
|
||||
});
|
||||
export type TFileCitationsPermissions = z.infer<typeof fileCitationsPermissionsSchema>;
|
||||
|
||||
// Define a single permissions schema that holds all permission types.
|
||||
export const permissionsSchema = z.object({
|
||||
[PermissionTypes.PROMPTS]: promptPermissionsSchema,
|
||||
|
|
@ -123,4 +132,5 @@ export const permissionsSchema = z.object({
|
|||
[PermissionTypes.RUN_CODE]: runCodePermissionsSchema,
|
||||
[PermissionTypes.WEB_SEARCH]: webSearchPermissionsSchema,
|
||||
[PermissionTypes.FILE_SEARCH]: fileSearchPermissionsSchema,
|
||||
[PermissionTypes.FILE_CITATIONS]: fileCitationsPermissionsSchema,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue