Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LangChain4j committed Mar 8, 2024
1 parent 98cb30c commit e09682d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/dev/ai4j/openai4j/StreamingRequestExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ public void onFailure(EventSource eventSource, Throwable t, okhttp3.Response res
return;
}

// TODO remove this when migrating from okhttp
if (t instanceof IllegalArgumentException && "byteCount < 0: -1".equals(t.getMessage())) {
streamingCompletionCallback.run();
return;
}

if (logStreamingResponses) {
log.debug("onFailure()", t);
responseLogger.log(response);
Expand Down

0 comments on commit e09682d

Please sign in to comment.