-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Milestone
Description
Bug description
Streamed chunks might end up in a wrong order:
data: <A>
data: <B>
can end up as <B> => <A>
Environment
- Spring AI
1.0.1
- Java 21
Steps to reproduce
It's enough to inject the default AzureOpenAIChatModel
, build a ChatClient
and call
val chatClient = ChatClient.builder(chatModel).build()
chatClient
.prompt(createPrompt(simpleResponseDeploymentName))
.stream()
.content()
.collectList()
.block()
On a local machine I need many sequential runs to trigger the issue, thus, a setup with WireMock is advisable.
Expected behavior
The response chunks should be ordered correctly.
Minimal Complete Reproducible example
Repo with test setup: https://github.com/robinmayerhofer/spring-ai-azure-openai-streaming-issue