fix: 优化 Nano Banana 429/503/504 错误提示文案

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This commit is contained in:
o1key
2026-04-21 18:05:14 +08:00
co-authored by Claude Sonnet 4.5
parent ba468f5ca0
commit beadf0e365
+4 -13
View File
@@ -117,20 +117,11 @@ class GeminiAPIClient(BaseAPIClient):
def get_http_error_message(self, status_code: int, error_message: str) -> Optional[str]:
"""Gemini 请求 429/503 时返回图中约定的多行错误框文案。"""
if status_code == 429:
return (
"莫慌!该模型暂时超出速率限制啦\n"
"解决方案如下(任意一种):\n"
"1.切换当前模型\n"
"2.前往后台,修改令牌分组"
)
return "该型号资源已耗尽,但只是暂时的,请稍后重试。"
if status_code == 503:
return (
"警报!谷歌服务器当前过载!\n"
"解决方案如下:\n"
"1.摸会儿鱼吧,我也没办法,谷歌会尽快恢复,嘿嘿~\n"
"2.切换其他模型\n"
"3.前往后台,修改令牌分组"
)
return "此型号目前需求量较大。需求高峰通常是暂时的。请稍后再试。"
if status_code == 504:
return "服务无法在截止期限内完成处理。请稍后重试。"
return None
def build_request_body(