(
self,
api_client: ApiClient,
tool_executor: ToolExecutor,
permission: PermissionChecker,
system_prompt: list[str],
max_iterations: int = 5,
)
| 956 | 所有依赖从外部注入, 内部只有"循环"逻辑 |
| 957 | """ |
| 958 | def __init__( |
| 959 | self, |
| 960 | api_client: ApiClient, |
| 961 | tool_executor: ToolExecutor, |
| 962 | permission: PermissionChecker, |
| 963 | system_prompt: list[str], |
| 964 | max_iterations: int = 5, |
| 965 | ): |
| 966 | self.api = api_client |
| 967 | self.tools = tool_executor |
| 968 | self.permission = permission |
| 969 | self.system_prompt = system_prompt |
| 970 | self.max_iterations = max_iterations |
| 971 | self.messages: list[dict] = [] |
| 972 | |
| 973 | def run_turn(self, user_input: str) -> str: |
| 974 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected