librechat-data-provider 0.8.402 → 0.8.403
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/types/accessPermissions.d.ts +744 -0
- package/dist/types/actions.d.ts +118 -0
- package/dist/types/api-endpoints.d.ts +149 -0
- package/dist/types/artifacts.d.ts +97 -0
- package/dist/types/azure.d.ts +22 -0
- package/dist/types/bedrock.d.ts +1220 -0
- package/dist/types/config.d.ts +13916 -0
- package/dist/types/config.spec.d.ts +1 -0
- package/dist/types/createPayload.d.ts +5 -0
- package/dist/types/data-service.d.ts +284 -0
- package/dist/types/feedback.d.ts +36 -0
- package/dist/types/file-config.d.ts +263 -0
- package/dist/types/file-config.spec.d.ts +1 -0
- package/dist/types/generate.d.ts +597 -0
- package/dist/types/headers-helpers.d.ts +2 -0
- package/{src/index.ts → dist/types/index.d.ts} +0 -15
- package/dist/types/keys.d.ts +92 -0
- package/dist/types/mcp.d.ts +2760 -0
- package/dist/types/messages.d.ts +10 -0
- package/dist/types/models.d.ts +1677 -0
- package/dist/types/parameterSettings.d.ts +69 -0
- package/dist/types/parsers.d.ts +110 -0
- package/dist/types/permissions.d.ts +522 -0
- package/dist/types/react-query/react-query-service.d.ts +85 -0
- package/dist/types/request.d.ts +25 -0
- package/dist/types/roles.d.ts +554 -0
- package/dist/types/roles.spec.d.ts +1 -0
- package/dist/types/schemas.d.ts +4815 -0
- package/dist/types/schemas.spec.d.ts +1 -0
- package/dist/types/types/agents.d.ts +433 -0
- package/dist/types/types/assistants.d.ts +547 -0
- package/dist/types/types/files.d.ts +172 -0
- package/dist/types/types/graph.d.ts +135 -0
- package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
- package/dist/types/types/mutations.d.ts +209 -0
- package/dist/types/types/queries.d.ts +169 -0
- package/dist/types/types/runs.d.ts +36 -0
- package/dist/types/types/web.d.ts +520 -0
- package/dist/types/types.d.ts +503 -0
- package/dist/types/utils.d.ts +12 -0
- package/package.json +4 -1
- package/babel.config.js +0 -4
- package/check_updates.sh +0 -52
- package/jest.config.js +0 -19
- package/react-query/package-lock.json +0 -292
- package/react-query/package.json +0 -10
- package/rollup.config.js +0 -74
- package/server-rollup.config.js +0 -40
- package/specs/actions.spec.ts +0 -2533
- package/specs/api-endpoints-subdir.spec.ts +0 -140
- package/specs/api-endpoints.spec.ts +0 -74
- package/specs/azure.spec.ts +0 -844
- package/specs/bedrock.spec.ts +0 -862
- package/specs/filetypes.spec.ts +0 -175
- package/specs/generate.spec.ts +0 -770
- package/specs/headers-helpers.spec.ts +0 -24
- package/specs/mcp.spec.ts +0 -147
- package/specs/openapiSpecs.ts +0 -524
- package/specs/parsers.spec.ts +0 -601
- package/specs/request-interceptor.spec.ts +0 -304
- package/specs/utils.spec.ts +0 -196
- package/src/accessPermissions.ts +0 -346
- package/src/actions.ts +0 -813
- package/src/api-endpoints.ts +0 -440
- package/src/artifacts.ts +0 -3104
- package/src/azure.ts +0 -328
- package/src/bedrock.ts +0 -425
- package/src/config.spec.ts +0 -315
- package/src/config.ts +0 -2006
- package/src/createPayload.ts +0 -46
- package/src/data-service.ts +0 -1087
- package/src/feedback.ts +0 -141
- package/src/file-config.spec.ts +0 -1248
- package/src/file-config.ts +0 -764
- package/src/generate.ts +0 -634
- package/src/headers-helpers.ts +0 -13
- package/src/keys.ts +0 -99
- package/src/mcp.ts +0 -271
- package/src/messages.ts +0 -50
- package/src/models.ts +0 -69
- package/src/parameterSettings.ts +0 -1111
- package/src/parsers.ts +0 -563
- package/src/permissions.ts +0 -188
- package/src/react-query/react-query-service.ts +0 -566
- package/src/request.ts +0 -171
- package/src/roles.spec.ts +0 -132
- package/src/roles.ts +0 -225
- package/src/schemas.spec.ts +0 -355
- package/src/schemas.ts +0 -1234
- package/src/types/agents.ts +0 -470
- package/src/types/assistants.ts +0 -654
- package/src/types/files.ts +0 -191
- package/src/types/graph.ts +0 -145
- package/src/types/mutations.ts +0 -422
- package/src/types/queries.ts +0 -208
- package/src/types/runs.ts +0 -40
- package/src/types/web.ts +0 -588
- package/src/types.ts +0 -676
- package/src/utils.ts +0 -85
- package/tsconfig.json +0 -28
- package/tsconfig.spec.json +0 -10
- /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
- /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
package/src/feedback.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export type TFeedbackRating = 'thumbsUp' | 'thumbsDown';
|
|
4
|
-
export const FEEDBACK_RATINGS = ['thumbsUp', 'thumbsDown'] as const;
|
|
5
|
-
|
|
6
|
-
export const FEEDBACK_REASON_KEYS = [
|
|
7
|
-
// Down
|
|
8
|
-
'not_matched',
|
|
9
|
-
'inaccurate',
|
|
10
|
-
'bad_style',
|
|
11
|
-
'missing_image',
|
|
12
|
-
'unjustified_refusal',
|
|
13
|
-
'not_helpful',
|
|
14
|
-
'other',
|
|
15
|
-
// Up
|
|
16
|
-
'accurate_reliable',
|
|
17
|
-
'creative_solution',
|
|
18
|
-
'clear_well_written',
|
|
19
|
-
'attention_to_detail',
|
|
20
|
-
] as const;
|
|
21
|
-
|
|
22
|
-
export type TFeedbackTagKey = (typeof FEEDBACK_REASON_KEYS)[number];
|
|
23
|
-
|
|
24
|
-
export interface TFeedbackTag {
|
|
25
|
-
key: TFeedbackTagKey;
|
|
26
|
-
label: string;
|
|
27
|
-
direction: TFeedbackRating;
|
|
28
|
-
icon: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// --- Tag Registry ---
|
|
32
|
-
export const FEEDBACK_TAGS: TFeedbackTag[] = [
|
|
33
|
-
// Thumbs Down
|
|
34
|
-
{
|
|
35
|
-
key: 'not_matched',
|
|
36
|
-
label: 'com_ui_feedback_tag_not_matched',
|
|
37
|
-
direction: 'thumbsDown',
|
|
38
|
-
icon: 'AlertCircle',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
key: 'inaccurate',
|
|
42
|
-
label: 'com_ui_feedback_tag_inaccurate',
|
|
43
|
-
direction: 'thumbsDown',
|
|
44
|
-
icon: 'AlertCircle',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: 'bad_style',
|
|
48
|
-
label: 'com_ui_feedback_tag_bad_style',
|
|
49
|
-
direction: 'thumbsDown',
|
|
50
|
-
icon: 'PenTool',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
key: 'missing_image',
|
|
54
|
-
label: 'com_ui_feedback_tag_missing_image',
|
|
55
|
-
direction: 'thumbsDown',
|
|
56
|
-
icon: 'ImageOff',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: 'unjustified_refusal',
|
|
60
|
-
label: 'com_ui_feedback_tag_unjustified_refusal',
|
|
61
|
-
direction: 'thumbsDown',
|
|
62
|
-
icon: 'Ban',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
key: 'not_helpful',
|
|
66
|
-
label: 'com_ui_feedback_tag_not_helpful',
|
|
67
|
-
direction: 'thumbsDown',
|
|
68
|
-
icon: 'ThumbsDown',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: 'other',
|
|
72
|
-
label: 'com_ui_feedback_tag_other',
|
|
73
|
-
direction: 'thumbsDown',
|
|
74
|
-
icon: 'HelpCircle',
|
|
75
|
-
},
|
|
76
|
-
// Thumbs Up
|
|
77
|
-
{
|
|
78
|
-
key: 'accurate_reliable',
|
|
79
|
-
label: 'com_ui_feedback_tag_accurate_reliable',
|
|
80
|
-
direction: 'thumbsUp',
|
|
81
|
-
icon: 'CheckCircle',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
key: 'creative_solution',
|
|
85
|
-
label: 'com_ui_feedback_tag_creative_solution',
|
|
86
|
-
direction: 'thumbsUp',
|
|
87
|
-
icon: 'Lightbulb',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
key: 'clear_well_written',
|
|
91
|
-
label: 'com_ui_feedback_tag_clear_well_written',
|
|
92
|
-
direction: 'thumbsUp',
|
|
93
|
-
icon: 'PenTool',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
key: 'attention_to_detail',
|
|
97
|
-
label: 'com_ui_feedback_tag_attention_to_detail',
|
|
98
|
-
direction: 'thumbsUp',
|
|
99
|
-
icon: 'Search',
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
export function getTagsForRating(rating: TFeedbackRating): TFeedbackTag[] {
|
|
104
|
-
return FEEDBACK_TAGS.filter((tag) => tag.direction === rating);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const feedbackTagKeySchema = z.enum(FEEDBACK_REASON_KEYS);
|
|
108
|
-
export const feedbackRatingSchema = z.enum(FEEDBACK_RATINGS);
|
|
109
|
-
|
|
110
|
-
export const feedbackSchema = z.object({
|
|
111
|
-
rating: feedbackRatingSchema,
|
|
112
|
-
tag: feedbackTagKeySchema,
|
|
113
|
-
text: z.string().max(1024).optional(),
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
export type TMinimalFeedback = z.infer<typeof feedbackSchema>;
|
|
117
|
-
|
|
118
|
-
export type TFeedback = {
|
|
119
|
-
rating: TFeedbackRating;
|
|
120
|
-
tag: TFeedbackTag | undefined;
|
|
121
|
-
text?: string;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export function toMinimalFeedback(feedback: TFeedback | undefined): TMinimalFeedback | undefined {
|
|
125
|
-
if (!feedback?.rating || !feedback?.tag || !feedback.tag.key) {
|
|
126
|
-
return undefined;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
rating: feedback.rating,
|
|
131
|
-
tag: feedback.tag.key,
|
|
132
|
-
text: feedback.text,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function getTagByKey(key: TFeedbackTagKey | undefined): TFeedbackTag | undefined {
|
|
137
|
-
if (!key) {
|
|
138
|
-
return undefined;
|
|
139
|
-
}
|
|
140
|
-
return FEEDBACK_TAGS.find((tag) => tag.key === key);
|
|
141
|
-
}
|