Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

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

balibabu5083d92998d3
diff --git a/web/src/pages/flow/constant.tsx b/web/src/pages/flow/constant.tsx
index 9b3d76cc47..5d4a664609 100644
--- a/web/src/pages/flow/constant.tsx
+++ b/web/src/pages/flow/constant.tsx
@@ -531,6 +531,7 @@ export const initialQWeatherValues = {
};
export const initialExeSqlValues = {
+ ...initialLlmBaseValues,
db_type: 'mysql',
database: '',
username: '',
diff --git a/web/src/pages/flow/form/exesql-form/index.tsx b/web/src/pages/flow/form/exesql-form/index.tsx
index 010d5518ed..f88f593d0b 100644
--- a/web/src/pages/flow/form/exesql-form/index.tsx
+++ b/web/src/pages/flow/form/exesql-form/index.tsx
@@ -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'}
diff --git a/web/src/pages/flow/hooks.tsx b/web/src/pages/flow/hooks.tsx
index 177b24cfb4..eecd3b4cda 100644
--- a/web/src/pages/flow/hooks.tsx
+++ b/web/src/pages/flow/hooks.tsx
@@ -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,