diff --git a/server/routers/system_router.py b/server/routers/system_router.py index 3a2174a5..a4925659 100644 --- a/server/routers/system_router.py +++ b/server/routers/system_router.py @@ -82,7 +82,8 @@ def load_info_config(): """加载信息配置文件""" try: # 配置文件路径 - config_path = Path("src/static/info.local.yaml") + brand_file_path = os.environ.get("YUXI_BRAND_FILE_PATH", "src/static/info.local.yaml") + config_path = Path(brand_file_path) # 检查文件是否存在 if not config_path.exists(): diff --git a/src/agents/tools_factory.py b/src/agents/tools_factory.py index 11926c32..a402d927 100644 --- a/src/agents/tools_factory.py +++ b/src/agents/tools_factory.py @@ -173,7 +173,7 @@ def query_knowledge_graph(query: Annotated[str, "The keyword to query knowledge try: logger.debug(f"Querying knowledge graph with: {query}") result = graph_base.query_node(query, hops=2, return_format='triples') - logger.debug(f"Knowledge graph query returned {len(result.get('triples', [])) if isinstance(result, d) else 'N/A'} triples") + logger.debug(f"Knowledge graph query returned {len(result.get('triples', [])) if isinstance(result, dict) else 'N/A'} triples") return result except Exception as e: logger.error(f"Knowledge graph query error: {e}")