Skip to content

Commit

Permalink
Merge pull request #510 from philippart-s/fix-npe-#489
Browse files Browse the repository at this point in the history
fix: πŸ› fix NPE if chunk is null for Mistral AI
  • Loading branch information
geoand committed Apr 25, 2024
2 parents 1fcc955 + 0d8a93e commit 924563e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ public void accept(MistralAiChatCompletionResponse response) {
MistralAiChatCompletionChoice choice = response.getChoices().get(0);
String chunk = choice.getDelta().getContent();
contentBuilder.get().append(chunk);
handler.onNext(chunk);

if (chunk != null) {
handler.onNext(chunk);
}

MistralAiUsage usageInfo = response.getUsage();
if (usageInfo != null) {
Expand Down

0 comments on commit 924563e

Please sign in to comment.