balibabu commited on
Commit
1635b00
·
1 Parent(s): 1955ace

Feat: Add model id to ExeSql operator form. #1739 (#4333)

Browse files

### What problem does this PR solve?

Feat: Add model id to ExeSql operator form. #1739

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

web/src/pages/flow/constant.tsx CHANGED
@@ -531,6 +531,7 @@ export const initialQWeatherValues = {
531
  };
532
 
533
  export const initialExeSqlValues = {
 
534
  db_type: 'mysql',
535
  database: '',
536
  username: '',
 
531
  };
532
 
533
  export const initialExeSqlValues = {
534
+ ...initialLlmBaseValues,
535
  db_type: 'mysql',
536
  database: '',
537
  username: '',
web/src/pages/flow/form/exesql-form/index.tsx CHANGED
@@ -1,3 +1,4 @@
 
1
  import TopNItem from '@/components/top-n-item';
2
  import { useTranslate } from '@/hooks/common-hooks';
3
  import { useTestDbConnect } from '@/hooks/flow-hooks';
@@ -25,6 +26,13 @@ const ExeSQLForm = ({ onValuesChange, form, node }: IOperatorForm) => {
25
  layout={'vertical'}
26
  >
27
  <DynamicInputVariable node={node}></DynamicInputVariable>
 
 
 
 
 
 
 
28
  <Form.Item
29
  label={t('dbType')}
30
  name={'db_type'}
 
1
+ import LLMSelect from '@/components/llm-select';
2
  import TopNItem from '@/components/top-n-item';
3
  import { useTranslate } from '@/hooks/common-hooks';
4
  import { useTestDbConnect } from '@/hooks/flow-hooks';
 
26
  layout={'vertical'}
27
  >
28
  <DynamicInputVariable node={node}></DynamicInputVariable>
29
+ <Form.Item
30
+ name={'llm_id'}
31
+ label={t('model', { keyPrefix: 'chat' })}
32
+ tooltip={t('modelTip', { keyPrefix: 'chat' })}
33
+ >
34
+ <LLMSelect></LLMSelect>
35
+ </Form.Item>
36
  <Form.Item
37
  label={t('dbType')}
38
  name={'db_type'}
web/src/pages/flow/hooks.tsx CHANGED
@@ -129,7 +129,7 @@ export const useInitializeOperatorParams = () => {
129
  [Operator.GitHub]: initialGithubValues,
130
  [Operator.BaiduFanyi]: initialBaiduFanyiValues,
131
  [Operator.QWeather]: initialQWeatherValues,
132
- [Operator.ExeSQL]: initialExeSqlValues,
133
  [Operator.Switch]: initialSwitchValues,
134
  [Operator.WenCai]: initialWenCaiValues,
135
  [Operator.AkShare]: initialAkShareValues,
 
129
  [Operator.GitHub]: initialGithubValues,
130
  [Operator.BaiduFanyi]: initialBaiduFanyiValues,
131
  [Operator.QWeather]: initialQWeatherValues,
132
+ [Operator.ExeSQL]: { ...initialExeSqlValues, llm_id: llmId },
133
  [Operator.Switch]: initialSwitchValues,
134
  [Operator.WenCai]: initialWenCaiValues,
135
  [Operator.AkShare]: initialAkShareValues,