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