no message

This commit is contained in:
kuaifan
2025-07-29 16:58:33 +08:00
parent f5847a57c1
commit c26f73a5a8
2 changed files with 31 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ use App\Models\WebSocketDialogMsgTranslate;
use App\Models\WebSocketDialogSession;
use App\Module\Table\OnlineData;
use App\Module\ZincSearch\ZincSearchDialogMsg;
use App\Tasks\BotReceiveMsgTask;
use Hhxsv5\LaravelS\Swoole\Task\Task;
/**
@@ -2441,6 +2442,33 @@ class DialogController extends AbstractController
return Base::retSuccess("success", $data);
}
/**
* @api {post} api/dialog/msg/webhookmsg2ai 48. 转换为AI对话
*
* @apiDescription 需要token身份将webhook消息转换为适合AI对话的格式消息用于AI对话
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName msg__webhookmsg2ai
*
* @apiParam {String} msg 消息内容
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function msg__webhookmsg2ai()
{
User::auth();
//
$msg = Request::input('msg');
try {
$res = BotReceiveMsgTask::convertMentionForAI($msg);
return Base::retSuccess("success", ['msg' => $res]);
} catch (\Exception $e) {
return Base::retError($e->getMessage());
}
}
/**
* @api {get} api/dialog/group/add 48. 新增群组
*