-
Notifications
You must be signed in to change notification settings - Fork 776
openai: Remove llm_request_attributes of type NOT_GIVEN
to avoid excessive warning messages
#3760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Note to reviewers, I'm unsure what the best way to update the cassette / VCR configurations is. If you have guidance for that please let me know. |
ac1b180
to
ec6ce62
Compare
…rumentation for chat.completions.create operations
ec6ce62
to
36f4e87
Compare
NOT_GIVEN
to avoid excessive warning messages.j;wNOT_GIVEN
to avoid excessive warning messages.
NOT_GIVEN
to avoid excessive warning messages.NOT_GIVEN
to avoid excessive warning messages
You remove the cassette and it gets recreated when you run tests again |
Ack. I'll have to do this later tonight then since I need to be on a different machine to hit the openai api. If you have any other issues with the PR lmk and I can resolve them. |
|
||
# filter out None values | ||
return {k: v for k, v in attributes.items() if v is not None} | ||
# filter out None values and NOT_GIVEN values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of explicitly defining this logic here, would it make more sense to create a function for this similar to - non_numerical_value_is_set
?
Description
This PR filters out attributes where the value is
NOT_GIVEN
form the llm_request_attributes dictionary. The type ofNOT_GIVEN
cannot be set as an attribute value which creates a warning message for users. Note this only occurs if a user directly sets the value to beNOT_GIVEN
, it doesn't occur for default values.This warning message is generated in
opentelemetry.attributes
here.Example WARNING log:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
This behavior can be confirmed by passing
NOT_GIVEN
directly into a completions.create function call:I've added this test case into the unittest.
test_chat_completion_handles_not_given
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.