diff --git a/module/ai/lang/de.php b/module/ai/lang/de.php index e6fe88936e..e86ee3a612 100644 --- a/module/ai/lang/de.php +++ b/module/ai/lang/de.php @@ -562,6 +562,7 @@ $lang->ai->models->confirmDelete = 'Are you sure you want to delete this langua $lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?'; $lang->ai->models->default = 'Default model'; $lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.'; +$lang->ai->models->authFailure = 'API authentication failed'; $lang->ai->models->testConnectionResult = new stdclass(); $lang->ai->models->testConnectionResult->success = 'Successfully connected'; diff --git a/module/ai/lang/en.php b/module/ai/lang/en.php index e51e206609..b851aaaf56 100644 --- a/module/ai/lang/en.php +++ b/module/ai/lang/en.php @@ -562,6 +562,7 @@ $lang->ai->models->confirmDelete = 'Are you sure you want to delete this langua $lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?'; $lang->ai->models->default = 'Default model'; $lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.'; +$lang->ai->models->authFailure = 'API authentication failed'; $lang->ai->models->testConnectionResult = new stdclass(); $lang->ai->models->testConnectionResult->success = 'Successfully connected'; diff --git a/module/ai/lang/fr.php b/module/ai/lang/fr.php index e51e206609..b851aaaf56 100644 --- a/module/ai/lang/fr.php +++ b/module/ai/lang/fr.php @@ -562,6 +562,7 @@ $lang->ai->models->confirmDelete = 'Are you sure you want to delete this langua $lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?'; $lang->ai->models->default = 'Default model'; $lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.'; +$lang->ai->models->authFailure = 'API authentication failed'; $lang->ai->models->testConnectionResult = new stdclass(); $lang->ai->models->testConnectionResult->success = 'Successfully connected'; diff --git a/module/ai/lang/zh-cn.php b/module/ai/lang/zh-cn.php index 695c92e9aa..f886d8c8c0 100644 --- a/module/ai/lang/zh-cn.php +++ b/module/ai/lang/zh-cn.php @@ -562,6 +562,7 @@ $lang->ai->models->confirmDelete = '您确认要删除该语言模型吗?'; $lang->ai->models->confirmDisable = '您确认要禁用该语言模型吗?'; $lang->ai->models->default = '默认'; $lang->ai->models->defaultTip = '默认语言模型(第一个可用的语言模型)将会用于运行未指定语言模型的提词、小程序,也将会用于聊天。'; +$lang->ai->models->authFailure = 'API 认证失败'; $lang->ai->models->testConnectionResult = new stdclass(); $lang->ai->models->testConnectionResult->success = '连接成功'; diff --git a/module/ai/model.php b/module/ai/model.php index e6fcb79449..b5b0c483b5 100644 --- a/module/ai/model.php +++ b/module/ai/model.php @@ -432,6 +432,7 @@ class aiModel extends model curl_close($ch); return $response; } + if(empty($result->access_token)) return (object)array('result' => 'fail', 'message' => $this->lang->ai->models->authFailure); $accessToken = $result->access_token; $url = sprintf($this->config->ai->ernie->api->$modelVendor->format, $accessToken);