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

Class MockApiClient

tutorials/18_design_patterns_for_agents.py:103–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102 # 实现 2: 假数据 (测试环境)
103 class MockApiClient(ApiClient):
104 def __init__(self, fixed_response: str):
105 self.fixed_response = fixed_response
106
107 def stream(self, messages):
108 return [{"type": "text", "text": self.fixed_response}]
109
110 # 实现 3: 记录所有请求 (调试环境)
111 class LoggingApiClient(ApiClient):

Callers 1

lesson_1_interfaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected