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.
@@ -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';