Skip to content

Commit 4f520f8

Browse files
XuGongmingspring-builds
authored andcommitted
Update OpenAiStreamFunctionCallingHelper.java
Fixes #3534 When deploying qwen3 using vllm version 0.9.1, the ‘current. toolCalls()’ will result in an empty array Signed-off-by: 徐功明 <35555791+XuGongming@users.noreply.github.com> (cherry picked from commit a221a37)
1 parent ff5855d commit 4f520f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiStreamFunctionCallingHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private ChatCompletionMessage merge(ChatCompletionMessage previous, ChatCompleti
110110
toolCalls.addAll(previous.toolCalls().subList(0, previous.toolCalls().size() - 1));
111111
}
112112
}
113-
if (current.toolCalls() != null) {
113+
if (current.toolCalls() != null && current.toolCalls().size() > 0) {
114114
if (current.toolCalls().size() > 1) {
115115
throw new IllegalStateException("Currently only one tool call is supported per message!");
116116
}

0 commit comments

Comments
 (0)