-
Notifications
You must be signed in to change notification settings - Fork 601
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
Event attribute validation #2535
Conversation
@@ -158,7 +230,7 @@ def test_llm_custom_attributes_added_to_embedding_events | |||
'triceratops' => 'herbivore' | |||
}) | |||
stub_post_request do | |||
client.embeddings(parameters: chat_params) | |||
client.embeddings(parameters: embeddings_params) |
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.
This test is ensuring llm.
custom events are added. This change doesn't affect the test, but it always should've been embeddings_params
.
Co-authored-by: James Bunch <[email protected]>
assert attributes['request.model'] | ||
assert attributes['response.choices.finish_reason'] | ||
assert attributes['request.temperature'] | ||
assert attributes['duration'] |
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.
Does assert
ensure that each of the values would survive an #empty?
check or simply a #nil?
one?
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.
Great callout. I'll change these assert
s to refute_empty
for the hash 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.
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.
I think this looks great as-is! I have a few suggestions, but nothing you need to address now and can also disregard altogether :)
test/multiverse/suites/ruby_openai/ruby_openai_instrumentation_test.rb
Outdated
Show resolved
Hide resolved
3585f2d
Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
SimpleCov Report
|
Add tests to validate the desired attributed exist on chat completion, message, and embedding events.
Through testing, it was discovered that the
request_temperature
on chat completion events was not being assigned. That has been fix and a CHANGELOG reflects this change.closes #2440