🔧 fix: Preset Dialog Styling and Values (#2657)

* style: preset dialog styling

* refactor: coerce number input for convo schema

* refactor: replace dynamic input number with static component
This commit is contained in:
Danny Avila 2024-05-10 03:05:45 -04:00 committed by GitHub
parent 98c96cd020
commit 2b37a44b8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 258 additions and 133 deletions

View file

@ -1,6 +1,6 @@
{
"name": "librechat-data-provider",
"version": "0.6.1",
"version": "0.6.2",
"description": "data services for librechat apps",
"main": "dist/index.js",
"module": "dist/index.es.js",

View file

@ -280,6 +280,13 @@ export type TMessage = z.input<typeof tMessageSchema> & {
files?: Partial<TFile>[];
};
export const coerceNumber = z.union([z.number(), z.string()]).transform((val) => {
if (typeof val === 'string') {
return val.trim() === '' ? undefined : parseFloat(val);
}
return val;
});
export const tConversationSchema = z.object({
conversationId: z.string().nullable(),
title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
@ -315,8 +322,8 @@ export const tConversationSchema = z.object({
maxOutputTokens: z.number().optional(),
agentOptions: tAgentOptionsSchema.nullable().optional(),
file_ids: z.array(z.string()).optional(),
maxContextTokens: z.number().optional(),
max_tokens: z.number().optional(),
maxContextTokens: coerceNumber.optional(),
max_tokens: coerceNumber.optional(),
/** @deprecated */
resendImages: z.boolean().optional(),
/* vision */