Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public Flux<ChatResponse> internalStream(Prompt prompt, ChatResponse previousCha
MergeUtils::mergeChatCompletions);
return List.of(reduce);
})
.flatMap(mono -> mono);
.flatMapSequential(mono -> mono);

final Flux<ChatResponse> chatResponseFlux = accessibleChatCompletionsFlux.map(chatCompletion -> {
if (previousChatResponse == null) {
Expand All @@ -377,7 +377,7 @@ public Flux<ChatResponse> internalStream(Prompt prompt, ChatResponse previousCha
return chatResponse1;
});

return chatResponseFlux.flatMap(chatResponse -> {
return chatResponseFlux.flatMapSequential(chatResponse -> {
if (this.toolExecutionEligibilityPredicate.isToolExecutionRequired(prompt.getOptions(), chatResponse)) {
// FIXME: bounded elastic needs to be used since tool calling
// is currently only synchronous
Expand Down