да
This commit is contained in:
1 parent
5d76e154e0
commit
763ca6062d
3 files changed
+80
No files matched your search
+30
@@ -343,6 +343,36 @@ def parse_response(text: str):
|
||||
"type": "quota",
|
||||
"message": "лимит токенов закончился у провайдера врат. подожди или смени модель.",
|
||||
}
|
||||
elif "response payload is not completed" in text or "not enough data to satisfy" in text or "server disconnected" in text or "connection reset" in text or "serverdisconnectederror" in text:
|
||||
return {
|
||||
"type": "incomplete",
|
||||
"message": "сервер петух и оборвал ответ на середине. подожди или смени модель.",
|
||||
}
|
||||
elif "timeout" in text or "timed out" in text:
|
||||
return {
|
||||
"type": "timeout",
|
||||
"message": "сервер думал слишком долго и умер. подожди или смени модель.",
|
||||
}
|
||||
elif "not found" in text or " 404" in text or "404 " in text or "no such model" in text or "does not exist" in text:
|
||||
return {
|
||||
"type": "notfound",
|
||||
"message": "модель не найдена у провайдера. смени модель в настройках.",
|
||||
}
|
||||
elif "forbidden" in text or "unauthorized" in text or " 403" in text or "403 " in text or " 401" in text or "401 " in text or "invalid api key" in text or "incorrect api key" in text:
|
||||
return {
|
||||
"type": "key",
|
||||
"message": "ключ или доступ к провайдеру сдох. смени модель или напиши хостеру.",
|
||||
}
|
||||
elif " 429" in text or "429 " in text or "exhausted" in text or "quota" in text:
|
||||
return {
|
||||
"type": "quota",
|
||||
"message": "лимит запросов у провайдера закончился. подожди или смени модель.",
|
||||
}
|
||||
elif " 500" in text or "500 " in text or " 502" in text or "502 " in text or " 503" in text or "503 " in text or "bad gateway" in text:
|
||||
return {
|
||||
"type": "int",
|
||||
"message": "ошибка на стороне провайдера. подожди или смени модель.",
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"type": "unknown",
|
||||
|
||||
Reference in new issue
Block a user