Repository navigation
Conversation
…erator Gemini's OpenAI-compatible endpoint streams tool calls with no index, which made StreamingChunk raise a ValueError. An index-less delta with a name or an id now starts a new tool call at the next free index; one with neither continues the previous tool call.
Contributor
|
@chrikrah is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Verified the fix locally. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Proposed Changes:
OpenAIChatGeneratorraises aValueErrorwhen an OpenAI-compatible server streams a tool call with noindex, which Gemini's endpoint still does per the last report in the forum thread (2025-11).haystack/components/generators/chat/openai.py:734copies theNoneintoToolCallDeltaandhaystack/dataclasses/streaming_chunk.py:153rejects it. The OpenRouter and vLLM generators in haystack-core-integrations import_convert_chat_completion_chunk_to_streaming_chunk, so they crash too and cannot fix it downstream. This PR assigns the index.Before, on
c5e1335, with a local server that sends one chunk with two such calls:After:
An index-less delta with a name or an id now starts a call at the next free index. One with neither continues the previous call, so a server that streams one call in fragments still works. Indexed calls are unchanged.
How did you test it?
Baseline on
c5e1335is 56 passed. The new tests cover whole calls and fragmented calls. Revertingopenai.pyand keeping both gives2 failed, 56 passed, 12 deselected. ruff 0.17.0 and mypy 2.4.0 report clean.Notes for the reviewer
None.
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.@anakin87 @sjrl (who merged #13047 in
openai.py): given #13187, is a crash fix in the shared converter acceptable here?