test: 清理 backlog——chat_structured 超限检测 + client 上下文管理器

This commit is contained in:
lhl
2026-08-09 09:15:36 +08:00
parent a5eaec4de8
commit cb2deda08a
5 changed files with 56 additions and 5 deletions
+7
View File
@@ -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,
*,