-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore!: Update finish reason in output of HuggingFaceAPIChatGenerator to match between stream and non-stream modes
#9686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e1819e2
Update finish reason
sjrl d01588e
Fix unit test
sjrl fbe012d
Merge branch 'main' of github.com:deepset-ai/haystack into update-fin…
sjrl 1be1f8e
Add reno
sjrl 7eedcaa
Update releasenotes/notes/update-finish-reason-hf-api-chat-gen-c70004…
sjrl 00b8ea0
Update async as well
sjrl 0990e5b
Merge branch 'update-finish-reason-hf-api-chat-gen' of github.com:dee…
sjrl d45da5d
Fix unit test
sjrl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
releasenotes/notes/update-finish-reason-hf-api-chat-gen-c700042a079733e8.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| upgrade: | ||
| - | | ||
| The `finish_reason` field behavior in `HuggingFaceAPIChatGenerator` has been | ||
| updated. Previously, the new `finish_reason` mapping (introduced in Haystack 2.15.0 release) was only applied when streaming was enabled. When streaming was disabled, | ||
| the old `finish_reason` was still returned. This change ensures the updated | ||
| `finish_reason` values are consistently returned regardless of streaming mode. | ||
|
|
||
| **How to know if you're affected:** | ||
| If you rely on `finish_reason` in responses from `HuggingFaceAPIChatGenerator` | ||
| with streaming disabled, you may see different values after this upgrade. | ||
|
|
||
| **What to do:** | ||
| Review the updated mapping: | ||
| - `length` → `length` | ||
| - `eos_token` → `stop` | ||
| - `stop_sequence` → `stop` | ||
| - If tool calls are present → `tool_calls` |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.