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

deepset-ai / haystack / 20371470877
92%

Build:
DEFAULT BRANCH: main
Ran 19 Dec 2025 01:31PM UTC
Jobs 1
Files 244
Run time 121min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Dec 2025 01:28PM UTC coverage: 92.183% (+0.03%) from 92.158%
20371470877

push

github

web-flow
feat: Add reasoning support for HuggingFaceAPIChatGenerator (#9701) (#10248)

* feat: add reasoning support for HuggingFaceAPIChatGenerator

Add reasoning field extraction for both streaming and non-streaming modes
in HuggingFaceAPIChatGenerator, aligning with the parent issue #9700
initiative to standardize reasoning support across all ChatGenerators.

Changes:
- Extract reasoning from choice.message.reasoning in non-streaming mode
- Extract reasoning from choice.delta.reasoning in streaming mode
- Accumulate reasoning chunks in streaming and create final ReasoningContent
- Add backward compatibility check using hasattr() for API responses
- Add 11 comprehensive tests covering all reasoning scenarios

The reasoning content is stored in ChatMessage.reasoning field (not meta),
following the pattern established in PR #9696.

Closes #9701
Ref #9700

* fix: skip ReasoningContent in convert_message_to_hf_format for multi-turn

Address PR review feedback:
- Update convert_message_to_hf_format to explicitly skip ReasoningContent
  during conversion (HF API doesn't support reasoning in input messages)
- Add multi-turn integration test with reasoning model
- Add unit tests for ReasoningContent handling in conversion

* fix: use reStructuredText formatting in release note

Convert Markdown to reStructuredText:
- Use double backticks for inline code
- Use .. code:: python directive for code blocks

* refactor: extract common reasoning extraction logic into helper function

Address review feedback from @mpangrazzi:
- Extract duplicated reasoning extraction code into _extract_reasoning_content()
- Use helper function in streaming, sync, and async methods
- Shorten release note to be more concise

* test: increase max_tokens to 300 in multi-turn HuggingFaceAPIChatGenerator integration test for stability

---------

Co-authored-by: Michele Pangrazzi <xmikex83@gmail.com>

14151 of 15351 relevant lines covered (92.18%)

0.92 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
5
87.5
4.64% components/generators/utils.py
7
96.67
0.11% components/generators/chat/hugging_face_api.py
14
87.56
0.06% utils/hf.py
Jobs
ID Job ID Ran Files Coverage
1 20371470877.1 19 Dec 2025 01:31PM UTC 244
92.18
GitHub Action Run
Source Files on build 20371470877
  • Tree
  • List 244
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20371470877
  • 9082c971 on github
  • Prev Build on main (#20368946883)
  • Next Build on main (#20373472849)
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

© 2025 Coveralls, Inc