diff --git a/api/app/core/rag/nlp/search.py b/api/app/core/rag/nlp/search.py index 9bd5e0ce..db93bc48 100644 --- a/api/app/core/rag/nlp/search.py +++ b/api/app/core/rag/nlp/search.py @@ -172,7 +172,7 @@ def _retrieve_for_knowledge( return results, chat_model, embedding_model # Folder 类型:递归处理子知识库 - if db_knowledge.type == knowledge_model.KnowledgeType.Folder: + if db_knowledge.type == knowledge_model.KnowledgeType.FOLDER: children = knowledge_repository.get_knowledges_by_parent_id(db=db, parent_id=db_knowledge.id) for child in children: if not (child and child.chunk_num > 0 and child.status == 1): diff --git a/api/app/services/workflow_service.py b/api/app/services/workflow_service.py index 6503fe25..04a778a1 100644 --- a/api/app/services/workflow_service.py +++ b/api/app/services/workflow_service.py @@ -636,30 +636,33 @@ class WorkflowService: final_messages = result.get("messages", [])[init_message_length:] human_message = "" assistant_message = "" + human_meta = { + "files": [] + } for message in final_messages: if message["role"] == "user": if isinstance(message["content"], str): human_message += message["content"] elif isinstance(message["content"], list): for file in message["content"]: - if file.get("type") == FileType.IMAGE: - human_message += f"![image]({file.get('url', '')})" - else: - human_message += f"[{file.get('type')}]({file.get('url', '')})" + human_meta["files"].append({ + "type": file.get("type"), + "url": file.get("url") + }) if message["role"] == "assistant": assistant_message = message["content"] self.conversation_service.add_message( conversation_id=conversation_id_uuid, role="user", content=human_message, - meta_data=None + meta_data=human_meta ) self.conversation_service.add_message( message_id=message_id, conversation_id=conversation_id_uuid, role="assistant", content=assistant_message, - meta_data={"usage": token_usage} + meta_data={"usage": token_usage, "audio_url": None} ) self.update_execution_status( execution.execution_id, diff --git a/web/src/components/ButtonCheckbox/index.tsx b/web/src/components/ButtonCheckbox/index.tsx index 41824fd1..18bca7c6 100644 --- a/web/src/components/ButtonCheckbox/index.tsx +++ b/web/src/components/ButtonCheckbox/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-02 15:01:59 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-17 15:35:34 + * @Last Modified time: 2026-03-19 13:41:26 */ /** @@ -42,7 +42,8 @@ const ButtonCheckbox: FC = ({ icon, checkedIcon, children, - cicle = false + cicle = false, + disabled, }) => { // Listen to value changes and trigger side effects via onValueChange callback useEffect(() => { @@ -70,6 +71,7 @@ const ButtonCheckbox: FC = ({ "rb:bg-[rgba(21,94,239,0.06)] rb:border-[rgba(21,94,239,0.25)] rb:hover:bg-[rgba(21,94,239,0.06)] rb:text-[#155EEF]": checked, // Unchecked state: gray border and dark text "rb:border-[#DFE4ED] rb:text-[#212332]": !checked, + "rb:opacity-65 rb:cursor-not-allowed!": disabled })} onClick={handleChange} > diff --git a/web/src/components/Chat/ChatContent.tsx b/web/src/components/Chat/ChatContent.tsx index c73d91f5..c77e8384 100644 --- a/web/src/components/Chat/ChatContent.tsx +++ b/web/src/components/Chat/ChatContent.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2025-12-10 16:46:17 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 10:37:01 + * @Last Modified time: 2026-03-19 13:38:20 */ import { type FC, useRef, useEffect, useState } from 'react' import clsx from 'clsx' @@ -118,7 +118,7 @@ const ChatContent: FC = ({ {labelFormat(item)} } - {item.meta_data?.files && item.meta_data?.files.length > 0 && + {item.meta_data?.files && item.meta_data?.files.length > 0 && {item.meta_data?.files?.map((file) => { if (file.type.includes('image')) { return ( diff --git a/web/src/components/Chat/ChatInput.tsx b/web/src/components/Chat/ChatInput.tsx index 508b0d0c..7daf935c 100644 --- a/web/src/components/Chat/ChatInput.tsx +++ b/web/src/components/Chat/ChatInput.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2025-12-10 16:46:14 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-06 13:36:20 + * @Last Modified time: 2026-03-19 16:05:56 */ import { type FC, useEffect, useMemo } from 'react' import { Flex, Input, Form } from 'antd' @@ -109,15 +109,20 @@ const ChatInput: FC = ({ } return (
- {(file.type.includes('doc') || file.type.includes('docx') || file.type.includes('word') || file.type.includes('wordprocessingml.document')) &&
} - {(file.type.includes('pdf')) &&
} - {(file.type.includes('excel') || file.type.includes('spreadsheetml.sheet') || file.type.includes('csv')) &&
} + {file.type.includes('pdf') + ?
+ : (file.type.includes('excel') || file.type.includes('spreadsheetml.sheet') || file.type.includes('csv')) + ?
+ : (file.type.includes('doc') || file.type.includes('docx') || file.type.includes('word') || file.type.includes('wordprocessingml.document')) + ?
+ : null + }
{file.name}
{file.type} · {file.size}
diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index dd5746e4..7ff1f30a 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1564,6 +1564,7 @@ export const en = { summary: 'Summary', core_entities: 'Core Entities', communityDetailEmptyDesc: 'Click on a community in the chart on the left to view details', + communityLoadingTip: 'Generating community graph', }, space: { createSpace: 'Create Space', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index f7a84f00..49a1b803 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1562,6 +1562,7 @@ export const zh = { summary: '摘要', core_entities: '核心实体', communityDetailEmptyDesc: '点击左侧图表中的社区查看详情', + communityLoadingTip: '社区图谱生成中', }, space: { createSpace: '创建空间', diff --git a/web/src/views/ApplicationConfig/components/ConfigHeader.tsx b/web/src/views/ApplicationConfig/components/ConfigHeader.tsx index e2e1cf6f..77977a82 100644 --- a/web/src/views/ApplicationConfig/components/ConfigHeader.tsx +++ b/web/src/views/ApplicationConfig/components/ConfigHeader.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:27:52 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-18 21:25:23 + * @Last Modified time: 2026-03-19 17:13:54 */ import { type FC, useRef, useMemo, useCallback } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; @@ -212,7 +212,7 @@ const ConfigHeader: FC = ({ className={styles.tabs} />
- {application?.type === 'workflow' && source !== 'sharing' + {application?.type === 'workflow' && source !== 'sharing' && activeTab === 'arrangement' ?
diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx index f30b5aa8..3fb05a0e 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-05 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 09:59:42 + * @Last Modified time: 2026-03-19 15:18:20 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd'; @@ -27,22 +27,43 @@ const fileTypeOptions = [ { type: 'document', icon:
, - formats: 'TXT, PDF, DOC, DOCX, XLSX, CSV, JSON', + formats: [ + "pdf", + "docx", + "doc", + "xlsx", + "xls", + "txt", + "csv", + "json", + "md", + ], }, { type: 'image', icon:
, - formats: 'JPG, JPEG, PNG, GIF, WEBP', + formats: [ + "png", + "jpg", + "jpeg" + ], }, { type: 'audio', icon:
, - formats: 'MP3, M4A, WAV, OGG, FLAC', + formats: [ + "mp3", + "wav", + "m4a", + ], }, { type: 'video', icon:
, - formats: 'MP4, MOV, AVI, WEBM', + formats: [ + "mp4", + "mov", + ], }, ]; @@ -50,16 +71,38 @@ const defaultValues: FileUpload = { enabled: false, image_enabled: false, image_max_size_mb: 20, - image_allowed_extensions: ['png', 'jpg', 'jpeg', 'gif', 'webp'], + image_allowed_extensions: [ + "png", + "jpg", + "jpeg" + ], audio_enabled: false, audio_max_size_mb: 50, - audio_allowed_extensions: ['mp3', 'wav', 'm4a', 'ogg', 'flac'], + audio_allowed_extensions: [ + "mp3", + "wav", + "m4a", + "ogg", + "flac" + ], document_enabled: false, document_max_size_mb: 100, - document_allowed_extensions: ['pdf', 'docx', 'xlsx', 'txt', 'csv', 'json'], + document_allowed_extensions: [ + "pdf", + "docx", + "xlsx", + "txt", + "csv", + "json" + ], video_enabled: false, - video_max_size_mb: 500, - video_allowed_extensions: ['mp4', 'mov', 'avi', 'webm'], + video_max_size_mb: 100, + video_allowed_extensions: [ + "mp4", + "mov", + "avi", + "webm" + ], max_file_count: 5, allowed_transfer_methods: 'both' } @@ -127,7 +170,7 @@ const FileUploadSettingModal = forwardRef{t('application.maxCount')}
- + @@ -149,7 +192,7 @@ const FileUploadSettingModal = forwardRef
{t(`application.${option.type}`)}
-
{option.formats}
+
{option.formats.map(item => item.toUpperCase()).join(', ')}
@@ -161,7 +204,7 @@ const FileUploadSettingModal = forwardRef
{t('application.singleMaxSize')}:
- +