File size: 957 Bytes
badd5fe 8c4ec99 830bf29 badd5fe 8c4ec99 badd5fe 8c4ec99 badd5fe 830bf29 8c4ec99 badd5fe 8c4ec99 830bf29 badd5fe 8c4ec99 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import { useTranslate } from '@/hooks/commonHooks';
import { Form, Slider } from 'antd';
type FieldType = {
similarity_threshold?: number;
vector_similarity_weight?: number;
};
interface IProps {
isTooltipShown?: boolean;
}
const SimilaritySlider = ({ isTooltipShown = false }: 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<FieldType>
label={t('vectorSimilarityWeight')}
name={'vector_similarity_weight'}
initialValue={0.3}
tooltip={isTooltipShown && t('vectorSimilarityWeightTip')}
>
<Slider max={1} step={0.01} />
</Form.Item>
</>
);
};
export default SimilaritySlider;
|