mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: change all file names to lowercase #1574 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { useTranslate } from '@/hooks/common-hooks';
|
|
import { Form, Slider } from 'antd';
|
|
|
|
type FieldType = {
|
|
similarity_threshold?: number;
|
|
// vector_similarity_weight?: number;
|
|
};
|
|
|
|
interface IProps {
|
|
isTooltipShown?: boolean;
|
|
vectorSimilarityWeightName?: string;
|
|
}
|
|
|
|
const SimilaritySlider = ({
|
|
isTooltipShown = false,
|
|
vectorSimilarityWeightName = 'vector_similarity_weight',
|
|
}: IProps) => {
|
|
const { t } = useTranslate('knowledgeDetails');
|
|
|
|
return (
|
|
<>
|
|
<Form.Item<FieldType>
|
|
label={t('similarityThreshold')}
|
|
name={'similarity_threshold'}
|
|
tooltip={isTooltipShown && t('similarityThresholdTip')}
|
|
initialValue={0.2}
|
|
>
|
|
<Slider max={1} step={0.01} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t('vectorSimilarityWeight')}
|
|
name={vectorSimilarityWeightName}
|
|
initialValue={1 - 0.3}
|
|
tooltip={isTooltipShown && t('vectorSimilarityWeightTip')}
|
|
>
|
|
<Slider max={1} step={0.01} />
|
|
</Form.Item>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default SimilaritySlider;
|