librechat-data-provider 0.7.3 → 0.7.5
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/dist/react-query/package.json +1 -1
- package/package.json +3 -3
- package/react-query/package.json +1 -1
- package/specs/actions.spec.ts +276 -1
- package/specs/openapiSpecs.ts +127 -0
- package/src/actions.ts +108 -25
- package/src/api-endpoints.ts +36 -2
- package/src/artifacts.ts +3104 -0
- package/src/bedrock.ts +147 -0
- package/src/config.ts +185 -23
- package/src/data-service.ts +247 -78
- package/src/file-config.ts +4 -1
- package/src/generate.ts +30 -1
- package/src/index.ts +5 -0
- package/src/keys.ts +11 -0
- package/src/parsers.ts +85 -27
- package/src/react-query/react-query-service.ts +25 -0
- package/src/request.ts +3 -0
- package/src/roles.ts +59 -2
- package/src/schemas.ts +361 -173
- package/src/types/agents.ts +220 -0
- package/src/types/assistants.ts +150 -27
- package/src/types/files.ts +5 -0
- package/src/types/mutations.ts +75 -0
- package/src/types/queries.ts +6 -2
- package/src/types/runs.ts +22 -0
- package/src/types.ts +59 -3
package/src/api-endpoints.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AssistantsEndpoint } from './schemas';
|
|
2
2
|
|
|
3
|
+
export const health = () => '/health';
|
|
3
4
|
export const user = () => '/api/user';
|
|
4
5
|
|
|
5
6
|
export const balance = () => '/api/balance';
|
|
@@ -32,8 +33,10 @@ export const abortRequest = (endpoint: string) => `/api/ask/${endpoint}/abort`;
|
|
|
32
33
|
|
|
33
34
|
export const conversationsRoot = '/api/convos';
|
|
34
35
|
|
|
35
|
-
export const conversations = (pageNumber: string, isArchived?: boolean) =>
|
|
36
|
-
`${conversationsRoot}?pageNumber=${pageNumber}${isArchived ? '&isArchived=true' : ''}
|
|
36
|
+
export const conversations = (pageNumber: string, isArchived?: boolean, tags?: string[]) =>
|
|
37
|
+
`${conversationsRoot}?pageNumber=${pageNumber}${isArchived ? '&isArchived=true' : ''}${tags
|
|
38
|
+
?.map((tag) => `&tags=${tag}`)
|
|
39
|
+
.join('')}`;
|
|
37
40
|
|
|
38
41
|
export const conversationById = (id: string) => `${conversationsRoot}/${id}`;
|
|
39
42
|
|
|
@@ -122,6 +125,21 @@ export const assistants = ({
|
|
|
122
125
|
return url;
|
|
123
126
|
};
|
|
124
127
|
|
|
128
|
+
export const agents = ({ path, options }: { path?: string; options?: object }) => {
|
|
129
|
+
let url = '/api/agents';
|
|
130
|
+
|
|
131
|
+
if (path) {
|
|
132
|
+
url += `/${path}`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (options && Object.keys(options).length > 0) {
|
|
136
|
+
const queryParams = new URLSearchParams(options as Record<string, string>).toString();
|
|
137
|
+
url += `?${queryParams}`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return url;
|
|
141
|
+
};
|
|
142
|
+
|
|
125
143
|
export const files = () => '/api/files';
|
|
126
144
|
|
|
127
145
|
export const images = () => `${files()}/images`;
|
|
@@ -188,3 +206,19 @@ export const roles = () => '/api/roles';
|
|
|
188
206
|
export const getRole = (roleName: string) => `${roles()}/${roleName.toLowerCase()}`;
|
|
189
207
|
export const updatePromptPermissions = (roleName: string) =>
|
|
190
208
|
`${roles()}/${roleName.toLowerCase()}/prompts`;
|
|
209
|
+
|
|
210
|
+
/* Conversation Tags */
|
|
211
|
+
export const conversationTags = (tag?: string) =>
|
|
212
|
+
`/api/tags${tag != null && tag ? `/${encodeURIComponent(tag)}` : ''}`;
|
|
213
|
+
|
|
214
|
+
export const conversationTagsList = (pageNumber: string, sort?: string, order?: string) =>
|
|
215
|
+
`${conversationTags()}/list?pageNumber=${pageNumber}${sort ? `&sort=${sort}` : ''}${
|
|
216
|
+
order ? `&order=${order}` : ''
|
|
217
|
+
}`;
|
|
218
|
+
|
|
219
|
+
export const addTagToConversation = (conversationId: string) =>
|
|
220
|
+
`${conversationTags()}/convo/${conversationId}`;
|
|
221
|
+
|
|
222
|
+
export const userTerms = () => '/api/user/terms';
|
|
223
|
+
export const acceptUserTerms = () => '/api/user/terms/accept';
|
|
224
|
+
export const banner = () => '/api/banner';
|