From 71868a6fb9faa78ad6aab4e75a1b934298975f20 Mon Sep 17 00:00:00 2001 From: zstar <65890619+zstar1003@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:17:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(file):=20=E6=94=AF=E6=8C=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增文件夹上传功能,用户可以选择整个文件夹进行上传 --- api/db/services/dialog_service.py | 5 +- api/db/services/task_service.py | 6 - management/web/src/pages/file/index.vue | 436 +++++++++++++--------- management/web/types/auto/components.d.ts | 1 + pyproject.toml | 2 +- 5 files changed, 267 insertions(+), 183 deletions(-) diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index e9bf0f5..2f35c4f 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -16,11 +16,9 @@ import logging import binascii import time -from functools import partial import re from copy import deepcopy from timeit import default_timer as timer -from agentic_reasoning import DeepResearcher from api.db import LLMType, ParserType, StatusEnum from api.db.db_models import Dialog, DB from api.db.services.common_service import CommonService @@ -30,9 +28,8 @@ from api import settings from rag.app.resume import forbidden_select_fields4resume from rag.app.tag import label_question from rag.nlp.search import index_name -from rag.prompts import kb_prompt, message_fit_in, llm_id2llm_type, keyword_extraction, full_question, chunks_format, citation_prompt +from rag.prompts import kb_prompt, message_fit_in, llm_id2llm_type, keyword_extraction, chunks_format, citation_prompt from rag.utils import rmSpace, num_tokens_from_string -from rag.utils.tavily_conn import Tavily class DialogService(CommonService): diff --git a/api/db/services/task_service.py b/api/db/services/task_service.py index 26c844c..55aeaa0 100644 --- a/api/db/services/task_service.py +++ b/api/db/services/task_service.py @@ -225,8 +225,6 @@ def queue_tasks(doc: dict, bucket: str, name: str): # PDF文档处理逻辑 if doc["type"] == FileType.PDF.value: - # 从存储中获取文件内容 - file_bin = STORAGE_IMPL.get(bucket, name) # 获取布局识别方式,默认为"DeepDOC" do_layout = doc["parser_config"].get("layout_recognize", "DeepDOC") # 获取PDF总页数 @@ -255,10 +253,6 @@ def queue_tasks(doc: dict, bucket: str, name: str): task["to_page"] = min(p + page_size, e) parse_task_array.append(task) - # 表格文档处理逻辑 - elif doc["parser_id"] == "table": - # 从存储中获取文件内容 - file_bin = STORAGE_IMPL.get(bucket, name) # 其他类型文档,整个文档作为一个任务处理 else: parse_task_array.append(new_task()) diff --git a/management/web/src/pages/file/index.vue b/management/web/src/pages/file/index.vue index 015f045..6aeb72a 100644 --- a/management/web/src/pages/file/index.vue +++ b/management/web/src/pages/file/index.vue @@ -1,17 +1,16 @@