librechat-data-provider 0.6.1 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
package/src/config.ts CHANGED
@@ -306,6 +306,7 @@ export enum KnownEndpoints {
306
306
  cohere = 'cohere',
307
307
  fireworks = 'fireworks',
308
308
  groq = 'groq',
309
+ huggingface = 'huggingface',
309
310
  mistral = 'mistral',
310
311
  mlx = 'mlx',
311
312
  ollama = 'ollama',
package/src/schemas.ts CHANGED
@@ -280,6 +280,13 @@ export type TMessage = z.input<typeof tMessageSchema> & {
280
280
  files?: Partial<TFile>[];
281
281
  };
282
282
 
283
+ export const coerceNumber = z.union([z.number(), z.string()]).transform((val) => {
284
+ if (typeof val === 'string') {
285
+ return val.trim() === '' ? undefined : parseFloat(val);
286
+ }
287
+ return val;
288
+ });
289
+
283
290
  export const tConversationSchema = z.object({
284
291
  conversationId: z.string().nullable(),
285
292
  title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
@@ -315,8 +322,8 @@ export const tConversationSchema = z.object({
315
322
  maxOutputTokens: z.number().optional(),
316
323
  agentOptions: tAgentOptionsSchema.nullable().optional(),
317
324
  file_ids: z.array(z.string()).optional(),
318
- maxContextTokens: z.number().optional(),
319
- max_tokens: z.number().optional(),
325
+ maxContextTokens: coerceNumber.optional(),
326
+ max_tokens: coerceNumber.optional(),
320
327
  /** @deprecated */
321
328
  resendImages: z.boolean().optional(),
322
329
  /* vision */