* fix ai test for azure vendor.

This commit is contained in:
Chenjianyu
2023-08-15 15:37:57 +08:00
parent 0a05d1a337
commit dafe05f8d7
+12 -1
View File
@@ -145,7 +145,18 @@ class ai extends control
$this->ai->setConfig($modelConfig);
$result = $this->ai->complete('test', 1); // Test completing 'test' with length of 1.
if($currentVendor == 'azure')
{
$messages = array(
(object)array('role' => 'user', 'content' => 'Hello?')
);
$result = $this->ai->converse($messages);
}
else
{
$result = $this->ai->complete('test', 1); // Test completing 'test' with length of 1.
}
if($result === false)
{
return $this->send(array('result' => 'fail', 'message' => empty($this->ai->errors) ? $this->lang->ai->models->testConnectionResult->fail : sprintf($this->lang->ai->models->testConnectionResult->failFormat, implode(', ', $this->ai->errors))));