From 172d540463c191eaf2389cfaca47c01b8e5a3e1d Mon Sep 17 00:00:00 2001 From: dirk1983 Date: Wed, 15 Mar 2023 18:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E9=94=99=E8=AF=AF=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/chat.js | 3 +++ stream.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/js/chat.js b/js/chat.js index 7bc53ad..38ff25b 100644 --- a/js/chat.js +++ b/js/chat.js @@ -159,6 +159,9 @@ $(document).ready(function () { case "account_deactivated": layer.msg("账户已禁用"); break; + case "model_overloaded": + layer.msg("OpenAI模型超负荷,请重新发起请求"); + break; case null: layer.msg("OpenAI服务器访问超时或未知类型错误"); break; diff --git a/stream.php b/stream.php index 72793b5..b6e364e 100644 --- a/stream.php +++ b/stream.php @@ -35,6 +35,9 @@ $callback = function ($ch, $data) { if (strpos($complete->error->message, "You exceeded your current quota") === 0) { //API-KEY余额不足 setcookie("errcode", "insufficient_quota"); } + if (strpos($complete->error->message, "That model is currently overloaded") === 0) { //OpenAI服务器超负荷 + setcookie("errcode", "model_overloaded"); + } } else { echo $data; $_SESSION['response'] .= $data;