Repository navigation
fix(portkey): do not consume generator content and map image parts (#829) - #988
Open
VimalN2005 wants to merge 2 commits into
Open
VimalN2005 wants to merge 2 commits into
VimalN2005 wants to merge 2 commits into
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-10-28 20:49 UTC Two things need attention:
Status above doesn't look right?
|
rads-1996
reviewed
Oct 26, 2026
rads-1996
reviewed
Oct 26, 2026
rads-1996
reviewed
Oct 26, 2026
Contributor
|
#843 is a related PR.. not sure exactly what the status is of that one.. author stopped responding |
…pen-telemetry#829) Signed-off-by: VimalN2005 <[email protected]>
… and bump floor util-genai Signed-off-by: VimalN2005 <[email protected]>
VimalN2005
force-pushed
the
fix/portkey-generator-content-829
branch
from
October 28, 2026 20:19
e957283 to
94e10f0
Compare
This branch has not been deployed
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.
Description
Fixes #829.
When
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTis enabled:_prepare_input_messagesiterated genericIterablecontent. Ifcontentwas a generator or iterator (or ifmessages/toolswere one-shot iterables), walking it prior to the wrapped SDK invocation drained it, causing empty content to be sent to the model provider.tupleinputs for messages and content) were either dropped or lacked full sequence handling.image_urldicts or data URLs) were skipped instead of being mapped toBlobPartorUriPart.Changes Made
content,messages, andtoolstoSequence(excludingstr,bytes,bytearray), ensuring generator/iterator content is not consumed by telemetry prior to the client call.tupleinputs for messages, content, and tool sequences._extract_content_partto map image parts usingimage_from_url(BlobPartfor base64 data URLs,UriPartfor standard URLs)..changelog/829.fixed.Type of Change
Testing
Ran unit tests for
opentelemetry-instrumentation-genai-portkey: