feat: relax OpenAI and HF chat message conversions - #12545
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
sjrl
marked this pull request as ready for review
September 2, 2026 05:47
sjrl
requested review from
anakin87 and
davidsbatista
and removed request for
a team and
davidsbatista
September 2, 2026 05:47
Contributor
Author
anakin87
reviewed
Sep 2, 2026
anakin87
left a comment
Member
There was a problem hiding this comment.
From the code point of view, it looks good
I'd improve/remove some comments and a test
anakin87
approved these changes
Sep 2, 2026
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
Agentcrashes on the next LLM call after a Chat Generator discards a malformed tool call #12541Proposed Changes:
ChatMessage.from_openai_dict_formataccepts the same empty content, so such a message round-trips.How did you test it?
New tests and expanded existing ones.
Also tested some of the HuggingFace integration components locally to check that their chat templates and models worked with empty assistant messages. E.g.
TransformersChatGeneratorwithHuggingFaceTB/SmolLM2-135M-InstructworkedHuggingFaceAPIChatGeneratorwithQwen/Qwen2.5-72B-Instructandmeta-llama/Llama-3.1-8B-InstructworkedNotes for the reviewer
Integrations that support empty content:
ibm/granite-4-h-smallworks. no changes needed since it uses the openai conversion util methodopenai/gpt-4.1-nanoworks. no changes needed since it uses the openai conversion util methodOpenAIChatGeneratorOpenAIChatGeneratorOpenAIChatGeneratorIntegrations that support empty content but will need an update:
claude-opus-5if we relax the converterqwen3:0.6bif we relax the converterQwen2.5-0.5B-Instruct-GGUFif we relax the converterIntegrations that don't support empty content
[user, assistant("")],[user, assistant("Paris is")]or[user, assistant(""), user][user, assistant("")], or[user, assistant(""), user]Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.