mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-05-23 13:09:21 +08:00

### What problem does this PR solve? Feat: Wrap DynamicVariableForm with Collapsible. #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
import { KnowledgeBaseFormField } from '@/components/knowledge-base-item';
|
|
import { RerankFormFields } from '@/components/rerank';
|
|
import { SimilaritySliderFormField } from '@/components/similarity-slider';
|
|
import { TopNFormField } from '@/components/top-n-item';
|
|
import {
|
|
Form,
|
|
FormControl,
|
|
FormField,
|
|
FormItem,
|
|
FormLabel,
|
|
FormMessage,
|
|
} from '@/components/ui/form';
|
|
import { Textarea } from '@/components/ui/textarea';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { INextOperatorForm } from '../../interface';
|
|
import { DynamicInputVariable } from '../components/next-dynamic-input-variable';
|
|
|
|
const RetrievalForm = ({ form, node }: INextOperatorForm) => {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<Form {...form}>
|
|
<form
|
|
className="space-y-6"
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
}}
|
|
>
|
|
<DynamicInputVariable node={node}></DynamicInputVariable>
|
|
<SimilaritySliderFormField vectorSimilarityWeightName="keywords_similarity_weight"></SimilaritySliderFormField>
|
|
<TopNFormField></TopNFormField>
|
|
<RerankFormFields></RerankFormFields>
|
|
<KnowledgeBaseFormField></KnowledgeBaseFormField>
|
|
<FormField
|
|
control={form.control}
|
|
name="empty_response"
|
|
render={({ field }) => (
|
|
<FormItem>
|
|
<FormLabel>{t('chat.emptyResponse')}</FormLabel>
|
|
<FormControl>
|
|
<Textarea
|
|
placeholder={t('common.namePlaceholder')}
|
|
{...field}
|
|
autoComplete="off"
|
|
rows={4}
|
|
/>
|
|
</FormControl>
|
|
<FormMessage />
|
|
</FormItem>
|
|
)}
|
|
/>
|
|
</form>
|
|
</Form>
|
|
);
|
|
};
|
|
|
|
export default RetrievalForm;
|