ragflow/web/src/components/max-token-number-from-field.tsx
chanx a0ccbec8bd
Fix: knowledge base's embedded model form layout and dependency imports in the main branch. #9869 (#10160)
### What problem does this PR solve?

Fix: Fixed the knowledge base's embedded model form layout and
dependency imports in the main branch.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2025-09-19 09:57:21 +08:00

23 lines
652 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.Vertical}
></SliderInputFormField>
);
}