• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

deepset-ai / haystack / 20786350589

07 Jan 2026 03:20PM UTC coverage: 92.165% (+0.003%) from 92.162%
20786350589

push

github

web-flow
fix: Extract usage info from any chunk in streaming response (#10265)

* fix: Extract usage info from any chunk in streaming response

The previous implementation only looked at the last chunk for usage info,
which caused issues with some API providers (like Qwen3) that may return
usage in a different chunk than the final one.

Now we iterate through chunks in reverse order to find the last non-None
usage value, making usage extraction more robust across different providers.

Closes #10258

* docs: add release notes for streaming usage fix

* style: fix formatting in test_utils.py

---------

Co-authored-by: Vladimir Blagojevic <dovlex@gmail.com>

14387 of 15610 relevant lines covered (92.17%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.46
haystack/components/generators/utils.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc