librechat-data-provider 0.7.415 → 0.7.417
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-query/index.es.js +1 -1
- package/dist/react-query/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/api-endpoints.ts +1 -1
- package/src/config.ts +5 -0
- package/src/roles.ts +16 -0
- package/src/schemas.ts +16 -0
- package/src/types/mutations.ts +6 -0
- package/src/types.ts +1 -0
package/package.json
CHANGED
package/src/api-endpoints.ts
CHANGED
package/src/config.ts
CHANGED
|
@@ -413,6 +413,7 @@ export const configSchema = z.object({
|
|
|
413
413
|
modelSelect: z.boolean().optional(),
|
|
414
414
|
parameters: z.boolean().optional(),
|
|
415
415
|
sidePanel: z.boolean().optional(),
|
|
416
|
+
bookmarks: z.boolean().optional(),
|
|
416
417
|
presets: z.boolean().optional(),
|
|
417
418
|
prompts: z.boolean().optional(),
|
|
418
419
|
})
|
|
@@ -422,6 +423,8 @@ export const configSchema = z.object({
|
|
|
422
423
|
parameters: true,
|
|
423
424
|
sidePanel: true,
|
|
424
425
|
presets: true,
|
|
426
|
+
bookmarks: true,
|
|
427
|
+
prompts: true,
|
|
425
428
|
}),
|
|
426
429
|
fileStrategy: fileSourceSchema.default(FileSources.local),
|
|
427
430
|
registration: z
|
|
@@ -474,6 +477,7 @@ export enum KnownEndpoints {
|
|
|
474
477
|
apipie = 'apipie',
|
|
475
478
|
cohere = 'cohere',
|
|
476
479
|
fireworks = 'fireworks',
|
|
480
|
+
deepseek = 'deepseek',
|
|
477
481
|
groq = 'groq',
|
|
478
482
|
huggingface = 'huggingface',
|
|
479
483
|
mistral = 'mistral',
|
|
@@ -483,6 +487,7 @@ export enum KnownEndpoints {
|
|
|
483
487
|
perplexity = 'perplexity',
|
|
484
488
|
shuttleai = 'shuttleai',
|
|
485
489
|
'together.ai' = 'together.ai',
|
|
490
|
+
unify = 'unify',
|
|
486
491
|
}
|
|
487
492
|
|
|
488
493
|
export enum FetchTokenConfig {
|
package/src/roles.ts
CHANGED
|
@@ -22,6 +22,10 @@ export enum PermissionTypes {
|
|
|
22
22
|
* Type for Prompt Permissions
|
|
23
23
|
*/
|
|
24
24
|
PROMPTS = 'PROMPTS',
|
|
25
|
+
/**
|
|
26
|
+
* Type for Bookmarks Permissions
|
|
27
|
+
*/
|
|
28
|
+
BOOKMARKS = 'BOOKMARKS',
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -41,13 +45,19 @@ export const promptPermissionsSchema = z.object({
|
|
|
41
45
|
[Permissions.SHARE]: z.boolean().default(false),
|
|
42
46
|
});
|
|
43
47
|
|
|
48
|
+
export const bookmarkPermissionsSchema = z.object({
|
|
49
|
+
[Permissions.USE]: z.boolean().default(true),
|
|
50
|
+
});
|
|
51
|
+
|
|
44
52
|
export const roleSchema = z.object({
|
|
45
53
|
name: z.string(),
|
|
46
54
|
[PermissionTypes.PROMPTS]: promptPermissionsSchema,
|
|
55
|
+
[PermissionTypes.BOOKMARKS]: bookmarkPermissionsSchema,
|
|
47
56
|
});
|
|
48
57
|
|
|
49
58
|
export type TRole = z.infer<typeof roleSchema>;
|
|
50
59
|
export type TPromptPermissions = z.infer<typeof promptPermissionsSchema>;
|
|
60
|
+
export type TBookmarkPermissions = z.infer<typeof bookmarkPermissionsSchema>;
|
|
51
61
|
|
|
52
62
|
const defaultRolesSchema = z.object({
|
|
53
63
|
[SystemRoles.ADMIN]: roleSchema.extend({
|
|
@@ -58,10 +68,14 @@ const defaultRolesSchema = z.object({
|
|
|
58
68
|
[Permissions.CREATE]: z.boolean().default(true),
|
|
59
69
|
[Permissions.SHARE]: z.boolean().default(true),
|
|
60
70
|
}),
|
|
71
|
+
[PermissionTypes.BOOKMARKS]: bookmarkPermissionsSchema.extend({
|
|
72
|
+
[Permissions.USE]: z.boolean().default(true),
|
|
73
|
+
}),
|
|
61
74
|
}),
|
|
62
75
|
[SystemRoles.USER]: roleSchema.extend({
|
|
63
76
|
name: z.literal(SystemRoles.USER),
|
|
64
77
|
[PermissionTypes.PROMPTS]: promptPermissionsSchema,
|
|
78
|
+
[PermissionTypes.BOOKMARKS]: bookmarkPermissionsSchema,
|
|
65
79
|
}),
|
|
66
80
|
});
|
|
67
81
|
|
|
@@ -69,9 +83,11 @@ export const roleDefaults = defaultRolesSchema.parse({
|
|
|
69
83
|
[SystemRoles.ADMIN]: {
|
|
70
84
|
name: SystemRoles.ADMIN,
|
|
71
85
|
[PermissionTypes.PROMPTS]: {},
|
|
86
|
+
[PermissionTypes.BOOKMARKS]: {},
|
|
72
87
|
},
|
|
73
88
|
[SystemRoles.USER]: {
|
|
74
89
|
name: SystemRoles.USER,
|
|
75
90
|
[PermissionTypes.PROMPTS]: {},
|
|
91
|
+
[PermissionTypes.BOOKMARKS]: {},
|
|
76
92
|
},
|
|
77
93
|
});
|
package/src/schemas.ts
CHANGED
|
@@ -171,6 +171,9 @@ export const anthropicSettings = {
|
|
|
171
171
|
step: 0.01,
|
|
172
172
|
default: 1,
|
|
173
173
|
},
|
|
174
|
+
promptCache: {
|
|
175
|
+
default: true,
|
|
176
|
+
},
|
|
174
177
|
maxOutputTokens: {
|
|
175
178
|
min: 1,
|
|
176
179
|
max: ANTHROPIC_MAX_OUTPUT,
|
|
@@ -393,6 +396,8 @@ export const tConversationSchema = z.object({
|
|
|
393
396
|
file_ids: z.array(z.string()).optional(),
|
|
394
397
|
maxContextTokens: coerceNumber.optional(),
|
|
395
398
|
max_tokens: coerceNumber.optional(),
|
|
399
|
+
/* Anthropic */
|
|
400
|
+
promptCache: z.boolean().optional(),
|
|
396
401
|
/* vision */
|
|
397
402
|
resendFiles: z.boolean().optional(),
|
|
398
403
|
imageDetail: eImageDetailSchema.optional(),
|
|
@@ -481,6 +486,7 @@ export const tSharedLinkSchema = z.object({
|
|
|
481
486
|
export type TSharedLink = z.infer<typeof tSharedLinkSchema>;
|
|
482
487
|
|
|
483
488
|
export const tConversationTagSchema = z.object({
|
|
489
|
+
_id: z.string(),
|
|
484
490
|
user: z.string(),
|
|
485
491
|
tag: z.string(),
|
|
486
492
|
description: z.string().optional(),
|
|
@@ -647,6 +653,7 @@ export const anthropicSchema = tConversationSchema
|
|
|
647
653
|
topP: true,
|
|
648
654
|
topK: true,
|
|
649
655
|
resendFiles: true,
|
|
656
|
+
promptCache: true,
|
|
650
657
|
iconURL: true,
|
|
651
658
|
greeting: true,
|
|
652
659
|
spec: true,
|
|
@@ -663,6 +670,10 @@ export const anthropicSchema = tConversationSchema
|
|
|
663
670
|
maxOutputTokens: obj.maxOutputTokens ?? anthropicSettings.maxOutputTokens.reset(model),
|
|
664
671
|
topP: obj.topP ?? anthropicSettings.topP.default,
|
|
665
672
|
topK: obj.topK ?? anthropicSettings.topK.default,
|
|
673
|
+
promptCache:
|
|
674
|
+
typeof obj.promptCache === 'boolean'
|
|
675
|
+
? obj.promptCache
|
|
676
|
+
: anthropicSettings.promptCache.default,
|
|
666
677
|
resendFiles:
|
|
667
678
|
typeof obj.resendFiles === 'boolean'
|
|
668
679
|
? obj.resendFiles
|
|
@@ -682,6 +693,7 @@ export const anthropicSchema = tConversationSchema
|
|
|
682
693
|
topP: anthropicSettings.topP.default,
|
|
683
694
|
topK: anthropicSettings.topK.default,
|
|
684
695
|
resendFiles: anthropicSettings.resendFiles.default,
|
|
696
|
+
promptCache: anthropicSettings.promptCache.default,
|
|
685
697
|
iconURL: undefined,
|
|
686
698
|
greeting: undefined,
|
|
687
699
|
spec: undefined,
|
|
@@ -910,6 +922,7 @@ export const compactAnthropicSchema = tConversationSchema
|
|
|
910
922
|
topP: true,
|
|
911
923
|
topK: true,
|
|
912
924
|
resendFiles: true,
|
|
925
|
+
promptCache: true,
|
|
913
926
|
iconURL: true,
|
|
914
927
|
greeting: true,
|
|
915
928
|
spec: true,
|
|
@@ -932,6 +945,9 @@ export const compactAnthropicSchema = tConversationSchema
|
|
|
932
945
|
if (newObj.resendFiles === anthropicSettings.resendFiles.default) {
|
|
933
946
|
delete newObj.resendFiles;
|
|
934
947
|
}
|
|
948
|
+
if (newObj.promptCache === anthropicSettings.promptCache.default) {
|
|
949
|
+
delete newObj.promptCache;
|
|
950
|
+
}
|
|
935
951
|
|
|
936
952
|
return removeNullishValues(newObj);
|
|
937
953
|
})
|
package/src/types/mutations.ts
CHANGED
|
@@ -105,6 +105,12 @@ export type CreateSharedLinkOptions = MutationOptions<
|
|
|
105
105
|
types.TSharedLink,
|
|
106
106
|
Partial<types.TSharedLink>
|
|
107
107
|
>;
|
|
108
|
+
|
|
109
|
+
export type updateTagsInConvoOptions = MutationOptions<
|
|
110
|
+
types.TTagConversationResponse,
|
|
111
|
+
types.TTagConversationRequest
|
|
112
|
+
>;
|
|
113
|
+
|
|
108
114
|
export type UpdateSharedLinkOptions = MutationOptions<
|
|
109
115
|
types.TSharedLink,
|
|
110
116
|
Partial<types.TSharedLink>
|
package/src/types.ts
CHANGED