更新星火认知模型聊天

This commit is contained in:
yaooo 2023-10-14 15:55:48 +08:00
parent bd77a97d2f
commit 36d86f82e2

View File

@ -152,10 +152,7 @@ class XunFeiController extends BaseApiController
if($code == 0){
$status = $resp["header"]["status"];
$content = $resp['payload']['choices']['text'][0]['content'] ?? '';
$content = trim(str_replace(['\n', '\n\n', '\t', '\r', ' '], '', $content));
if ($content) {
$answer .= $content;
}
$answer .= $content;
if($status == 2){
break;
}
@ -165,16 +162,10 @@ class XunFeiController extends BaseApiController
}
}
$data = [
'informationg_demand_id' => $informationg_demand_id,
'information_id' => $informationg['information_id'] ?? 0,
'category_id' => $informationg['category_id'] ?? 0,
'category_child' => $informationg['category_child'] ?? 0,
'send_data' => $question,
'receive_data' => $answer,
'create_time' => time(),
'ai_aianalyse' => $answer,
'update_time' => time(),
];
$res = Db::name('user_informationg_aianalyse')->insert($data);
$res = Db::name('user_informationg_demand')->where('id', $informationg_demand_id)->update($data);
if (!$res) {
return $this->fail('AI分析信息失败');
}