Implementation:Infiniflow Ragflow ChunkMethodForm Component
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Knowledge_Base |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Dynamic component dispatcher that renders the appropriate parser configuration form based on the currently selected parser ID.
Description
ChunkMethodForm reads the parser_id field from the parent FormContext via useWatch and resolves the corresponding configuration component from ConfigurationComponentMap. The map covers 15 parser types (Naive, QA, Resume, Manual, Table, Paper, Book, Laws, Presentation, Picture, One, Audio, Email, Tag, KnowledgeGraph). If the parser ID is not yet set, an EmptyComponent is rendered. The resolved component is memoized to avoid unnecessary re-renders.
Usage
Embedded within the dataset settings form to dynamically swap parser-specific configuration options when the user changes the chunk method.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/pages/dataset/dataset-setting/chunk-method-form.tsx
- Lines: 1-64
Signature
export function ChunkMethodForm(): JSX.Element;
Import
import { ChunkMethodForm } from './chunk-method-form';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (FormContext) | react-hook-form context | Yes | Parent form must provide parser_id field via FormProvider |
Outputs
| Name | Type | Description |
|---|---|---|
| JSX.Element | React element | The resolved parser configuration form component |
Usage Examples
<FormProvider {...form}>
<ChunkMethodForm />
</FormProvider>