⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@constantinius
Copy link
Contributor

@constantinius constantinius requested a review from a team as a code owner December 17, 2025 14:14
@linear
Copy link

linear bot commented Dec 17, 2025

Base automatically changed from constantinius/fix/redact-message-parts-type-blob to master January 13, 2026 09:56
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • feat(asyncio): Add on-demand way to enable AsyncioIntegration by sentrivana in #5288

Bug Fixes 🐛

  • fix(ai): redact message parts content of type blob by constantinius in #5243
  • fix(clickhouse): Guard against module shadowing by alexander-alderman-webb in #5250
  • fix(gql): Revert signature change of patched gql.Client.execute by alexander-alderman-webb in #5289
  • fix(integrations): pydantic-ai: properly format binary input message parts to be conformant with the gen_ai.request.messages structure by constantinius in #5251
  • fix(litellm): Guard against module shadowing by alexander-alderman-webb in #5249
  • fix(pure-eval): Guard against module shadowing by alexander-alderman-webb in #5252
  • fix(ray): Guard against module shadowing by alexander-alderman-webb in #5254
  • fix(threading): Handle channels shadowing by sentrivana in #5299
  • fix(typer): Guard against module shadowing by alexander-alderman-webb in #5253

Documentation 📚

  • docs: Update Python versions banner in README by sentrivana in #5287

Internal Changes 🔧

  • chore(gen_ai): add auto-enablement for google genai by shellmayr in #5295
  • ci(release): Switch from action-prepare-release to Craft by BYK in #5290

🤖 This preview updates automatically when you update the PR.

"type": "blob",
"modality": item.media_type.split("/")[0],
"mime_type": item.media_type,
"content": f"data:{item.media_type};base64,{base64.b64encode(item.data).decode('utf-8')}",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should encode item.data here because it is stripped away anyway by the new blob redaction. I assume it's an operation that might fail, and if we don't emit the result, there's no point risking it.

can we just remove the "content" entry from the dictionary here? The assignment to BLOB_DATA_SUBSTITUTE will happen down the line anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As you said theres two considerations: making the conversion that could fail and doing work that may be undone later.

ad 1: I think we should make it failsafe, try/catch and simply don't set the content if we fail
ad 2: In the sense of the single responsibility principle: the integrations job is to properly report the messages back and forth and IMHO should not be concerned with redaction. Because if we later decide that we do not want to redact we would just need to change one area, not look through all integrations. Sure, a little contrived example, but I would consider it cleaner.

On the other hand I'm not the primary maintainer, so if you prefer to change it I would be okay with that. What do you say?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking more about the contract that we have with the SDK users that we do the minimum work that is reasonable to collect the telemetry we emit and nothing else.

So, while I generally agree with your point about single-responsibility, I would class decoding a potentially large object as non-trivial enough that we shouldn't do it now. But yes, we will have to keep in mind that some downstream logic is bleeding into the integration as maintainers 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants