原文链接: https://atjason.com/daily/2023-03-19.html
要在小程序中实现 ChatGPT 的流式响应,还挺麻烦,涉及的环节比较多:
-
小程序 wx.request 中开启
enableChunked
; -
请求 OpenAI 接口时,开启
stream
; -
Axios 指定返回类型为
stream
; -
nginx 服务器配置中,开启
chunked_transfer_encoding
,关闭proxy_buffering
本文转自: https://atjason.com/daily/2023-03-19.html
本站仅做收录,版权归原作者所有。