From 693364c15185b6f3ed83ac11c930db9be95a5a54 Mon Sep 17 00:00:00 2001 From: gongwenxin Date: Tue, 19 Aug 2025 18:47:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=9C=9F=E5=AE=9Ewell=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ddms_compliance_suite/stage_framework.py | 4 +++- ddms_compliance_suite/test_orchestrator.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ddms_compliance_suite/stage_framework.py b/ddms_compliance_suite/stage_framework.py index 2874afa..53a0bee 100644 --- a/ddms_compliance_suite/stage_framework.py +++ b/ddms_compliance_suite/stage_framework.py @@ -229,13 +229,15 @@ class BaseAPIStage: llm_service: Optional[LLMService] = None, global_api_spec: Optional[ParsedAPISpec] = None, # <--- 修改类型注解 operation_keywords: Optional[Dict[str, List[str]]] = None, - stage_llm_config: Optional[Dict[str, bool]] = None): + stage_llm_config: Optional[Dict[str, bool]] = None, + orchestrator: Optional['APITestOrchestrator'] = None): self.logger = logging.getLogger(f"{__name__}.{self.__class__.__name__}") self.current_api_group_metadata = api_group_metadata self.api_group_metadata = api_group_metadata # Let's ensure this common name is also available. self.apis_in_group = apis_in_group # CORRECTED attribute name self.global_api_spec: ParsedAPISpec = global_api_spec self.llm_service = llm_service + self.orchestrator = orchestrator # 🔑 关键修复:保存orchestrator引用 # Stage专用的LLM配置 self.stage_llm_config = stage_llm_config or { diff --git a/ddms_compliance_suite/test_orchestrator.py b/ddms_compliance_suite/test_orchestrator.py index 45f9390..f52c5e8 100644 --- a/ddms_compliance_suite/test_orchestrator.py +++ b/ddms_compliance_suite/test_orchestrator.py @@ -2545,7 +2545,8 @@ class APITestOrchestrator: apis_in_group=[], global_api_spec=parsed_spec, llm_service=self.llm_service, - stage_llm_config=self.stage_llm_config + stage_llm_config=self.stage_llm_config, + orchestrator=self # 🔑 关键修复:传递orchestrator引用 ) for current_api_group_name in api_groups_to_iterate: @@ -2632,7 +2633,8 @@ class APITestOrchestrator: apis_in_group=current_apis_in_group_for_stage, global_api_spec=parsed_spec, llm_service=self.llm_service, - stage_llm_config=self.stage_llm_config + stage_llm_config=self.stage_llm_config, + orchestrator=self # 🔑 关键修复:传递orchestrator引用 ) try: