Skip to content

Fix OpenAI streaming tool-call chunks with empty ids#6369

Open
ultramancode wants to merge 1 commit into
spring-projects:mainfrom
ultramancode:fix/openai-streaming-tool-call-empty-id
Open

Fix OpenAI streaming tool-call chunks with empty ids#6369
ultramancode wants to merge 1 commit into
spring-projects:mainfrom
ultramancode:fix/openai-streaming-tool-call-empty-id

Conversation

@ultramancode

Copy link
Copy Markdown
Contributor

Refs #4790.

This fixes streaming tool-call merging when an OpenAI-compatible provider sends
continuation chunks with id: "".

OpenAiChatModel.ChunkMerger previously treated any present tool-call id as a
new tool-call boundary. With an empty id, that could leave a partial tool call
without a function name and fail with NoSuchElementException while converting
the merged chunk.

This update treats only non-empty ids as a new tool-call boundary, so empty-id
chunks follow the same continuation path as chunks where the id is omitted.

Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant