mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-17 11:09:06 +08:00
Feat: Fixed the issue where some fields in the chat configuration could not be displayed #3221 (#9430)
### What problem does this PR solve? Feat: Fixed the issue where some fields in the chat configuration could not be displayed #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
import { LlmSettingSchema } 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() {
|
||||
@ -9,13 +13,17 @@ export function useChatSettingSchema() {
|
||||
quote: z.boolean(),
|
||||
keyword: z.boolean(),
|
||||
tts: z.boolean(),
|
||||
empty_response: z.string().min(1, {
|
||||
message: t('emptyResponse'),
|
||||
}),
|
||||
prologue: z.string().min(1, {}),
|
||||
empty_response: z.string().optional(),
|
||||
prologue: z.string().optional(),
|
||||
system: z.string().min(1, { message: t('systemMessage') }),
|
||||
refine_multiturn: z.boolean(),
|
||||
use_kg: z.boolean(),
|
||||
parameters: z.array(
|
||||
z.object({
|
||||
key: z.string(),
|
||||
optional: z.boolean(),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
const formSchema = z.object({
|
||||
@ -29,10 +37,11 @@ export function useChatSettingSchema() {
|
||||
message: 'Username must be at least 1 characters.',
|
||||
}),
|
||||
prompt_config: promptConfigSchema,
|
||||
top_n: z.number(),
|
||||
vector_similarity_weight: z.number(),
|
||||
top_k: z.number(),
|
||||
llm_setting: z.object(LlmSettingSchema),
|
||||
...rerankFormSchema,
|
||||
llm_setting: z.object(omit(LlmSettingSchema, 'llm_id')),
|
||||
llm_id: z.string().optional(),
|
||||
...vectorSimilarityWeightSchema,
|
||||
...topnSchema,
|
||||
});
|
||||
|
||||
return formSchema;
|
||||
|
||||
Reference in New Issue
Block a user