mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🐛 fix: Ensure Default ModelSpecs Are Set Correctly (#5218)
* 🐛 fix: default modelSpecs not being set
* feat: Add imageDetail parameter for OpenAI endpoints in tQueryParamsSchema
* feat: Implement processModelSpecs function to enhance model specs processing from configuration
* feat: Refactor configuration schemas and types for improved structure and clarity
* feat: Add append_current_datetime parameter to tQueryParamsSchema for enhanced endpoint functionality
* fix: Add endpointType to getSaveOptions and enhance endpoint handling in Settings component
* fix: Change endpointType to be nullable and optional in tConversationSchema for improved flexibility
* fix: allow save & submit for google endpoint
This commit is contained in:
parent
916faf6447
commit
69a9b8b911
15 changed files with 201 additions and 148 deletions
|
|
@ -526,7 +526,7 @@ const DocumentType: z.ZodType<DocumentTypeValue> = z.lazy(() =>
|
|||
export const tConversationSchema = z.object({
|
||||
conversationId: z.string().nullable(),
|
||||
endpoint: eModelEndpointSchema.nullable(),
|
||||
endpointType: eModelEndpointSchema.optional(),
|
||||
endpointType: eModelEndpointSchema.nullable().optional(),
|
||||
isArchived: z.boolean().optional(),
|
||||
title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
|
||||
user: z.string().optional(),
|
||||
|
|
@ -559,9 +559,9 @@ export const tConversationSchema = z.object({
|
|||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
/* Files */
|
||||
resendFiles: z.boolean().optional(),
|
||||
file_ids: z.array(z.string()).optional(),
|
||||
/* vision */
|
||||
resendFiles: z.boolean().optional(),
|
||||
imageDetail: eImageDetailSchema.optional(),
|
||||
/* assistant */
|
||||
assistant_id: z.string().optional(),
|
||||
|
|
@ -571,16 +571,17 @@ export const tConversationSchema = z.object({
|
|||
region: z.string().optional(),
|
||||
maxTokens: coerceNumber.optional(),
|
||||
additionalModelRequestFields: DocumentType.optional(),
|
||||
/* assistant + agents */
|
||||
/* assistants */
|
||||
instructions: z.string().optional(),
|
||||
additional_instructions: z.string().optional(),
|
||||
append_current_datetime: z.boolean().optional(),
|
||||
/** Used to overwrite active conversation settings when saving a Preset */
|
||||
presetOverride: z.record(z.unknown()).optional(),
|
||||
stop: z.array(z.string()).optional(),
|
||||
/* frontend components */
|
||||
iconURL: z.string().optional(),
|
||||
greeting: z.string().optional(),
|
||||
spec: z.string().optional(),
|
||||
spec: z.string().nullable().optional(),
|
||||
iconURL: z.string().nullable().optional(),
|
||||
/*
|
||||
Deprecated fields
|
||||
*/
|
||||
|
|
@ -606,7 +607,6 @@ export const tConversationSchema = z.object({
|
|||
agentOptions: tAgentOptionsSchema.nullable().optional(),
|
||||
/** @deprecated Prefer `modelLabel` over `chatGptLabel` */
|
||||
chatGptLabel: z.string().nullable().optional(),
|
||||
append_current_datetime: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const tPresetSchema = tConversationSchema
|
||||
|
|
@ -642,6 +642,13 @@ export const tQueryParamsSchema = tConversationSchema
|
|||
* Whether or not to re-submit files from previous messages on subsequent messages
|
||||
* */
|
||||
resendFiles: true,
|
||||
/**
|
||||
* @endpoints openAI, custom, azureOpenAI
|
||||
*
|
||||
* System parameter that only affects the above endpoints.
|
||||
* Image detail for re-sizing according to OpenAI spec, defaults to `auto`
|
||||
* */
|
||||
imageDetail: true,
|
||||
/**
|
||||
* AKA Custom Instructions, dynamically added to chat history as a system message;
|
||||
* for `bedrock` endpoint, this is used as the `system` model param if the provider uses it;
|
||||
|
|
@ -681,6 +688,8 @@ export const tQueryParamsSchema = tConversationSchema
|
|||
agent_id: true,
|
||||
/** @endpoints assistants, azureAssistants */
|
||||
assistant_id: true,
|
||||
/** @endpoints assistants, azureAssistants */
|
||||
append_current_datetime: true,
|
||||
/**
|
||||
* @endpoints assistants, azureAssistants
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue