Skip to content

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

Feat: Allows users to search for models in the model selection drop-down box #3221 (#6708)

balibabud0dca16feeda
diff --git a/web/src/components/operate-dropdown/index.tsx b/web/src/components/operate-dropdown/index.tsx
index 40877fc5ad..f243ad2b7f 100644
--- a/web/src/components/operate-dropdown/index.tsx
+++ b/web/src/components/operate-dropdown/index.tsx
@@ -13,6 +13,7 @@ interface IProps {
items?: MenuProps['items'];
height?: number;
needsDeletionValidation?: boolean;
+ showDeleteItems?: boolean;
}
const OperateDropdown = ({
@@ -23,6 +24,7 @@ const OperateDropdown = ({
items: otherItems = [],
height = 24,
needsDeletionValidation = true,
+ showDeleteItems = true,
}: React.PropsWithChildren<IProps>) => {
const { t } = useTranslation();
const showDeleteConfirm = useShowDeleteConfirm();
@@ -44,8 +46,10 @@ const OperateDropdown = ({
};
const items: MenuProps['items'] = useMemo(() => {
- return [
- {
+ const items = [];
+
+ if (showDeleteItems) {
+ items.push({
key: '1',
label: (
<Space>
@@ -53,10 +57,11 @@ const OperateDropdown = ({
<DeleteOutlined />
</Space>
),
- },
- ...otherItems,
- ];
- }, [t, otherItems]);
+ });
+ }
+
+ return [...items, ...otherItems];
+ }, [showDeleteItems, otherItems, t]);
return (
<Dropdown
diff --git a/web/src/interfaces/database/knowledge.ts b/web/src/interfaces/database/knowledge.ts
index 999814e1ef..a6a1b65bbd 100644
--- a/web/src/interfaces/database/knowledge.ts
+++ b/web/src/interfaces/database/knowledge.ts
@@ -24,6 +24,7 @@ export interface IKnowledge {
vector_similarity_weight: number;
embd_id: string;
nickname?: string;
+ operator_permission: number;
}
export interface Raptor {
diff --git a/web/src/interfaces/database/llm.ts b/web/src/interfaces/database/llm.ts
index ff99613ab7..802551d0fd 100644
--- a/web/src/interfaces/database/llm.ts
+++ b/web/src/interfaces/database/llm.ts
@@ -11,6 +11,8 @@ export interface IThirdOAIModel {
tags: string;
update_date: string;
update_time: number;
+ tenant_id?: string;
+ tenant_name?: string;
}
export type IThirdOAIModelCollection = Record<string, IThirdOAIModel[]>;
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 21466307f9..f67755dbeb 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
@@ -64,6 +64,7 @@ const SystemModelSettingModal = ({
...allOptions[LlmModelType.Image2text],
]}
allowClear
+ showSearch
/>
</Form.Item>
<Form.Item
@@ -71,14 +72,22 @@ const SystemModelSettingModal = ({
name="embd_id"
tooltip={t('embeddingModelTip')}
>
- <Select options={allOptions[LlmModelType.Embedding]} allowClear />
+ <Select
+ options={allOptions[LlmModelType.Embedding]}
+ allowClear
+ showSearch
+ />
</Form.Item>
<Form.Item
label={t('img2txtModel')}
name="img2txt_id"
tooltip={t('img2txtModelTip')}
>
- <Select options={allOptions[LlmModelType.Image2text]} allowClear />
+ <Select
+ options={allOptions[LlmModelType.Image2text]}
+ allowClear
+ showSearch
+ />
</Form.Item>
<Form.Item
@@ -86,21 +95,33 @@ const SystemModelSettingModal = ({
name="asr_id"
tooltip={t('sequence2txtModelTip')}
>
- <Select options={allOptions[LlmModelType.Speech2text]} allowClear />
+ <Select
+ options={allOptions[LlmModelType.Speech2text]}
+ allowClear
+ showSearch
+ />
</Form.Item>
<Form.Item
label={t('rerankModel')}
name="rerank_id"
tooltip={t('rerankModelTip')}
>
- <Select options={allOptions[LlmModelType.Rerank]} allowClear />
+ <Select
+ options={allOptions[LlmModelType.Rerank]}
+ allowClear
+ showSearch
+ />
</Form.Item>
<Form.Item
label={t('ttsModel')}
name="tts_id"
tooltip={t('ttsModelTip')}
>
- <Select options={allOptions[LlmModelType.TTS]} allowClear />
+ <Select
+ options={allOptions[LlmModelType.TTS]}
+ allowClear
+ showSearch
+ />
</Form.Item>
</Form>
</Modal>