mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 12:56:55 +08:00
### What problem does this PR solve? Feat: Replace antd with shadcn and delete the template node. #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
27 lines
633 B
TypeScript
27 lines
633 B
TypeScript
import { FormLayout } from '@/constants/form';
|
|
import { useTranslate } from '@/hooks/common-hooks';
|
|
import { z } from 'zod';
|
|
import { SliderInputFormField } from './slider-input-form-field';
|
|
|
|
interface SimilaritySliderFormFieldProps {
|
|
max?: number;
|
|
}
|
|
|
|
export const topnSchema = {
|
|
top_n: z.number().optional(),
|
|
};
|
|
|
|
export function TopNFormField({ max = 30 }: SimilaritySliderFormFieldProps) {
|
|
const { t } = useTranslate('chat');
|
|
|
|
return (
|
|
<SliderInputFormField
|
|
name={'top_n'}
|
|
label={t('topN')}
|
|
max={max}
|
|
tooltip={t('topNTip')}
|
|
layout={FormLayout.Vertical}
|
|
></SliderInputFormField>
|
|
);
|
|
}
|