(
self,
api_client: ApiClient, # 从外部传入
tool_executor: ToolExecutor, # 从外部传入
max_iterations: int = 10,
)
| 249 | 这就是依赖注入——"把依赖注入进来, 而不是自己造"。 |
| 250 | """ |
| 251 | def __init__( |
| 252 | self, |
| 253 | api_client: ApiClient, # 从外部传入 |
| 254 | tool_executor: ToolExecutor, # 从外部传入 |
| 255 | max_iterations: int = 10, |
| 256 | ): |
| 257 | self.api_client = api_client |
| 258 | self.tool_executor = tool_executor |
| 259 | self.max_iterations = max_iterations |
| 260 | self.messages: list[dict] = [] |
| 261 | |
| 262 | def run_turn(self, user_input: str) -> str: |
| 263 | """对应 conversation.rs:170-283 的 run_turn""" |
nothing calls this directly
no outgoing calls
no test coverage detected