源码下载地址:https://gitee/haoyachengge/chatgpt-speed.git
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
header('Connection: keep-alive');
header('X-Accel-Buffering: no');
$apiKey = config("open.apiKey");
$apiUrl = config("open.apiHost").'/v1/chat/completions';
//提问数据
$message = $request->param('message')??'hello!';
//分组
$group_id = $request->param('group_id');
//客户端ip
$ip = $request->ip();
// 连续对话需要带着上一个问题请求接口
$lastMsg = Db::table('ai_chat_msgs')->where([
['ip', '=', $ip],
['group_id',
发布评论