From 8f914d89bba4527fc3e0446fb60611d799031ccc Mon Sep 17 00:00:00 2001 From: fawney19 Date: Thu, 11 Dec 2025 11:21:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=86=99=E5=85=A5?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E6=94=AF=E6=8C=81=E5=A4=A7?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 chat_handler_base 的写入超时从 10 秒增加到 60 秒 - 将 cli_handler_base 的写入超时从 10 秒增加到 60 秒 - 将 http_client 的写入超时从 10 秒增加到 60 秒 - 支持包含大量数据(如图片)的长对话请求 --- src/api/handlers/base/chat_handler_base.py | 2 +- src/api/handlers/base/cli_handler_base.py | 2 +- src/clients/http_client.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/handlers/base/chat_handler_base.py b/src/api/handlers/base/chat_handler_base.py index 4490d82..84e3d72 100644 --- a/src/api/handlers/base/chat_handler_base.py +++ b/src/api/handlers/base/chat_handler_base.py @@ -452,7 +452,7 @@ class ChatHandlerBase(BaseMessageHandler, ABC): timeout_config = httpx.Timeout( connect=10.0, read=float(endpoint.timeout), - write=10.0, + write=60.0, # 写入超时增加到60秒,支持大请求体(如包含图片的长对话) pool=10.0, ) diff --git a/src/api/handlers/base/cli_handler_base.py b/src/api/handlers/base/cli_handler_base.py index 6f9947e..49099da 100644 --- a/src/api/handlers/base/cli_handler_base.py +++ b/src/api/handlers/base/cli_handler_base.py @@ -505,7 +505,7 @@ class CliMessageHandlerBase(BaseMessageHandler): timeout_config = httpx.Timeout( connect=10.0, read=float(endpoint.timeout), - write=10.0, + write=60.0, # 写入超时增加到60秒,支持大请求体(如包含图片的长对话) pool=10.0, ) diff --git a/src/clients/http_client.py b/src/clients/http_client.py index 35db6c9..8ffdfc0 100644 --- a/src/clients/http_client.py +++ b/src/clients/http_client.py @@ -42,7 +42,7 @@ class HTTPClientPool: timeout=httpx.Timeout( connect=10.0, # 连接超时 read=300.0, # 读取超时(5分钟,适合流式响应) - write=10.0, # 写入超时 + write=60.0, # 写入超时(60秒,支持大请求体) pool=5.0, # 连接池超时 ), limits=httpx.Limits(