fix: 发送图片超时时间

This commit is contained in:
hp0912 2026-05-05 23:46:14 +08:00
parent f812638e44
commit 569533e9d9
2 changed files with 6 additions and 6 deletions

View File

@ -275,7 +275,7 @@ def _debug_response(label: str, payload) -> None:
def _rewrite_openai_image_url(url: str) -> str:
internal_host = "http://chatgpt2api:80"
external_host = "http://chatgpt2api.houhoukang.com"
external_host = "https://chatgpt2api.houhoukang.com"
if url.startswith(internal_host):
return f"{external_host}{url[len(internal_host):]}"
return url
@ -304,7 +304,7 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s
"to_wxid": from_wx_id,
"image_urls": remote_urls,
}
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=60)
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300)
_debug_response("send image url response", response)
if local_paths:
@ -313,7 +313,7 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s
"to_wxid": from_wx_id,
"file_path": local_paths,
}
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=60)
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300)
_debug_response("send image local response", response)

View File

@ -274,7 +274,7 @@ def _debug_response(label: str, payload) -> None:
def _rewrite_openai_image_url(url: str) -> str:
internal_host = "http://chatgpt2api:80"
external_host = "http://chatgpt2api.houhoukang.com"
external_host = "https://chatgpt2api.houhoukang.com"
if url.startswith(internal_host):
return f"{external_host}{url[len(internal_host):]}"
return url
@ -303,7 +303,7 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s
"to_wxid": from_wx_id,
"image_urls": remote_urls,
}
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=60)
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300)
_debug_response("send image url response", response)
if local_paths:
@ -312,7 +312,7 @@ def _send_image_outputs(client_port: str, from_wx_id: str, image_outputs: list[s
"to_wxid": from_wx_id,
"file_path": local_paths,
}
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=60)
response = _http_post_json(send_url, send_body, {"Content-Type": "application/json"}, timeout=300)
_debug_response("send image local response", response)