You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { NextLLMSelect } from '@/components/llm-select/next';
  2. import { MessageHistoryWindowSizeFormField } from '@/components/message-history-window-size-item';
  3. import {
  4. Form,
  5. FormControl,
  6. FormField,
  7. FormItem,
  8. FormLabel,
  9. FormMessage,
  10. } from '@/components/ui/form';
  11. import { RAGFlowSelect } from '@/components/ui/select';
  12. import { useTranslation } from 'react-i18next';
  13. import { GoogleLanguageOptions } from '../../constant';
  14. import { INextOperatorForm } from '../../interface';
  15. const RewriteQuestionForm = ({ form }: INextOperatorForm) => {
  16. const { t } = useTranslation();
  17. return (
  18. <Form {...form}>
  19. <form
  20. className="space-y-6"
  21. onSubmit={(e) => {
  22. e.preventDefault();
  23. }}
  24. >
  25. <FormField
  26. control={form.control}
  27. name="llm_id"
  28. render={({ field }) => (
  29. <FormItem>
  30. <FormLabel tooltip={t('chat.modelTip')}>
  31. {t('chat.model')}
  32. </FormLabel>
  33. <FormControl>
  34. <NextLLMSelect {...field} />
  35. </FormControl>
  36. <FormMessage />
  37. </FormItem>
  38. )}
  39. />
  40. <FormField
  41. control={form.control}
  42. name="language"
  43. render={({ field }) => (
  44. <FormItem>
  45. <FormLabel tooltip={t('chat.languageTip')}>
  46. {t('chat.language')}
  47. </FormLabel>
  48. <FormControl>
  49. <RAGFlowSelect
  50. options={GoogleLanguageOptions}
  51. allowClear={true}
  52. {...field}
  53. ></RAGFlowSelect>
  54. </FormControl>
  55. <FormMessage />
  56. </FormItem>
  57. )}
  58. />
  59. <MessageHistoryWindowSizeFormField></MessageHistoryWindowSizeFormField>
  60. </form>
  61. </Form>
  62. );
  63. };
  64. export default RewriteQuestionForm;