mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: Fixed the issue that similarity threshold modification in chat and search configuration failed #3221 (#9821)
### What problem does this PR solve? Fix: Fixed the issue that similarity threshold modification in chat and search configuration failed #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -51,6 +51,7 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
|||||||
cross_languages: [],
|
cross_languages: [],
|
||||||
},
|
},
|
||||||
top_n: 8,
|
top_n: 8,
|
||||||
|
similarity_threshold: 0.2,
|
||||||
vector_similarity_weight: 0.2,
|
vector_similarity_weight: 0.2,
|
||||||
top_k: 1024,
|
top_k: 1024,
|
||||||
meta_data_filter: {
|
meta_data_filter: {
|
||||||
|
|||||||
@ -4,7 +4,10 @@ import {
|
|||||||
} from '@/components/llm-setting-items/next';
|
} from '@/components/llm-setting-items/next';
|
||||||
import { MetadataFilterSchema } from '@/components/metadata-filter';
|
import { MetadataFilterSchema } from '@/components/metadata-filter';
|
||||||
import { rerankFormSchema } from '@/components/rerank';
|
import { rerankFormSchema } from '@/components/rerank';
|
||||||
import { vectorSimilarityWeightSchema } from '@/components/similarity-slider';
|
import {
|
||||||
|
similarityThresholdSchema,
|
||||||
|
vectorSimilarityWeightSchema,
|
||||||
|
} from '@/components/similarity-slider';
|
||||||
import { topnSchema } from '@/components/top-n-item';
|
import { topnSchema } from '@/components/top-n-item';
|
||||||
import { useTranslate } from '@/hooks/common-hooks';
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@ -45,6 +48,7 @@ export function useChatSettingSchema() {
|
|||||||
...LlmSettingEnabledSchema,
|
...LlmSettingEnabledSchema,
|
||||||
llm_id: z.string().optional(),
|
llm_id: z.string().optional(),
|
||||||
...vectorSimilarityWeightSchema,
|
...vectorSimilarityWeightSchema,
|
||||||
|
...similarityThresholdSchema,
|
||||||
...topnSchema,
|
...topnSchema,
|
||||||
...MetadataFilterSchema,
|
...MetadataFilterSchema,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import {
|
|||||||
MetadataFilter,
|
MetadataFilter,
|
||||||
MetadataFilterSchema,
|
MetadataFilterSchema,
|
||||||
} from '@/components/metadata-filter';
|
} from '@/components/metadata-filter';
|
||||||
import { Input } from '@/components/originui/input';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { SingleFormSlider } from '@/components/ui/dual-range-slider';
|
import { SingleFormSlider } from '@/components/ui/dual-range-slider';
|
||||||
import {
|
import {
|
||||||
@ -16,6 +15,7 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from '@/components/ui/form';
|
} from '@/components/ui/form';
|
||||||
|
import { Input } from '@/components/ui/input';
|
||||||
import {
|
import {
|
||||||
MultiSelect,
|
MultiSelect,
|
||||||
MultiSelectOptionType,
|
MultiSelectOptionType,
|
||||||
@ -137,10 +137,10 @@ const SearchSetting: React.FC<SearchSettingProps> = ({
|
|||||||
llm_setting: {
|
llm_setting: {
|
||||||
llm_id: search_config?.chat_id || '',
|
llm_id: search_config?.chat_id || '',
|
||||||
parameter: llm_setting?.parameter,
|
parameter: llm_setting?.parameter,
|
||||||
temperature: llm_setting?.temperature,
|
temperature: llm_setting?.temperature || 0,
|
||||||
top_p: llm_setting?.top_p,
|
top_p: llm_setting?.top_p || 0,
|
||||||
frequency_penalty: llm_setting?.frequency_penalty,
|
frequency_penalty: llm_setting?.frequency_penalty || 0,
|
||||||
presence_penalty: llm_setting?.presence_penalty,
|
presence_penalty: llm_setting?.presence_penalty || 0,
|
||||||
temperatureEnabled: llm_setting?.temperature ? true : false,
|
temperatureEnabled: llm_setting?.temperature ? true : false,
|
||||||
topPEnabled: llm_setting?.top_p ? true : false,
|
topPEnabled: llm_setting?.top_p ? true : false,
|
||||||
presencePenaltyEnabled: llm_setting?.presence_penalty ? true : false,
|
presencePenaltyEnabled: llm_setting?.presence_penalty ? true : false,
|
||||||
|
|||||||
Reference in New Issue
Block a user