Skip to content

Commit

Permalink
Feat: Add model id to ExeSql operator form. #1739 (#4333)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
cike8899 authored Jan 2, 2025
1 parent 59a7840 commit 5083d92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/src/pages/flow/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ export const initialQWeatherValues = {
};

export const initialExeSqlValues = {
...initialLlmBaseValues,
db_type: 'mysql',
database: '',
username: '',
Expand Down
8 changes: 8 additions & 0 deletions web/src/pages/flow/form/exesql-form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import LLMSelect from '@/components/llm-select';
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { useTestDbConnect } from '@/hooks/flow-hooks';
Expand Down Expand Up @@ -25,6 +26,13 @@ const ExeSQLForm = ({ onValuesChange, form, node }: IOperatorForm) => {
layout={'vertical'}
>
<DynamicInputVariable node={node}></DynamicInputVariable>
<Form.Item
name={'llm_id'}
label={t('model', { keyPrefix: 'chat' })}
tooltip={t('modelTip', { keyPrefix: 'chat' })}
>
<LLMSelect></LLMSelect>
</Form.Item>
<Form.Item
label={t('dbType')}
name={'db_type'}
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/flow/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const useInitializeOperatorParams = () => {
[Operator.GitHub]: initialGithubValues,
[Operator.BaiduFanyi]: initialBaiduFanyiValues,
[Operator.QWeather]: initialQWeatherValues,
[Operator.ExeSQL]: initialExeSqlValues,
[Operator.ExeSQL]: { ...initialExeSqlValues, llm_id: llmId },
[Operator.Switch]: initialSwitchValues,
[Operator.WenCai]: initialWenCaiValues,
[Operator.AkShare]: initialAkShareValues,
Expand Down

0 comments on commit 5083d92

Please sign in to comment.