Repository navigation
Conversation
Author
|
Hi team , could anyone review my PR |
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.
Fixes #4598
Problem
_set_request_attributesin the litellm instrumentation only recorded model, temperature, top_p and max_tokens.seed,stop,frequency_penaltyandpresence_penaltywere passed through to the provider but never ended up on the span, even though the GenAI semconv defines attributes for all of them.Fix
Set
gen_ai.request.seed,gen_ai.request.stop_sequences,gen_ai.request.frequency_penaltyandgen_ai.request.presence_penaltyfrom kwargs. litellm acceptsstopas either a string or a list, while semconv definesstop_sequencesas a string array, so a plain string is wrapped in a list before it's recorded. An empty string is still skipped, same as before.Testing
Added a parametrized test in
test_completion.pycoveringstoppassed as a list and as a string. Full package suite passes locally (32 passed, 1 skipped) andruff checkis clean.Ran the repro from the issue against this branch:
Before (from the issue):
After:
feat(instrumentation): ...orfix(instrumentation): ....I used Claude Code (Opus 5.5) to help navigate the codebase and review the change; I wrote and tested the fix myself.
Summary by CodeRabbit