From 09d10de6d59abfcbe1efc35c84c7c911bb2d4e0a Mon Sep 17 00:00:00 2001 From: plf1996 Date: Wed, 17 Jun 2026 22:27:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=20venv=20=E8=B7=AF=E5=BE=84=E3=80=81HTML=20?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=8F=8A=E7=A1=AC=E7=BC=96=E7=A0=81=20Window?= =?UTF-8?q?s=20=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - health check 改用 sys.executable 动态获取 Python 路径,适配容器内 /opt/venv - demo 数据 fallback 路径修正,移除硬编码的 F:/GraphRAGAgent Windows 路径 - 前端 index.html 标题从"构建产品原型"改为"GraphRAG Studio" --- backend/routers/system.py | 10 ++++++---- frontend/index.html | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/routers/system.py b/backend/routers/system.py index b7c4471..750b84e 100644 --- a/backend/routers/system.py +++ b/backend/routers/system.py @@ -1,5 +1,6 @@ """F 组:系统(4 个端点)""" import os +import sys import time from pathlib import Path @@ -20,7 +21,7 @@ async def health_check(): load_dotenv(env_path, override=False) mineru_python = Path(os.getenv("MINERU_PYTHON", str(Path(__file__).parent.parent.parent / "mineru_mvp" / ".venv" / "bin" / "python"))) - backend_python = Path(__file__).parent.parent / ".venv" / "bin" / "python" + backend_python = Path(os.getenv("LANGEXTRACT_PYTHON", str(Path(sys.executable)))) deepseek_key = os.getenv("DEEPSEEK_API_KEY", "") deepseek_url = os.getenv("DEEPSEEK_BASE_URL", "https://api.deepseek.com") @@ -133,9 +134,10 @@ async def get_demo_data(): edges = fs.load_kg_edges() if not nodes: - # Fallback: load from existing graphrag_pipeline output - legacy_nodes_path = Path(__file__).parent.parent.parent / "backend" / "output" / "kg_nodes.json" - legacy_edges_path = Path("F:/GraphRAGAgent/graphrag_pipeline/output/kg_edges.json") + # Fallback: load from backend/output/ directory + legacy_output = Path(__file__).parent.parent / "output" + legacy_nodes_path = legacy_output / "kg_nodes.json" + legacy_edges_path = legacy_output / "kg_edges.json" if legacy_nodes_path.exists(): import json nodes = json.loads(legacy_nodes_path.read_text(encoding="utf-8")) diff --git a/frontend/index.html b/frontend/index.html index 1f4095b..ae5561c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - 构建产品原型 + GraphRAG Studio