25 if (responseStreamHandler ==
null || token ==
null || token.getMessage() ==
null) {
29 String thinking = token.getMessage().getThinking();
30 String response = token.getMessage().getResponse();
32 boolean hasThinking = thinking !=
null && !thinking.isEmpty();
33 boolean hasResponse = response !=
null && !response.isEmpty();
35 if (!hasResponse && hasThinking && thinkingStreamHandler !=
null) {
36 thinkingStreamHandler.
accept(thinking);
37 }
else if (hasResponse) {
38 responseStreamHandler.
accept(response);