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

Method __init__

tutorials/18_design_patterns_for_agents.py:216–219  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 class BadRuntime:
215 """糟糕的设计: API 客户端在内部写死"""
216 def __init__(self):
217 # 问题: 测试时怎么办? 没网络怎么办? 想换 API 怎么办?
218 import urllib.request # noqa: F401 — 演示"写死"
219 self.api_url = "https://api.anthropic.com/v1/messages"
220
221 def run(self, user_input: str):
222 # 这里直接调 API——无法测试、无法替换

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected