feat: 完善AI助手功能,新增消息提示词整理接口,优化流式消息处理逻辑,移除冗余数据表和相关代码

This commit is contained in:
kuaifan
2025-11-07 22:03:11 +00:00
parent 892ad395a7
commit 69c66053b7
10 changed files with 457 additions and 466 deletions

View File

@@ -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 {
// 用户机器人