feat: 完善AI助手功能,新增消息提示词整理接口,优化流式消息处理逻辑,移除冗余数据表和相关代码
This commit is contained in:
@@ -66,7 +66,7 @@ class BotReceiveMsgTask extends AbstractTask
|
||||
}
|
||||
|
||||
// 判断消息是否存在
|
||||
$msg = WebSocketDialogMsg::with(['user', 'extra'])->find($this->msgId);
|
||||
$msg = WebSocketDialogMsg::with(['user'])->find($this->msgId);
|
||||
if (empty($msg)) {
|
||||
return;
|
||||
}
|
||||
@@ -523,16 +523,6 @@ class BotReceiveMsgTask extends AbstractTask
|
||||
{$sendText}
|
||||
EOF;
|
||||
}
|
||||
// 处理额外数据
|
||||
if ($msg->extra && $msg->extra->data) {
|
||||
$extraData = $msg->extra->data;
|
||||
if ($extraData['system_prompt']) {
|
||||
$extras['system_message'] = $extraData['system_prompt'];
|
||||
}
|
||||
if ($extraData['context_prompt']) {
|
||||
$sendText = $extraData['context_prompt'] . $sendText;
|
||||
}
|
||||
}
|
||||
$webhookUrl = "http://nginx/ai/chat";
|
||||
} else {
|
||||
// 用户机器人
|
||||
|
||||
Reference in New Issue
Block a user