Skip to content

Add _to_trace_dict for image content and file content#10989

Merged
sjrl merged 2 commits intomainfrom
add-trace-dict-image-content
Mar 31, 2026
Merged

Add _to_trace_dict for image content and file content#10989
sjrl merged 2 commits intomainfrom
add-trace-dict-image-content

Conversation

@sjrl
Copy link
Copy Markdown
Contributor

@sjrl sjrl commented Mar 31, 2026

Related Issues

  • fixes issue in platform for sending large binary objects to the tracing backend

Proposed Changes:

Follow the same strategy used in ByteStream and for tracing backends only send a placeholder for the binary data.

How did you test it?

Added unit tests

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have 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 have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@sjrl sjrl requested a review from a team as a code owner March 31, 2026 06:28
@sjrl sjrl requested review from anakin87 and removed request for a team March 31, 2026 06:28
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Preview Mar 31, 2026 7:33am

Request Review

@sjrl sjrl requested a review from Amnah199 March 31, 2026 06:29
@github-actions github-actions Bot added the type:documentation Improvements on the docs label Mar 31, 2026
@sjrl sjrl self-assigned this Mar 31, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 31, 2026

Pull Request Test Coverage Report for Build 23785870335

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 92.903%

Totals Coverage Status
Change from base Build 23754030523: 0.004%
Covered Lines: 15878
Relevant Lines: 17091

💛 - Coveralls

Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I have no problems with introducing these methods.

But I am not fully sure that this fixes the logging issue.

@sjrl @Amnah199 feel free to share your impressions.


EDIT: we mean tracing, not logging

Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Can you also change this code

if isinstance(part, ImageContent):
serialized_part["image"]["base64_image"] = f"Base64 string ({len(part.base64_image)} characters)"
elif isinstance(part, FileContent):
serialized_part["file"]["base64_data"] = f"Base64 string ({len(part.base64_data)} characters)"
serialized["content"].append(serialized_part)

to use the newly introduced methods (for consistency)?

@sjrl sjrl added this to the 2.27.0 milestone Mar 31, 2026
@sjrl
Copy link
Copy Markdown
Contributor Author

sjrl commented Mar 31, 2026

Can you also change this code

if isinstance(part, ImageContent):
serialized_part["image"]["base64_image"] = f"Base64 string ({len(part.base64_image)} characters)"
elif isinstance(part, FileContent):
serialized_part["file"]["base64_data"] = f"Base64 string ({len(part.base64_data)} characters)"
serialized["content"].append(serialized_part)

to use the newly introduced methods (for consistency)?

Done in 96d44e3

Copy link
Copy Markdown
Member

@anakin87 anakin87 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!

@sjrl sjrl enabled auto-merge (squash) March 31, 2026 07:35
@sjrl sjrl merged commit f77b09e into main Mar 31, 2026
22 checks passed
@sjrl sjrl deleted the add-trace-dict-image-content branch March 31, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants