Feat: Fixed the chat model setting echo issue (#9521)

### What problem does this PR solve?

Feat: Fixed the chat model setting echo issue

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-08-18 12:03:33 +08:00
committed by GitHub
parent fb77f9917b
commit b08650bc4c
6 changed files with 88 additions and 25 deletions

View File

@ -1,9 +1,11 @@
import { LlmSettingSchema } from '@/components/llm-setting-items/next';
import {
LlmSettingEnabledSchema,
LlmSettingFieldSchema,
} from '@/components/llm-setting-items/next';
import { rerankFormSchema } from '@/components/rerank';
import { vectorSimilarityWeightSchema } from '@/components/similarity-slider';
import { topnSchema } from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { omit } from 'lodash';
import { z } from 'zod';
export function useChatSettingSchema() {
@ -39,20 +41,23 @@ export function useChatSettingSchema() {
}),
prompt_config: promptConfigSchema,
...rerankFormSchema,
llm_setting: z.object(omit(LlmSettingSchema, 'llm_id')),
llm_setting: z.object(LlmSettingFieldSchema),
...LlmSettingEnabledSchema,
llm_id: z.string().optional(),
...vectorSimilarityWeightSchema,
...topnSchema,
meta_data_filter: z
.object({
method: z.string().optional(),
manual: z.array(
z.object({
key: z.string(),
op: z.string(),
value: z.string(),
}),
),
manual: z
.array(
z.object({
key: z.string(),
op: z.string(),
value: z.string(),
}),
)
.optional(),
})
.optional(),
});