Feat: Add FormSheet. #3221 (#5377)

### What problem does this PR solve?

Feat: Add FormSheet. #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-26 15:03:09 +08:00
committed by GitHub
parent 5c6a7cb4b8
commit 5859a3df72
10 changed files with 82 additions and 72 deletions

View File

@ -11,37 +11,44 @@ import {
FormMessage,
} from '@/components/ui/form';
import { Textarea } from '@/components/ui/textarea';
import { useTranslate } from '@/hooks/common-hooks';
import { useTranslation } from 'react-i18next';
import { INextOperatorForm } from '../../interface';
import { DynamicVariableForm } from '../components/next-dynamic-input-variable';
const RetrievalForm = ({ form, node }: INextOperatorForm) => {
const { t } = useTranslate('flow');
const { t } = useTranslation();
return (
<Form {...form}>
<DynamicVariableForm></DynamicVariableForm>
<SimilaritySliderFormField name="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
className="space-y-6"
onSubmit={(e) => {
e.preventDefault();
}}
>
<DynamicVariableForm></DynamicVariableForm>
<SimilaritySliderFormField name="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>
);
};