* show baidu ai auth failures.
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 = '连接成功';
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user