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

fix: stream return EOF when openai return error #184

Merged
merged 9 commits into from
Mar 22, 2023

Conversation

liushuangls
Copy link
Contributor

fix #173

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! 🔥 Looks good overall, but there are a couple of comments. Would you be able to fix those?

stream.go Outdated Show resolved Hide resolved
chat_stream.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #184 (e82a2f5) into master (d529d13) will increase coverage by 0.47%.
The diff coverage is 93.15%.

@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
+ Coverage   70.65%   71.12%   +0.47%     
==========================================
  Files          18       21       +3     
  Lines         535      568      +33     
==========================================
+ Hits          378      404      +26     
- Misses        121      125       +4     
- Partials       36       39       +3     
Impacted Files Coverage Δ
stream_reader.go 88.88% <88.88%> (ø)
error_accumulator.go 95.23% <95.23%> (ø)
chat_stream.go 85.00% <100.00%> (+6.73%) ⬆️
stream.go 70.00% <100.00%> (-2.35%) ⬇️
unmarshaler.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

chat_stream.go Outdated Show resolved Hide resolved
@sashabaranov
Copy link
Owner

Wow, great work! Got a couple of comments, in any case I think we can merge now

stream.go Outdated Show resolved Hide resolved
@sashabaranov sashabaranov merged commit a5a945a into sashabaranov:master Mar 22, 2023
@liushuangls liushuangls deleted the fix-stream-err-EOF branch March 22, 2023 05:33
@maplessssy
Copy link

nice. I meet the same EOF error in v1.5.2.

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

Successfully merging this pull request may close these issues.

ChatCompletionRequest with stream: true return EOF
3 participants