test: 清理 backlog——chat_structured 超限检测 + client 上下文管理器
This commit is contained in:
@@ -48,6 +48,13 @@ class HttpLLMClient:
|
||||
self._retry_backoff = retry_backoff
|
||||
self._client = httpx.Client(timeout=timeout_sec, transport=transport)
|
||||
|
||||
def __enter__(self) -> HttpLLMClient:
|
||||
"""支持 with 块:退出时自动关闭底层连接。"""
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb) -> None:
|
||||
self._client.close()
|
||||
|
||||
def chat(
|
||||
self,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user