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

🚀 功能建议:改进 OpenAI 的 stream 请求停止实现 #560

Open
5 tasks done
tisfeng opened this issue May 20, 2024 · 0 comments
Open
5 tasks done

🚀 功能建议:改进 OpenAI 的 stream 请求停止实现 #560

tisfeng opened this issue May 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request fixed in next release The issue will be closed once next release is available

Comments

@tisfeng
Copy link
Owner

tisfeng commented May 20, 2024

请先确认以下事项

  • 已仔细阅读了 README
  • issues 页面搜索过(包括已关闭的 issue),未发现类似功能建议
  • Easydict 已升级到 最新版本
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

功能描述

由于使用的第三方库 OpenAI 不支持停止 stream 请求,因此目前的代码实现只是忽略了 isStreamFinished 的请求,但这样会有一个问题,如果某个请求 A 内容特别长,以至于下个新的请求发出时,请求 A 还没有结束,这样会导致同时出现两个请求交错 completion 😥

output.mp4

使用场景

实现方案(可选)

已经有人提了这个问题 Cancel the async openAI.chatsStream(query: query) ,但这个库的维护者并没有响应,这里有个实现 longseespace/OpenAI@a290a1a ,或许我们将它 pick 到自己 fork 的库上 OpenAI

是否愿意提交 PR 实现该功能

  • 我愿意提交 PR
@tisfeng tisfeng added the enhancement New feature or request label May 20, 2024
@tisfeng tisfeng self-assigned this Jun 2, 2024
@tisfeng tisfeng added the fixed in next release The issue will be closed once next release is available label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in next release The issue will be closed once next release is available
Projects
None yet
Development

No branches or pull requests

1 participant