Skip to content

Commit

Permalink
Always call StreamChatCompletionSubscriber.onComplete()
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Mar 15, 2024
1 parent f148979 commit 9dbd59b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ public void streamChatCompletion(
(__, ex) -> {
if (ex != null) {
subscriber.onException(ex);
} else {
subscriber.onComplete();
}
subscriber.onComplete();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface StreamChatCompletionSubscriber {
/** Will be called if any exception happens while processing * */
void onException(Throwable ex);

/** Will be called when the stream is complete */
/** Will be called when the stream is complete or an exception has happened */
void onComplete();
}

0 comments on commit 9dbd59b

Please sign in to comment.