Skip to content

feat: add component name and type to StreamingChunk #9426

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 19 commits into from
May 27, 2025

Conversation

Amnah199
Copy link
Contributor

@Amnah199 Amnah199 commented May 22, 2025

Related Issues

Proposed Changes:

  • Create internal attribute to save component_name for component instances added to pipeline
  • Add a ComponentInfo data class used by StreamingChunk to stream information about the components.
  • Update ChatGenerators to send component_info to streaming_callback

How did you test it?

Notes for the reviewer

Once this PR is reviewed, we can update the ChatGenerators in core-integrations to stream component_info.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@github-actions github-actions bot added topic:core type:documentation Improvements on the docs labels May 22, 2025
@coveralls
Copy link
Collaborator

coveralls commented May 22, 2025

Pull Request Test Coverage Report for Build 15272575453

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 53 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.005%) to 90.201%

Files with Coverage Reduction New Missed Lines %
dataclasses/init.py 1 46.15%
utils/hf.py 2 85.71%
dataclasses/streaming_chunk.py 4 87.88%
components/generators/chat/hugging_face_api.py 6 94.0%
components/generators/chat/openai.py 8 95.14%
components/generators/chat/hugging_face_local.py 16 80.19%
core/pipeline/base.py 16 93.54%
Totals Coverage Status
Change from base Build 15272536119: 0.005%
Covered Lines: 11405
Relevant Lines: 12644

💛 - Coveralls

@Amnah199 Amnah199 marked this pull request as ready for review May 22, 2025 14:58
@Amnah199 Amnah199 requested review from a team as code owners May 22, 2025 14:58
@Amnah199 Amnah199 requested review from dfokina and davidsbatista and removed request for a team May 22, 2025 14:58
@sjrl
Copy link
Contributor

sjrl commented May 27, 2025

Looking good! Just one last comment on using the from_component util method where possible.

Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add identifying information to StreamingChunk (e.g. component_name, component_type, model_name)
3 participants