ghmark675

fix(env): fix report agent api key error

@@ -779,5 +779,5 @@ def create_agent(config_file: Optional[str] = None) -> DeepSearchAgent: @@ -779,5 +779,5 @@ def create_agent(config_file: Optional[str] = None) -> DeepSearchAgent:
779 Returns: 779 Returns:
780 DeepSearchAgent实例 780 DeepSearchAgent实例
781 """ 781 """
782 - config = settings 782 + config = Settings()
783 return DeepSearchAgent(config) 783 return DeepSearchAgent(config)
@@ -138,7 +138,7 @@ class ReportAgent: @@ -138,7 +138,7 @@ class ReportAgent:
138 self.state = ReportState() 138 self.state = ReportState()
139 139
140 # 确保输出目录存在 140 # 确保输出目录存在
141 - os.makedirs(settings.OUTPUT_DIR, exist_ok=True) 141 + os.makedirs(self.config.OUTPUT_DIR, exist_ok=True)
142 142
143 logger.info("Report Agent已初始化") 143 logger.info("Report Agent已初始化")
144 logger.info(f"使用LLM: {self.llm_client.get_model_info()}") 144 logger.info(f"使用LLM: {self.llm_client.get_model_info()}")
@@ -146,11 +146,11 @@ class ReportAgent: @@ -146,11 +146,11 @@ class ReportAgent:
146 def _setup_logging(self): 146 def _setup_logging(self):
147 """设置日志""" 147 """设置日志"""
148 # 确保日志目录存在 148 # 确保日志目录存在
149 - log_dir = os.path.dirname(settings.LOG_FILE) 149 + log_dir = os.path.dirname(self.config.LOG_FILE)
150 os.makedirs(log_dir, exist_ok=True) 150 os.makedirs(log_dir, exist_ok=True)
151 151
152 # 创建专用的logger,避免与其他模块冲突 152 # 创建专用的logger,避免与其他模块冲突
153 - logger.add(settings.LOG_FILE, level="INFO") 153 + logger.add(self.config.LOG_FILE, level="INFO")
154 154
155 def _initialize_file_baseline(self): 155 def _initialize_file_baseline(self):
156 """初始化文件数量基准""" 156 """初始化文件数量基准"""
@@ -164,9 +164,9 @@ class ReportAgent: @@ -164,9 +164,9 @@ class ReportAgent:
164 def _initialize_llm(self) -> LLMClient: 164 def _initialize_llm(self) -> LLMClient:
165 """初始化LLM客户端""" 165 """初始化LLM客户端"""
166 return LLMClient( 166 return LLMClient(
167 - api_key=settings.REPORT_ENGINE_API_KEY,  
168 - model_name=settings.REPORT_ENGINE_MODEL_NAME,  
169 - base_url=settings.REPORT_ENGINE_BASE_URL, 167 + api_key=self.config.REPORT_ENGINE_API_KEY,
  168 + model_name=self.config.REPORT_ENGINE_MODEL_NAME,
  169 + base_url=self.config.REPORT_ENGINE_BASE_URL,
170 ) 170 )
171 171
172 def _initialize_nodes(self): 172 def _initialize_nodes(self):