mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-24 04:10:15 +01:00
🛡️ fix: Preset and Validation Logic for URL Query Params (#7407)
* chore(store/families): linting * refactor: Update `createChatSearchParams` to use `tQueryParamsSchema` for allowed parameters and add `modelLabel` to schema * refactor: Enhance `useQueryParams` to streamline parameter processing and improve submission handling * chore: linting * fix: Add `disableParams` option to conversation handling and related schemas to prevent search params from updating due to use of default preset * fix: Update `createChatSearchParams` to correctly ignore `agent_id` when it matches `EPHEMERAL_AGENT_ID` * chore: revert modelLabel addition to query params, as no longer necessary due to `disableParams` * fix: Refine logic for `disableParams` to ensure correct handling of active preset comparison * fix: Add `disableParams` option to `NewConversationParams` and update related hooks for preset handling * fix: Refactor validation logic in `validateSettingDefinitions` to improve handling of `includeInput` and update conversation schema * fix: Bump version of `librechat-data-provider` to 0.7.83
This commit is contained in:
parent
7a91f6ca62
commit
2f4a03b581
13 changed files with 126 additions and 112 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "librechat-data-provider",
|
||||
"version": "0.7.82",
|
||||
"version": "0.7.83",
|
||||
"description": "data services for librechat apps",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.es.js",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ export const excludedKeys = new Set([
|
|||
'model',
|
||||
'files',
|
||||
'spec',
|
||||
'disableParams',
|
||||
]);
|
||||
|
||||
export enum SettingsViews {
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ export function validateSettingDefinitions(settings: SettingsConfiguration): voi
|
|||
// continue;
|
||||
}
|
||||
setting.includeInput =
|
||||
setting.type === SettingTypes.Number ? setting.includeInput ?? true : false; // Default to true if type is number
|
||||
setting.type === SettingTypes.Number ? (setting.includeInput ?? true) : false; // Default to true if type is number
|
||||
}
|
||||
|
||||
if (setting.component === ComponentTypes.Slider && setting.type === SettingTypes.Number) {
|
||||
|
|
@ -445,7 +445,8 @@ export function validateSettingDefinitions(settings: SettingsConfiguration): voi
|
|||
|
||||
// Validate optionType and conversation schema
|
||||
if (setting.optionType !== OptionTypes.Custom) {
|
||||
const conversationSchema = tConversationSchema.shape[setting.key as keyof TConversation];
|
||||
const conversationSchema =
|
||||
tConversationSchema.shape[setting.key as keyof Omit<TConversation, 'disableParams'>];
|
||||
if (!conversationSchema) {
|
||||
errors.push({
|
||||
code: ZodIssueCode.custom,
|
||||
|
|
|
|||
|
|
@ -745,6 +745,7 @@ export type TSetOption = (
|
|||
|
||||
export type TConversation = z.infer<typeof tConversationSchema> & {
|
||||
presetOverride?: Partial<TPreset>;
|
||||
disableParams?: boolean;
|
||||
};
|
||||
|
||||
export const tSharedLinkSchema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue