* load ai llm config before accessing model config.

This commit is contained in:
liwenrui
2024-02-28 16:26:16 +08:00
committed by caoyanyi
parent 00c7adeae5
commit 73a2ceecf2
+2 -1
View File
@@ -2019,7 +2019,8 @@ class aiModel extends model
$schema = $this->getFunctionCallSchema($prompt->targetForm);
if(empty($schema)) return -5;
$response = $this->{$this->config->ai->models[$this->modelConfig->type] == 'ernie' ? 'converseTwiceForJSON' : 'converseForJSON'}($prompt->model , array((object)array('role' => 'user', 'content' => $wholePrompt)), $schema);
$this->useLanguageModel($prompt->model);
$response = $this->{$this->config->ai->models[$this->modelConfig->type] == 'ernie' ? 'converseTwiceForJSON' : 'converseForJSON'}($prompt->model, array((object)array('role' => 'user', 'content' => $wholePrompt)), $schema);
if(empty($response)) return -6;
return current($response);