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/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/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/schemas.ts +9 -2
package/package.json
CHANGED
package/src/config.ts
CHANGED
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:
|
|
319
|
-
max_tokens:
|
|
325
|
+
maxContextTokens: coerceNumber.optional(),
|
|
326
|
+
max_tokens: coerceNumber.optional(),
|
|
320
327
|
/** @deprecated */
|
|
321
328
|
resendImages: z.boolean().optional(),
|
|
322
329
|
/* vision */
|