Conversation
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The OpenAI instrumentor redacts oversized base64 images inside serialized
input.value. This change uses the configuredBlobUploaderafter a span records and replaces each oversized image leaf with the validated upload URI.Chat Completions and Responses share one deferred serializer. The serializer copies the request, preserves unrelated fields, and contains every upload failure within the affected image leaf.
Scope
messages[*].content[*].image_url.urlfor Chat Completions.input[*].content[*].image_urlfor Responses.output.valueand flattened message attributes unchanged.Tradeoffs
Serialized
input.valueand flattened image attributes may upload the same content separately. Cross-attribute deduplication is outside this issue.This PR targets the prerequisite branch from #3537. After the core helper ships, update the OpenAI package's lower bound to that released version before merging this PR into
main.Blast Radius
The change affects OpenAI request span attributes only. The original SDK request and the OpenAI call remain unchanged when copying, decoding, serialization, or upload fails.
Verification
uvx tox run -e ruff-mypy-test-openaipassed formatting, Ruff, mypy, and 510 tests on OpenAI 2.8.0.uvx tox run -e test-openai-v3 -- tests/openinference/instrumentation/openai/test_input_value_blob_upload.py tests/openinference/instrumentation/openai/test_input_value_image_hiding.pypassed 28 tests on OpenAI 3.0.0.Refs #3540