librechat-data-provider 0.2.1 → 0.3.0
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 +2 -1216
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2 -1304
- package/dist/index.js.map +1 -0
- package/dist/react-query/index.es.js +2 -0
- package/dist/react-query/index.es.js.map +1 -0
- package/dist/react-query/package.json +10 -0
- package/package.json +22 -5
- package/react-query/package.json +10 -0
- package/rollup.config.js +61 -4
- package/src/api-endpoints.ts +9 -1
- package/src/createPayload.ts +20 -17
- package/src/data-service.ts +61 -15
- package/src/index.ts +10 -3
- package/src/keys.ts +27 -0
- package/src/react-query/assistants.ts +138 -0
- package/src/react-query/index.ts +2 -0
- package/src/{react-query-service.ts → react-query/react-query-service.ts} +72 -75
- package/src/request.ts +67 -63
- package/src/schemas.ts +404 -30
- package/src/sse.js +2 -2
- package/src/types/assistants.ts +72 -0
- package/src/types/files.ts +42 -0
- package/src/types/mutations.ts +28 -0
- package/src/types.ts +5 -5
- package/tsconfig.json +6 -4
- package/types/api-endpoints.d.ts +0 -30
- package/types/createPayload.d.ts +0 -39
- package/types/data-service.d.ts +0 -35
- package/types/headers-helpers.d.ts +0 -2
- package/types/index.d.ts +0 -7
- package/types/react-query-service.d.ts +0 -58
- package/types/request.d.ts +0 -18
- package/types/schemas.d.ts +0 -1763
- package/types/types.d.ts +0 -164
package/types/types.d.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
2
|
-
import type { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import type { TResPlugin, TMessage, TConversation, TEndpointOption } from './schemas';
|
|
4
|
-
export type TOpenAIMessage = OpenAI.Chat.ChatCompletionMessageParam;
|
|
5
|
-
export type TOpenAIFunction = OpenAI.Chat.ChatCompletionCreateParams.Function;
|
|
6
|
-
export type TOpenAIFunctionCall = OpenAI.Chat.ChatCompletionCreateParams.FunctionCallOption;
|
|
7
|
-
export type TMutation = UseMutationResult<unknown>;
|
|
8
|
-
export * from './schemas';
|
|
9
|
-
export type TMessages = TMessage[];
|
|
10
|
-
export type TMessagesAtom = TMessages | null;
|
|
11
|
-
export type TSubmission = {
|
|
12
|
-
plugin?: TResPlugin;
|
|
13
|
-
plugins?: TResPlugin[];
|
|
14
|
-
message: TMessage;
|
|
15
|
-
isEdited?: boolean;
|
|
16
|
-
isContinued?: boolean;
|
|
17
|
-
messages: TMessage[];
|
|
18
|
-
isRegenerate?: boolean;
|
|
19
|
-
conversationId?: string;
|
|
20
|
-
initialResponse: TMessage;
|
|
21
|
-
conversation: TConversation;
|
|
22
|
-
endpointOption: TEndpointOption;
|
|
23
|
-
};
|
|
24
|
-
export type TPluginAction = {
|
|
25
|
-
pluginKey: string;
|
|
26
|
-
action: 'install' | 'uninstall';
|
|
27
|
-
auth?: unknown;
|
|
28
|
-
};
|
|
29
|
-
export type TUpdateUserPlugins = {
|
|
30
|
-
pluginKey: string;
|
|
31
|
-
action: string;
|
|
32
|
-
auth?: unknown;
|
|
33
|
-
};
|
|
34
|
-
export type TError = {
|
|
35
|
-
message: string;
|
|
36
|
-
code?: number;
|
|
37
|
-
response?: {
|
|
38
|
-
data?: {
|
|
39
|
-
message?: string;
|
|
40
|
-
};
|
|
41
|
-
status?: number;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export type TUser = {
|
|
45
|
-
id: string;
|
|
46
|
-
username: string;
|
|
47
|
-
email: string;
|
|
48
|
-
name: string;
|
|
49
|
-
avatar: string;
|
|
50
|
-
role: string;
|
|
51
|
-
provider: string;
|
|
52
|
-
plugins: string[];
|
|
53
|
-
createdAt: string;
|
|
54
|
-
updatedAt: string;
|
|
55
|
-
};
|
|
56
|
-
export type TGetConversationsResponse = {
|
|
57
|
-
conversations: TConversation[];
|
|
58
|
-
pageNumber: string;
|
|
59
|
-
pageSize: string | number;
|
|
60
|
-
pages: string | number;
|
|
61
|
-
};
|
|
62
|
-
export type TUpdateMessageRequest = {
|
|
63
|
-
conversationId: string;
|
|
64
|
-
messageId: string;
|
|
65
|
-
model: string;
|
|
66
|
-
text: string;
|
|
67
|
-
};
|
|
68
|
-
export type TUpdateUserKeyRequest = {
|
|
69
|
-
name: string;
|
|
70
|
-
value: string;
|
|
71
|
-
expiresAt: string;
|
|
72
|
-
};
|
|
73
|
-
export type TUpdateConversationRequest = {
|
|
74
|
-
conversationId: string;
|
|
75
|
-
title: string;
|
|
76
|
-
};
|
|
77
|
-
export type TUpdateConversationResponse = {
|
|
78
|
-
data: TConversation;
|
|
79
|
-
};
|
|
80
|
-
export type TDeleteConversationRequest = {
|
|
81
|
-
conversationId?: string;
|
|
82
|
-
source?: string;
|
|
83
|
-
};
|
|
84
|
-
export type TDeleteConversationResponse = {
|
|
85
|
-
acknowledged: boolean;
|
|
86
|
-
deletedCount: number;
|
|
87
|
-
messages: {
|
|
88
|
-
acknowledged: boolean;
|
|
89
|
-
deletedCount: number;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export type TSearchResults = {
|
|
93
|
-
conversations: TConversation[];
|
|
94
|
-
messages: TMessage[];
|
|
95
|
-
pageNumber: string;
|
|
96
|
-
pageSize: string | number;
|
|
97
|
-
pages: string | number;
|
|
98
|
-
filter: object;
|
|
99
|
-
};
|
|
100
|
-
export type TConfig = {
|
|
101
|
-
availableModels?: [];
|
|
102
|
-
userProvide?: boolean | null;
|
|
103
|
-
availableTools?: [];
|
|
104
|
-
plugins?: [];
|
|
105
|
-
azure?: boolean;
|
|
106
|
-
};
|
|
107
|
-
export type TModelsConfig = Record<string, string[]>;
|
|
108
|
-
export type TEndpointsConfig = Record<string, TConfig | null>;
|
|
109
|
-
export type TUpdateTokenCountResponse = {
|
|
110
|
-
count: number;
|
|
111
|
-
};
|
|
112
|
-
export type TMessageTreeNode = object;
|
|
113
|
-
export type TSearchMessage = object;
|
|
114
|
-
export type TSearchMessageTreeNode = object;
|
|
115
|
-
export type TRegisterUser = {
|
|
116
|
-
name: string;
|
|
117
|
-
email: string;
|
|
118
|
-
username: string;
|
|
119
|
-
password: string;
|
|
120
|
-
confirm_password?: string;
|
|
121
|
-
};
|
|
122
|
-
export type TLoginUser = {
|
|
123
|
-
email: string;
|
|
124
|
-
password: string;
|
|
125
|
-
};
|
|
126
|
-
export type TLoginResponse = {
|
|
127
|
-
token: string;
|
|
128
|
-
user: TUser;
|
|
129
|
-
};
|
|
130
|
-
export type TRequestPasswordReset = {
|
|
131
|
-
email: string;
|
|
132
|
-
};
|
|
133
|
-
export type TResetPassword = {
|
|
134
|
-
userId: string;
|
|
135
|
-
token: string;
|
|
136
|
-
password: string;
|
|
137
|
-
confirm_password?: string;
|
|
138
|
-
};
|
|
139
|
-
export type TStartupConfig = {
|
|
140
|
-
appTitle: string;
|
|
141
|
-
googleLoginEnabled: boolean;
|
|
142
|
-
facebookLoginEnabled: boolean;
|
|
143
|
-
openidLoginEnabled: boolean;
|
|
144
|
-
githubLoginEnabled: boolean;
|
|
145
|
-
openidLabel: string;
|
|
146
|
-
openidImageUrl: string;
|
|
147
|
-
discordLoginEnabled: boolean;
|
|
148
|
-
serverDomain: string;
|
|
149
|
-
registrationEnabled: boolean;
|
|
150
|
-
socialLoginEnabled: boolean;
|
|
151
|
-
emailEnabled: boolean;
|
|
152
|
-
checkBalance: boolean;
|
|
153
|
-
};
|
|
154
|
-
export type TRefreshTokenResponse = {
|
|
155
|
-
token: string;
|
|
156
|
-
user: TUser;
|
|
157
|
-
};
|
|
158
|
-
export type TCheckUserKeyResponse = {
|
|
159
|
-
expiresAt: string;
|
|
160
|
-
};
|
|
161
|
-
export type TRequestPasswordResetResponse = {
|
|
162
|
-
link?: string;
|
|
163
|
-
message?: string;
|
|
164
|
-
};
|