MCPcopy Create free account
hub / github.com/Louisym/MiniCC / __init__

Method __init__

tutorials/18_design_patterns_for_agents.py:251–260  ·  view source on GitHub ↗
(
            self,
            api_client: ApiClient,        # 从外部传入
            tool_executor: ToolExecutor,   # 从外部传入
            max_iterations: int = 10,
        )

Source from the content-addressed store, hash-verified

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"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected