admin管理员组文章数量:1026989
源码下载地址: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',
源码下载地址: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',
版权声明:本文标题:PHP实现chatGPT流式输出代码,OpenAI对接,支持GPT3.5GPT4 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1724527343a478646.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论