librechat-data-provider 0.7.5 → 0.7.7
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/check_updates.sh +1 -0
- 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 +4 -4
- package/server-rollup.config.js +3 -3
- package/specs/actions.spec.ts +424 -35
- package/specs/azure.spec.ts +8 -5
- package/specs/filetypes.spec.ts +1 -7
- package/specs/mcp.spec.ts +52 -0
- package/specs/utils.spec.ts +129 -0
- package/src/actions.ts +209 -82
- package/src/api-endpoints.ts +39 -16
- package/src/azure.ts +40 -33
- package/src/bedrock.ts +84 -4
- package/src/config.ts +199 -95
- package/src/createPayload.ts +3 -1
- package/src/data-service.ts +114 -20
- package/src/file-config.ts +10 -2
- package/src/generate.ts +1 -1
- package/src/index.ts +7 -4
- package/src/keys.ts +6 -0
- package/src/mcp.ts +87 -0
- package/src/models.ts +1 -1
- package/src/parsers.ts +43 -43
- package/src/react-query/react-query-service.ts +40 -126
- package/src/request.ts +28 -7
- package/src/roles.ts +33 -1
- package/src/schemas.ts +250 -198
- package/src/types/agents.ts +57 -1
- package/src/types/assistants.ts +33 -2
- package/src/types/files.ts +1 -0
- package/src/types/mutations.ts +96 -8
- package/src/types/queries.ts +39 -21
- package/src/types/runs.ts +1 -0
- package/src/types.ts +90 -81
- package/src/utils.ts +44 -0
- package/src/zod.spec.ts +526 -0
- package/src/zod.ts +86 -0
- package/tsconfig.json +1 -2
- package/specs/parsers.spec.ts +0 -48
- package/src/sse.js +0 -242
package/src/config.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
import type { ZodError } from 'zod';
|
|
3
|
+
import type { TModelsConfig } from './types';
|
|
4
4
|
import { EModelEndpoint, eModelEndpointSchema } from './schemas';
|
|
5
|
+
import { specsConfigSchema, TSpecsConfig } from './models';
|
|
5
6
|
import { fileConfigSchema } from './file-config';
|
|
6
|
-
import { specsConfigSchema } from './models';
|
|
7
7
|
import { FileSources } from './types/files';
|
|
8
|
-
import {
|
|
8
|
+
import { MCPServersSchema } from './mcp';
|
|
9
9
|
|
|
10
10
|
export const defaultSocialLogins = ['google', 'facebook', 'openid', 'github', 'discord'];
|
|
11
11
|
|
|
@@ -15,6 +15,7 @@ export const defaultRetrievalModels = [
|
|
|
15
15
|
'o1-preview',
|
|
16
16
|
'o1-mini-2024-09-12',
|
|
17
17
|
'o1-mini',
|
|
18
|
+
'o3-mini',
|
|
18
19
|
'chatgpt-4o-latest',
|
|
19
20
|
'gpt-4o-2024-05-13',
|
|
20
21
|
'gpt-4o-2024-08-06',
|
|
@@ -31,6 +32,27 @@ export const defaultRetrievalModels = [
|
|
|
31
32
|
'gpt-4-1106',
|
|
32
33
|
];
|
|
33
34
|
|
|
35
|
+
export const excludedKeys = new Set([
|
|
36
|
+
'conversationId',
|
|
37
|
+
'title',
|
|
38
|
+
'iconURL',
|
|
39
|
+
'greeting',
|
|
40
|
+
'endpoint',
|
|
41
|
+
'endpointType',
|
|
42
|
+
'createdAt',
|
|
43
|
+
'updatedAt',
|
|
44
|
+
'expiredAt',
|
|
45
|
+
'messages',
|
|
46
|
+
'isArchived',
|
|
47
|
+
'tags',
|
|
48
|
+
'user',
|
|
49
|
+
'__v',
|
|
50
|
+
'_id',
|
|
51
|
+
'tools',
|
|
52
|
+
'model',
|
|
53
|
+
'files',
|
|
54
|
+
]);
|
|
55
|
+
|
|
34
56
|
export enum SettingsViews {
|
|
35
57
|
default = 'default',
|
|
36
58
|
advanced = 'advanced',
|
|
@@ -42,9 +64,8 @@ export const fileSourceSchema = z.nativeEnum(FileSources);
|
|
|
42
64
|
type SchemaShape<T> = T extends z.ZodObject<infer U> ? U : never;
|
|
43
65
|
|
|
44
66
|
// Helper type to determine the default value or undefined based on whether the field has a default
|
|
45
|
-
type DefaultValue<T> =
|
|
46
|
-
? ReturnType<T['_def']['defaultValue']>
|
|
47
|
-
: undefined;
|
|
67
|
+
type DefaultValue<T> =
|
|
68
|
+
T extends z.ZodDefault<z.ZodTypeAny> ? ReturnType<T['_def']['defaultValue']> : undefined;
|
|
48
69
|
|
|
49
70
|
// Extract default values or undefined from the schema shape
|
|
50
71
|
type ExtractDefaults<T> = {
|
|
@@ -114,10 +135,10 @@ export type TAzureModelMapSchema = {
|
|
|
114
135
|
group: string;
|
|
115
136
|
};
|
|
116
137
|
|
|
117
|
-
export type TAzureModelGroupMap = Record<string, TAzureModelMapSchema>;
|
|
138
|
+
export type TAzureModelGroupMap = Record<string, TAzureModelMapSchema | undefined>;
|
|
118
139
|
export type TAzureGroupMap = Record<
|
|
119
140
|
string,
|
|
120
|
-
TAzureBaseSchema & { models: Record<string, TAzureModelConfig> }
|
|
141
|
+
(TAzureBaseSchema & { models: Record<string, TAzureModelConfig | undefined> }) | undefined
|
|
121
142
|
>;
|
|
122
143
|
|
|
123
144
|
export type TValidatedAzureConfig = {
|
|
@@ -140,8 +161,11 @@ export enum Capabilities {
|
|
|
140
161
|
}
|
|
141
162
|
|
|
142
163
|
export enum AgentCapabilities {
|
|
164
|
+
hide_sequential_outputs = 'hide_sequential_outputs',
|
|
165
|
+
end_after_tools = 'end_after_tools',
|
|
143
166
|
execute_code = 'execute_code',
|
|
144
167
|
file_search = 'file_search',
|
|
168
|
+
artifacts = 'artifacts',
|
|
145
169
|
actions = 'actions',
|
|
146
170
|
tools = 'tools',
|
|
147
171
|
}
|
|
@@ -206,37 +230,19 @@ export type TAssistantEndpoint = z.infer<typeof assistantEndpointSchema>;
|
|
|
206
230
|
|
|
207
231
|
export const agentsEndpointSChema = baseEndpointSchema.merge(
|
|
208
232
|
z.object({
|
|
209
|
-
/*
|
|
233
|
+
/* agents specific */
|
|
234
|
+
recursionLimit: z.number().optional(),
|
|
210
235
|
disableBuilder: z.boolean().optional(),
|
|
211
|
-
pollIntervalMs: z.number().optional(),
|
|
212
|
-
timeoutMs: z.number().optional(),
|
|
213
|
-
version: z.union([z.string(), z.number()]).default(2),
|
|
214
|
-
supportedIds: z.array(z.string()).min(1).optional(),
|
|
215
|
-
excludedIds: z.array(z.string()).min(1).optional(),
|
|
216
|
-
privateAssistants: z.boolean().optional(),
|
|
217
|
-
retrievalModels: z.array(z.string()).min(1).optional().default(defaultRetrievalModels),
|
|
218
236
|
capabilities: z
|
|
219
|
-
.array(z.nativeEnum(
|
|
237
|
+
.array(z.nativeEnum(AgentCapabilities))
|
|
220
238
|
.optional()
|
|
221
239
|
.default([
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
240
|
+
AgentCapabilities.execute_code,
|
|
241
|
+
AgentCapabilities.file_search,
|
|
242
|
+
AgentCapabilities.artifacts,
|
|
243
|
+
AgentCapabilities.actions,
|
|
244
|
+
AgentCapabilities.tools,
|
|
227
245
|
]),
|
|
228
|
-
/* general */
|
|
229
|
-
apiKey: z.string().optional(),
|
|
230
|
-
models: z
|
|
231
|
-
.object({
|
|
232
|
-
default: z.array(z.string()).min(1),
|
|
233
|
-
fetch: z.boolean().optional(),
|
|
234
|
-
userIdQuery: z.boolean().optional(),
|
|
235
|
-
})
|
|
236
|
-
.optional(),
|
|
237
|
-
titleConvo: z.boolean().optional(),
|
|
238
|
-
titleMethod: z.union([z.literal('completion'), z.literal('functions')]).optional(),
|
|
239
|
-
headers: z.record(z.any()).optional(),
|
|
240
246
|
}),
|
|
241
247
|
);
|
|
242
248
|
|
|
@@ -443,6 +449,91 @@ export enum EImageOutputType {
|
|
|
443
449
|
JPEG = 'jpeg',
|
|
444
450
|
}
|
|
445
451
|
|
|
452
|
+
const termsOfServiceSchema = z.object({
|
|
453
|
+
externalUrl: z.string().optional(),
|
|
454
|
+
openNewTab: z.boolean().optional(),
|
|
455
|
+
modalAcceptance: z.boolean().optional(),
|
|
456
|
+
modalTitle: z.string().optional(),
|
|
457
|
+
modalContent: z.string().or(z.array(z.string())).optional(),
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
export type TTermsOfService = z.infer<typeof termsOfServiceSchema>;
|
|
461
|
+
|
|
462
|
+
export const intefaceSchema = z
|
|
463
|
+
.object({
|
|
464
|
+
privacyPolicy: z
|
|
465
|
+
.object({
|
|
466
|
+
externalUrl: z.string().optional(),
|
|
467
|
+
openNewTab: z.boolean().optional(),
|
|
468
|
+
})
|
|
469
|
+
.optional(),
|
|
470
|
+
termsOfService: termsOfServiceSchema.optional(),
|
|
471
|
+
customWelcome: z.string().optional(),
|
|
472
|
+
endpointsMenu: z.boolean().optional(),
|
|
473
|
+
modelSelect: z.boolean().optional(),
|
|
474
|
+
parameters: z.boolean().optional(),
|
|
475
|
+
sidePanel: z.boolean().optional(),
|
|
476
|
+
multiConvo: z.boolean().optional(),
|
|
477
|
+
bookmarks: z.boolean().optional(),
|
|
478
|
+
presets: z.boolean().optional(),
|
|
479
|
+
prompts: z.boolean().optional(),
|
|
480
|
+
agents: z.boolean().optional(),
|
|
481
|
+
temporaryChat: z.boolean().optional(),
|
|
482
|
+
runCode: z.boolean().optional(),
|
|
483
|
+
})
|
|
484
|
+
.default({
|
|
485
|
+
endpointsMenu: true,
|
|
486
|
+
modelSelect: true,
|
|
487
|
+
parameters: true,
|
|
488
|
+
sidePanel: true,
|
|
489
|
+
presets: true,
|
|
490
|
+
multiConvo: true,
|
|
491
|
+
bookmarks: true,
|
|
492
|
+
prompts: true,
|
|
493
|
+
agents: true,
|
|
494
|
+
temporaryChat: true,
|
|
495
|
+
runCode: true,
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
export type TInterfaceConfig = z.infer<typeof intefaceSchema>;
|
|
499
|
+
|
|
500
|
+
export type TStartupConfig = {
|
|
501
|
+
appTitle: string;
|
|
502
|
+
socialLogins?: string[];
|
|
503
|
+
interface?: TInterfaceConfig;
|
|
504
|
+
discordLoginEnabled: boolean;
|
|
505
|
+
facebookLoginEnabled: boolean;
|
|
506
|
+
githubLoginEnabled: boolean;
|
|
507
|
+
googleLoginEnabled: boolean;
|
|
508
|
+
openidLoginEnabled: boolean;
|
|
509
|
+
appleLoginEnabled: boolean;
|
|
510
|
+
openidLabel: string;
|
|
511
|
+
openidImageUrl: string;
|
|
512
|
+
/** LDAP Auth Configuration */
|
|
513
|
+
ldap?: {
|
|
514
|
+
/** LDAP enabled */
|
|
515
|
+
enabled: boolean;
|
|
516
|
+
/** Whether LDAP uses username vs. email */
|
|
517
|
+
username?: boolean;
|
|
518
|
+
};
|
|
519
|
+
serverDomain: string;
|
|
520
|
+
emailLoginEnabled: boolean;
|
|
521
|
+
registrationEnabled: boolean;
|
|
522
|
+
socialLoginEnabled: boolean;
|
|
523
|
+
passwordResetEnabled: boolean;
|
|
524
|
+
emailEnabled: boolean;
|
|
525
|
+
checkBalance: boolean;
|
|
526
|
+
showBirthdayIcon: boolean;
|
|
527
|
+
helpAndFaqURL: string;
|
|
528
|
+
customFooter?: string;
|
|
529
|
+
modelSpecs?: TSpecsConfig;
|
|
530
|
+
sharedLinksEnabled: boolean;
|
|
531
|
+
publicSharedLinksEnabled: boolean;
|
|
532
|
+
analyticsGtmId?: string;
|
|
533
|
+
instanceProjectId: string;
|
|
534
|
+
bundlerURL?: string;
|
|
535
|
+
};
|
|
536
|
+
|
|
446
537
|
export const configSchema = z.object({
|
|
447
538
|
version: z.string(),
|
|
448
539
|
cache: z.boolean().default(true),
|
|
@@ -450,43 +541,14 @@ export const configSchema = z.object({
|
|
|
450
541
|
imageOutputType: z.nativeEnum(EImageOutputType).default(EImageOutputType.PNG),
|
|
451
542
|
includedTools: z.array(z.string()).optional(),
|
|
452
543
|
filteredTools: z.array(z.string()).optional(),
|
|
453
|
-
|
|
544
|
+
mcpServers: MCPServersSchema.optional(),
|
|
545
|
+
interface: intefaceSchema,
|
|
546
|
+
fileStrategy: fileSourceSchema.default(FileSources.local),
|
|
547
|
+
actions: z
|
|
454
548
|
.object({
|
|
455
|
-
|
|
456
|
-
.object({
|
|
457
|
-
externalUrl: z.string().optional(),
|
|
458
|
-
openNewTab: z.boolean().optional(),
|
|
459
|
-
})
|
|
460
|
-
.optional(),
|
|
461
|
-
termsOfService: z
|
|
462
|
-
.object({
|
|
463
|
-
externalUrl: z.string().optional(),
|
|
464
|
-
openNewTab: z.boolean().optional(),
|
|
465
|
-
modalAcceptance: z.boolean().optional(),
|
|
466
|
-
modalTitle: z.string().optional(),
|
|
467
|
-
modalContent: z.string().or(z.array(z.string())).optional(),
|
|
468
|
-
})
|
|
469
|
-
.optional(),
|
|
470
|
-
endpointsMenu: z.boolean().optional(),
|
|
471
|
-
modelSelect: z.boolean().optional(),
|
|
472
|
-
parameters: z.boolean().optional(),
|
|
473
|
-
sidePanel: z.boolean().optional(),
|
|
474
|
-
multiConvo: z.boolean().optional(),
|
|
475
|
-
bookmarks: z.boolean().optional(),
|
|
476
|
-
presets: z.boolean().optional(),
|
|
477
|
-
prompts: z.boolean().optional(),
|
|
549
|
+
allowedDomains: z.array(z.string()).optional(),
|
|
478
550
|
})
|
|
479
|
-
.
|
|
480
|
-
endpointsMenu: true,
|
|
481
|
-
modelSelect: true,
|
|
482
|
-
parameters: true,
|
|
483
|
-
sidePanel: true,
|
|
484
|
-
presets: true,
|
|
485
|
-
multiConvo: true,
|
|
486
|
-
bookmarks: true,
|
|
487
|
-
prompts: true,
|
|
488
|
-
}),
|
|
489
|
-
fileStrategy: fileSourceSchema.default(FileSources.local),
|
|
551
|
+
.optional(),
|
|
490
552
|
registration: z
|
|
491
553
|
.object({
|
|
492
554
|
socialLogins: z.array(z.string()).optional(),
|
|
@@ -550,6 +612,7 @@ export enum KnownEndpoints {
|
|
|
550
612
|
shuttleai = 'shuttleai',
|
|
551
613
|
'together.ai' = 'together.ai',
|
|
552
614
|
unify = 'unify',
|
|
615
|
+
xai = 'xai',
|
|
553
616
|
}
|
|
554
617
|
|
|
555
618
|
export enum FetchTokenConfig {
|
|
@@ -562,7 +625,6 @@ export const defaultEndpoints: EModelEndpoint[] = [
|
|
|
562
625
|
EModelEndpoint.azureAssistants,
|
|
563
626
|
EModelEndpoint.azureOpenAI,
|
|
564
627
|
EModelEndpoint.agents,
|
|
565
|
-
EModelEndpoint.bingAI,
|
|
566
628
|
EModelEndpoint.chatGPTBrowser,
|
|
567
629
|
EModelEndpoint.gptPlugins,
|
|
568
630
|
EModelEndpoint.google,
|
|
@@ -577,18 +639,22 @@ export const alternateName = {
|
|
|
577
639
|
[EModelEndpoint.agents]: 'Agents',
|
|
578
640
|
[EModelEndpoint.azureAssistants]: 'Azure Assistants',
|
|
579
641
|
[EModelEndpoint.azureOpenAI]: 'Azure OpenAI',
|
|
580
|
-
[EModelEndpoint.bingAI]: 'Bing',
|
|
581
642
|
[EModelEndpoint.chatGPTBrowser]: 'ChatGPT',
|
|
582
643
|
[EModelEndpoint.gptPlugins]: 'Plugins',
|
|
583
644
|
[EModelEndpoint.google]: 'Google',
|
|
584
645
|
[EModelEndpoint.anthropic]: 'Anthropic',
|
|
585
646
|
[EModelEndpoint.custom]: 'Custom',
|
|
586
647
|
[EModelEndpoint.bedrock]: 'AWS Bedrock',
|
|
648
|
+
[KnownEndpoints.ollama]: 'Ollama',
|
|
649
|
+
[KnownEndpoints.deepseek]: 'DeepSeek',
|
|
650
|
+
[KnownEndpoints.xai]: 'xAI',
|
|
587
651
|
};
|
|
588
652
|
|
|
589
653
|
const sharedOpenAIModels = [
|
|
590
654
|
'gpt-4o-mini',
|
|
591
655
|
'gpt-4o',
|
|
656
|
+
'gpt-4.5-preview',
|
|
657
|
+
'gpt-4.5-preview-2025-02-27',
|
|
592
658
|
'gpt-3.5-turbo',
|
|
593
659
|
'gpt-3.5-turbo-0125',
|
|
594
660
|
'gpt-4-turbo',
|
|
@@ -607,6 +673,9 @@ const sharedOpenAIModels = [
|
|
|
607
673
|
];
|
|
608
674
|
|
|
609
675
|
const sharedAnthropicModels = [
|
|
676
|
+
'claude-3-7-sonnet-latest',
|
|
677
|
+
'claude-3-7-sonnet-20250219',
|
|
678
|
+
'claude-3-5-haiku-20241022',
|
|
610
679
|
'claude-3-5-sonnet-20241022',
|
|
611
680
|
'claude-3-5-sonnet-20240620',
|
|
612
681
|
'claude-3-5-sonnet-latest',
|
|
@@ -623,7 +692,9 @@ const sharedAnthropicModels = [
|
|
|
623
692
|
];
|
|
624
693
|
|
|
625
694
|
export const bedrockModels = [
|
|
695
|
+
'anthropic.claude-3-5-sonnet-20241022-v2:0',
|
|
626
696
|
'anthropic.claude-3-5-sonnet-20240620-v1:0',
|
|
697
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0',
|
|
627
698
|
'anthropic.claude-3-haiku-20240307-v1:0',
|
|
628
699
|
'anthropic.claude-3-opus-20240229-v1:0',
|
|
629
700
|
'anthropic.claude-3-sonnet-20240229-v1:0',
|
|
@@ -656,26 +727,27 @@ export const bedrockModels = [
|
|
|
656
727
|
|
|
657
728
|
export const defaultModels = {
|
|
658
729
|
[EModelEndpoint.azureAssistants]: sharedOpenAIModels,
|
|
659
|
-
[EModelEndpoint.assistants]: ['chatgpt-4o-latest'
|
|
730
|
+
[EModelEndpoint.assistants]: [...sharedOpenAIModels, 'chatgpt-4o-latest'],
|
|
660
731
|
[EModelEndpoint.agents]: sharedOpenAIModels, // TODO: Add agent models (agentsModels)
|
|
661
732
|
[EModelEndpoint.google]: [
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
'
|
|
665
|
-
'
|
|
666
|
-
'
|
|
667
|
-
'
|
|
668
|
-
|
|
669
|
-
'
|
|
670
|
-
'
|
|
671
|
-
'
|
|
672
|
-
'
|
|
673
|
-
|
|
733
|
+
// Shared Google Models between Vertex AI & Gen AI
|
|
734
|
+
// Gemini 2.0 Models
|
|
735
|
+
'gemini-2.0-flash-001',
|
|
736
|
+
'gemini-2.0-flash-exp',
|
|
737
|
+
'gemini-2.0-flash-lite',
|
|
738
|
+
'gemini-2.0-pro-exp-02-05',
|
|
739
|
+
// Gemini 1.5 Models
|
|
740
|
+
'gemini-1.5-flash-001',
|
|
741
|
+
'gemini-1.5-flash-002',
|
|
742
|
+
'gemini-1.5-pro-001',
|
|
743
|
+
'gemini-1.5-pro-002',
|
|
744
|
+
// Gemini 1.0 Models
|
|
745
|
+
'gemini-1.0-pro-001',
|
|
674
746
|
],
|
|
675
747
|
[EModelEndpoint.anthropic]: sharedAnthropicModels,
|
|
676
748
|
[EModelEndpoint.openAI]: [
|
|
677
|
-
'chatgpt-4o-latest',
|
|
678
749
|
...sharedOpenAIModels,
|
|
750
|
+
'chatgpt-4o-latest',
|
|
679
751
|
'gpt-4-vision-preview',
|
|
680
752
|
'gpt-3.5-turbo-instruct-0914',
|
|
681
753
|
'gpt-3.5-turbo-instruct',
|
|
@@ -696,7 +768,6 @@ export const initialModelsConfig: TModelsConfig = {
|
|
|
696
768
|
[EModelEndpoint.agents]: openAIModels, // TODO: Add agent models (agentsModels)
|
|
697
769
|
[EModelEndpoint.gptPlugins]: openAIModels,
|
|
698
770
|
[EModelEndpoint.azureOpenAI]: openAIModels,
|
|
699
|
-
[EModelEndpoint.bingAI]: ['BingAI', 'Sydney'],
|
|
700
771
|
[EModelEndpoint.chatGPTBrowser]: ['text-davinci-002-render-sha'],
|
|
701
772
|
[EModelEndpoint.google]: defaultModels[EModelEndpoint.google],
|
|
702
773
|
[EModelEndpoint.anthropic]: defaultModels[EModelEndpoint.anthropic],
|
|
@@ -705,7 +776,6 @@ export const initialModelsConfig: TModelsConfig = {
|
|
|
705
776
|
|
|
706
777
|
export const EndpointURLs: { [key in EModelEndpoint]: string } = {
|
|
707
778
|
[EModelEndpoint.openAI]: `/api/ask/${EModelEndpoint.openAI}`,
|
|
708
|
-
[EModelEndpoint.bingAI]: `/api/ask/${EModelEndpoint.bingAI}`,
|
|
709
779
|
[EModelEndpoint.google]: `/api/ask/${EModelEndpoint.google}`,
|
|
710
780
|
[EModelEndpoint.custom]: `/api/ask/${EModelEndpoint.custom}`,
|
|
711
781
|
[EModelEndpoint.anthropic]: `/api/ask/${EModelEndpoint.anthropic}`,
|
|
@@ -742,15 +812,28 @@ export const supportsBalanceCheck = {
|
|
|
742
812
|
};
|
|
743
813
|
|
|
744
814
|
export const visionModels = [
|
|
815
|
+
'grok-3',
|
|
816
|
+
'grok-2-vision',
|
|
817
|
+
'grok-vision',
|
|
818
|
+
'gpt-4.5',
|
|
745
819
|
'gpt-4o',
|
|
746
820
|
'gpt-4o-mini',
|
|
821
|
+
'o1',
|
|
747
822
|
'gpt-4-turbo',
|
|
748
823
|
'gpt-4-vision',
|
|
749
824
|
'llava',
|
|
750
825
|
'llava-13b',
|
|
751
826
|
'gemini-pro-vision',
|
|
752
827
|
'claude-3',
|
|
828
|
+
'gemini-2.0',
|
|
753
829
|
'gemini-1.5',
|
|
830
|
+
'gemini-exp',
|
|
831
|
+
'moondream',
|
|
832
|
+
'llama3.2-vision',
|
|
833
|
+
'llama-3.2-90b-vision',
|
|
834
|
+
'llama-3.2-11b-vision',
|
|
835
|
+
'llama-3-2-90b-vision',
|
|
836
|
+
'llama-3-2-11b-vision',
|
|
754
837
|
];
|
|
755
838
|
export enum VisionModes {
|
|
756
839
|
generative = 'generative',
|
|
@@ -770,7 +853,7 @@ export function validateVisionModel({
|
|
|
770
853
|
return false;
|
|
771
854
|
}
|
|
772
855
|
|
|
773
|
-
if (model
|
|
856
|
+
if (model.includes('gpt-4-turbo-preview') || model.includes('o1-mini')) {
|
|
774
857
|
return false;
|
|
775
858
|
}
|
|
776
859
|
|
|
@@ -781,7 +864,7 @@ export function validateVisionModel({
|
|
|
781
864
|
return visionModels.concat(additionalModels).some((visionModel) => model.includes(visionModel));
|
|
782
865
|
}
|
|
783
866
|
|
|
784
|
-
export const imageGenTools = new Set(['dalle', 'dall-e', 'stable-diffusion']);
|
|
867
|
+
export const imageGenTools = new Set(['dalle', 'dall-e', 'stable-diffusion', 'flux']);
|
|
785
868
|
|
|
786
869
|
/**
|
|
787
870
|
* Enum for collections using infinite queries
|
|
@@ -884,6 +967,10 @@ export enum CacheKeys {
|
|
|
884
967
|
* Key for in-progress messages.
|
|
885
968
|
*/
|
|
886
969
|
MESSAGES = 'messages',
|
|
970
|
+
/**
|
|
971
|
+
* Key for in-progress flow states.
|
|
972
|
+
*/
|
|
973
|
+
FLOWS = 'flows',
|
|
887
974
|
}
|
|
888
975
|
|
|
889
976
|
/**
|
|
@@ -926,6 +1013,10 @@ export enum ViolationTypes {
|
|
|
926
1013
|
* Verify Conversation Access violation.
|
|
927
1014
|
*/
|
|
928
1015
|
CONVO_ACCESS = 'convo_access',
|
|
1016
|
+
/**
|
|
1017
|
+
* Tool Call Limit Violation.
|
|
1018
|
+
*/
|
|
1019
|
+
TOOL_CALL_LIMIT = 'tool_call_limit',
|
|
929
1020
|
}
|
|
930
1021
|
|
|
931
1022
|
/**
|
|
@@ -960,10 +1051,18 @@ export enum ErrorTypes {
|
|
|
960
1051
|
* Invalid request error, API rejected request
|
|
961
1052
|
*/
|
|
962
1053
|
INVALID_REQUEST = 'invalid_request_error',
|
|
1054
|
+
/**
|
|
1055
|
+
* Invalid action request error, likely not on list of allowed domains
|
|
1056
|
+
*/
|
|
1057
|
+
INVALID_ACTION = 'invalid_action_error',
|
|
963
1058
|
/**
|
|
964
1059
|
* Invalid request error, API rejected request
|
|
965
1060
|
*/
|
|
966
1061
|
NO_SYSTEM_MESSAGES = 'no_system_messages',
|
|
1062
|
+
/**
|
|
1063
|
+
* Google provider returned an error
|
|
1064
|
+
*/
|
|
1065
|
+
GOOGLE_ERROR = 'google_error',
|
|
967
1066
|
}
|
|
968
1067
|
|
|
969
1068
|
/**
|
|
@@ -1003,6 +1102,7 @@ export enum ImageDetailCost {
|
|
|
1003
1102
|
/**
|
|
1004
1103
|
* Additional Cost added to High Resolution Total Cost
|
|
1005
1104
|
*/
|
|
1105
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
1006
1106
|
ADDITIONAL = 85,
|
|
1007
1107
|
}
|
|
1008
1108
|
|
|
@@ -1073,13 +1173,15 @@ export enum TTSProviders {
|
|
|
1073
1173
|
/** Enum for app-wide constants */
|
|
1074
1174
|
export enum Constants {
|
|
1075
1175
|
/** Key for the app's version. */
|
|
1076
|
-
VERSION = 'v0.7.
|
|
1176
|
+
VERSION = 'v0.7.7',
|
|
1077
1177
|
/** Key for the Custom Config's version (librechat.yaml). */
|
|
1078
|
-
CONFIG_VERSION = '1.1
|
|
1178
|
+
CONFIG_VERSION = '1.2.1',
|
|
1079
1179
|
/** Standard value for the first message's `parentMessageId` value, to indicate no parent exists. */
|
|
1080
1180
|
NO_PARENT = '00000000-0000-0000-0000-000000000000',
|
|
1081
1181
|
/** Standard value for the initial conversationId before a request is sent */
|
|
1082
1182
|
NEW_CONVO = 'new',
|
|
1183
|
+
/** Standard value for the conversationId used for search queries */
|
|
1184
|
+
SEARCH = 'search',
|
|
1083
1185
|
/** Fixed, encoded domain length for Azure OpenAI Assistants Function name parsing. */
|
|
1084
1186
|
ENCODED_DOMAIN_LENGTH = 10,
|
|
1085
1187
|
/** Identifier for using current_model in multi-model requests. */
|
|
@@ -1096,6 +1198,8 @@ export enum Constants {
|
|
|
1096
1198
|
MAX_CONVO_STARTERS = 4,
|
|
1097
1199
|
/** Global/instance Project Name */
|
|
1098
1200
|
GLOBAL_PROJECT_NAME = 'instance',
|
|
1201
|
+
/** Delimiter for MCP tools */
|
|
1202
|
+
mcp_delimiter = '_mcp_',
|
|
1099
1203
|
}
|
|
1100
1204
|
|
|
1101
1205
|
export enum LocalStorageKeys {
|
|
@@ -1103,8 +1207,6 @@ export enum LocalStorageKeys {
|
|
|
1103
1207
|
APP_TITLE = 'appTitle',
|
|
1104
1208
|
/** Key for the last conversation setup. */
|
|
1105
1209
|
LAST_CONVO_SETUP = 'lastConversationSetup',
|
|
1106
|
-
/** Key for the last BingAI Settings */
|
|
1107
|
-
LAST_BING = 'lastBingSettings',
|
|
1108
1210
|
/** Key for the last selected model. */
|
|
1109
1211
|
LAST_MODEL = 'lastSelectedModel',
|
|
1110
1212
|
/** Key for the last selected tools. */
|
|
@@ -1141,7 +1243,9 @@ export enum ForkOptions {
|
|
|
1141
1243
|
/** Key for including branches */
|
|
1142
1244
|
INCLUDE_BRANCHES = 'includeBranches',
|
|
1143
1245
|
/** Key for target level fork (default) */
|
|
1144
|
-
TARGET_LEVEL = '',
|
|
1246
|
+
TARGET_LEVEL = 'targetLevel',
|
|
1247
|
+
/** Default option */
|
|
1248
|
+
DEFAULT = 'default',
|
|
1145
1249
|
}
|
|
1146
1250
|
|
|
1147
1251
|
/**
|
|
@@ -1180,6 +1284,6 @@ export enum SystemCategories {
|
|
|
1180
1284
|
export const providerEndpointMap = {
|
|
1181
1285
|
[EModelEndpoint.openAI]: EModelEndpoint.openAI,
|
|
1182
1286
|
[EModelEndpoint.bedrock]: EModelEndpoint.bedrock,
|
|
1183
|
-
[EModelEndpoint.azureOpenAI]: EModelEndpoint.openAI,
|
|
1184
1287
|
[EModelEndpoint.anthropic]: EModelEndpoint.anthropic,
|
|
1288
|
+
[EModelEndpoint.azureOpenAI]: EModelEndpoint.azureOpenAI,
|
|
1185
1289
|
};
|
package/src/createPayload.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { EndpointURLs } from './config';
|
|
|
3
3
|
import * as s from './schemas';
|
|
4
4
|
|
|
5
5
|
export default function createPayload(submission: t.TSubmission) {
|
|
6
|
-
const { conversation, userMessage, endpointOption, isEdited, isContinued } =
|
|
6
|
+
const { conversation, userMessage, endpointOption, isEdited, isContinued, isTemporary } =
|
|
7
|
+
submission;
|
|
7
8
|
const { conversationId } = s.tConvoUpdateSchema.parse(conversation);
|
|
8
9
|
const { endpoint, endpointType } = endpointOption as {
|
|
9
10
|
endpoint: s.EModelEndpoint;
|
|
@@ -23,6 +24,7 @@ export default function createPayload(submission: t.TSubmission) {
|
|
|
23
24
|
...endpointOption,
|
|
24
25
|
isContinued: !!(isEdited && isContinued),
|
|
25
26
|
conversationId,
|
|
27
|
+
isTemporary,
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
return { server, payload };
|