Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

已经部署好了,欢迎大家啊使用 🤭:https://openai.proxy.mailjob.net #7

Open
jefferyjob opened this issue Mar 15, 2023 · 4 comments

Comments

@jefferyjob
Copy link

No description provided.

@geekr-dev
Copy link
Owner

我这两天打算让它支持流式响应

@blueicesir
Copy link

blueicesir commented Mar 16, 2023

SSE支持,请参考 https://github.com/rakyll/openai-go 中的openai.go代码,需要使用bufio.NewScanner()读取http的Response数据,分片返回就可以了。

另外互联网上查了一下Server Sent Events说只支持GET方式的http请求,当实际openai的API是通过POST方式发起的,只是openai的服务器检查到stream=true时,会采用这种分片的方式发送数据,分别event有data两行,其中data中就是需要返回的json数据,你做代理就直接分片中转发送给客户。

@jefferyjob
Copy link
Author

我这两天打算让它支持流式响应

期待支持,哈哈

@jefferyjob
Copy link
Author

ea238c1a7c3a77c17a1756719a5c8b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants