Skip to content

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

feat: If the model supplier is not set, click the OK button to jump directly to the page for setting the model supplier. #3068 (#3069)

balibabu1c364e0e5c3a
diff --git a/web/src/hooks/user-setting-hooks.tsx b/web/src/hooks/user-setting-hooks.tsx
index 9b0288cfd5..e27646bfdf 100644
--- a/web/src/hooks/user-setting-hooks.tsx
+++ b/web/src/hooks/user-setting-hooks.tsx
@@ -21,6 +21,7 @@ import DOMPurify from 'dompurify';
import { isEmpty } from 'lodash';
import { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import { history } from 'umi';
export const useFetchUserInfo = (): ResponseGetType<IUserInfo> => {
const { i18n } = useTranslation();
@@ -67,6 +68,9 @@ export const useFetchTenantInfo = (): ResponseGetType<ITenantInfo> => {
}}
></div>
),
+ onOk() {
+ history.push('/user-setting/model');
+ },
});
}
data.chat_id = data.llm_id;
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index d313c27a13..e47823b917 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -586,8 +586,7 @@ The above is the content you need to summarize.`,
'Please input Google Cloud Service Account Key in base64 format',
addGoogleRegion: 'Google Cloud Region',
GoogleRegionMessage: 'Please input Google Cloud Region',
- modelProvidersWarn:
- 'Please add both embedding model and LLM in <b>Settings > Model providers</b> firstly.',
+ modelProvidersWarn: `Please add both embedding model and LLM in <b>Settings > Model providers</b> firstly. Then, set them in 'System model settings'.`,
apiVersion: 'API-Version',
apiVersionMessage: 'Please input API version',
add: 'Add',
diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts
index f805739996..cee0e361d4 100644
--- a/web/src/locales/zh-traditional.ts
+++ b/web/src/locales/zh-traditional.ts
@@ -544,8 +544,7 @@ export default {
'請輸入 Google Cloud Service Account Key in base64 format',
addGoogleRegion: 'Google Cloud 區域',
GoogleRegionMessage: '請輸入 Google Cloud 區域',
- modelProvidersWarn:
- '請先在 <b>「設定」>「模型提供者」</b> 中新增嵌入模型和LLM。',
+ modelProvidersWarn: `請先在<b>設定>模型提供者</b>中新增嵌入模型和LLM。然後,在「系統模型設定」中設定它們。`,
add: '添加',
updateDate: '更新日期',
role: '角色',
diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts
index f991a8c7af..3e12ab833a 100644
--- a/web/src/locales/zh.ts
+++ b/web/src/locales/zh.ts
@@ -561,8 +561,7 @@ export default {
'请输入 Google Cloud Service Account Key in base64 format',
addGoogleRegion: 'Google Cloud 区域',
GoogleRegionMessage: '请输入 Google Cloud 区域',
- modelProvidersWarn:
- '请首先在 <b>设置 > 模型提供商</b> 中添加嵌入模型和 LLM。',
+ modelProvidersWarn: `请先在<b>设置 > 模型提供程序</b>中添加嵌入模型和 LLM。然后在“系统模型设置”中设置它们。`,
apiVersion: 'API版本',
apiVersionMessage: '请输入API版本!',
add: '添加',
diff --git a/web/src/pages/flow/constant.tsx b/web/src/pages/flow/constant.tsx
index 2131bfa3c0..3329cd7c7d 100644
--- a/web/src/pages/flow/constant.tsx
+++ b/web/src/pages/flow/constant.tsx
@@ -608,6 +608,7 @@ export const RestrictedUpstreamMap = {
[Operator.TuShare]: [Operator.Begin],
[Operator.Crawler]: [Operator.Begin],
[Operator.Note]: [],
+ [Operator.Invoke]: [Operator.Begin],
};
export const NodeMap = {
diff --git a/web/src/pages/flow/header/index.tsx b/web/src/pages/flow/header/index.tsx
index e89113d242..38f16b7858 100644
--- a/web/src/pages/flow/header/index.tsx
+++ b/web/src/pages/flow/header/index.tsx
@@ -44,7 +44,7 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
<Button type="primary" onClick={saveGraph}>
<b>{t('save')}</b>
</Button>
- <Button type="primary" onClick={showOverviewModal}>
+ <Button type="primary" onClick={showOverviewModal} disabled>
<b>{t('publish')}</b>
</Button>
</Space>
diff --git a/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx b/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx
index e6517e4ea0..292f2d1db5 100644
--- a/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx
+++ b/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx
@@ -26,7 +26,13 @@ const SystemModelSettingModal = ({
const handleOk = async () => {
const values = await form.validateFields();
- onOk(values);
+ onOk({
+ ...values,
+ asr_id: values.asr_id ?? '',
+ embd_id: values.embd_id ?? '',
+ img2txt_id: values.img2txt_id ?? '',
+ llm_id: values.llm_id ?? '',
+ });
};
useEffect(() => {
@@ -52,21 +58,21 @@ const SystemModelSettingModal = ({
name="llm_id"
tooltip={t('chatModelTip')}
>
- <Select options={allOptions[LlmModelType.Chat]} />
+ <Select options={allOptions[LlmModelType.Chat]} allowClear />
</Form.Item>
<Form.Item
label={t('embeddingModel')}
name="embd_id"
tooltip={t('embeddingModelTip')}
>
- <Select options={allOptions[LlmModelType.Embedding]} />
+ <Select options={allOptions[LlmModelType.Embedding]} allowClear />
</Form.Item>
<Form.Item
label={t('img2txtModel')}
name="img2txt_id"
tooltip={t('img2txtModelTip')}
>
- <Select options={allOptions[LlmModelType.Image2text]} />
+ <Select options={allOptions[LlmModelType.Image2text]} allowClear />
</Form.Item>
<Form.Item
@@ -74,21 +80,21 @@ const SystemModelSettingModal = ({
name="asr_id"
tooltip={t('sequence2txtModelTip')}
>
- <Select options={allOptions[LlmModelType.Speech2text]} />
+ <Select options={allOptions[LlmModelType.Speech2text]} allowClear />
</Form.Item>
<Form.Item
label={t('rerankModel')}
name="rerank_id"
tooltip={t('rerankModelTip')}
>
- <Select options={allOptions[LlmModelType.Rerank]} />
+ <Select options={allOptions[LlmModelType.Rerank]} allowClear />
</Form.Item>
<Form.Item
label={t('ttsModel')}
name="tts_id"
tooltip={t('ttsModelTip')}
>
- <Select options={allOptions[LlmModelType.TTS]} />
+ <Select options={allOptions[LlmModelType.TTS]} allowClear />
</Form.Item>
</Form>
</Modal>