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

### 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)
This commit is contained in:
balibabu 2025-01-02 17:38:01 +08:00 committed by GitHub
parent 59a78408be
commit 5083d92998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -531,6 +531,7 @@ export const initialQWeatherValues = {
};
export const initialExeSqlValues = {
...initialLlmBaseValues,
db_type: 'mysql',
database: '',
username: '',

View File

@ -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';
@ -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'}

View File

@ -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,