mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-31 21:01:59 +08:00

### What problem does this PR solve? Feat: Add TagTable #4367 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { useTranslate } from '@/hooks/common-hooks';
|
|
import { Flex, Form, InputNumber, Slider } from 'antd';
|
|
|
|
interface IProps {
|
|
initialValue?: number;
|
|
max?: number;
|
|
}
|
|
|
|
const MaxTokenNumber = ({ initialValue = 128, max = 2048 }: IProps) => {
|
|
const { t } = useTranslate('knowledgeConfiguration');
|
|
|
|
return (
|
|
<Form.Item label={t('chunkTokenNumber')} tooltip={t('chunkTokenNumberTip')}>
|
|
<Flex gap={20} align="center">
|
|
<Flex flex={1}>
|
|
<Form.Item
|
|
name={['parser_config', 'chunk_token_num']}
|
|
noStyle
|
|
initialValue={initialValue}
|
|
rules={[{ required: true, message: t('chunkTokenNumberMessage') }]}
|
|
>
|
|
<Slider max={max} style={{ width: '100%' }} />
|
|
</Form.Item>
|
|
</Flex>
|
|
<Form.Item
|
|
name={['parser_config', 'chunk_token_num']}
|
|
noStyle
|
|
rules={[{ required: true, message: t('chunkTokenNumberMessage') }]}
|
|
>
|
|
<InputNumber max={max} min={0} />
|
|
</Form.Item>
|
|
</Flex>
|
|
</Form.Item>
|
|
);
|
|
};
|
|
|
|
export default MaxTokenNumber;
|