MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / warmup_upstream_client

Function warmup_upstream_client

main.py:25–33  ·  view source on GitHub ↗

可选预热上游适配器,提前初始化动态依赖。

()

Source from the content-addressed store, hash-verified

23
24
25async def warmup_upstream_client():
26 """可选预热上游适配器,提前初始化动态依赖。"""
27 try:
28 client = UpstreamClient()
29 logger.info(
30 f"✅ 上游适配器已就绪,支持 {len(client.get_supported_models())} 个模型"
31 )
32 except Exception as exc:
33 logger.warning(f"⚠️ 上游适配器预热失败: {exc}")
34
35
36@asynccontextmanager

Callers 1

lifespanFunction · 0.85

Calls 2

get_supported_modelsMethod · 0.95
UpstreamClientClass · 0.90

Tested by

no test coverage detected