mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔧 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:
parent
98c96cd020
commit
2b37a44b8d
9 changed files with 258 additions and 133 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue