Files
ragflow/web/src/components/max-token-number-from-field.tsx
chanx c21cea2038 Fix: Added table of contents extraction functionality and optimized form item layout #9869 (#10492)
### What problem does this PR solve?

Fix: Added table of contents extraction functionality and optimized form
item layout #9869

- Added `EnableTocToggle` component to toggle table of contents
extraction on and off
- Added multiple parser configuration components (such as naive, book,
laws, etc.), displaying different parser components based on built-in
slicing methods

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2025-10-11 18:45:55 +08:00

24 lines
654 B
TypeScript

import { FormLayout } from '@/constants/form';
import { useTranslate } from '@/hooks/common-hooks';
import { SliderInputFormField } from './slider-input-form-field';
interface IProps {
initialValue?: number;
max?: number;
}
export function MaxTokenNumberFormField({ max = 2048, initialValue }: IProps) {
const { t } = useTranslate('knowledgeConfiguration');
return (
<SliderInputFormField
name={'parser_config.chunk_token_num'}
label={t('chunkTokenNumber')}
tooltip={t('chunkTokenNumberTip')}
max={max}
defaultValue={initialValue ?? 0}
layout={FormLayout.Horizontal}
></SliderInputFormField>
);
}