Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow ChunkMethodForm Component

From Leeroopedia
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

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>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment