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 TestingForm Component

From Leeroopedia
Revision as of 11:22, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Infiniflow_Ragflow_TestingForm_Component.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Frontend, Knowledge_Base
Last Updated 2026-02-12 06:00 GMT

Overview

Complex retrieval testing form with synced watched values for similarity, reranking, knowledge graph, cross-language, and metadata filter parameters.

Description

TestingForm builds a Zod schema composing multiple sub-schemas (similarityThresholdSchema, vectorSimilarityWeightSchema, topKSchema, MetadataFilterSchema) plus question and use_kg fields. It uses react-hook-form with zodResolver and initializes with default values for all slider fields plus kb_ids from route params. The form watches all values via useWatch and syncs them to the parent via setValues in a useEffect. It renders SimilaritySliderFormField, RerankFormFields, UseKnowledgeGraphFormField, CrossLanguageFormField, MetadataFilter, a question Textarea, and a submit ButtonLoading (disabled when question is empty).

Usage

Rendered on the dataset testing page to configure retrieval parameters and submit test queries against the knowledge base.

Code Reference

Source Location

Signature

export default function TestingForm({
  loading, refetch, setValues,
}: Pick<ReturnType<typeof useTestRetrieval>, 'loading' | 'refetch' | 'setValues'>): JSX.Element;

Import

import TestingForm from './testing-form';

I/O Contract

Inputs

Name Type Required Description
loading boolean Yes Query loading state
refetch function Yes Trigger test retrieval
setValues function Yes Sync form values to parent state

Outputs

Name Type Description
JSX.Element React element Full testing configuration form with submit button

Usage Examples

const { loading, refetch, setValues } = useTestRetrieval();
<TestingForm loading={loading} refetch={refetch} setValues={setValues} />

Related Pages

Page Connections

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