-
Notifications
You must be signed in to change notification settings - Fork 693
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
fix(openai): add structured output instrumentation #2111
Conversation
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.
Thanks @9dogs! We add the response format here or in a separate PR - up to you (if you do that - we might as well add everything from the recently published semantic conventions)
I cannot say I fully understand what's going on with semconvs, so let's leave the scope of this PR as it is. |
1e123c1
to
a15ba8d
Compare
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.
Thanks @9dogs! Left a small comment
@@ -197,6 +197,32 @@ def _instrument(self, **kwargs): | |||
"Assistants.create", | |||
assistants_create_wrapper(tracer), | |||
) | |||
wrap_function_wrapper( |
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.
@9dogs we should wrap these in try-except since this may fail on old OpenAI SDK versions (this is why the tests are currently failing)
63be127
to
40406fb
Compare
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.
Thanks @9dogs!
feat(instrumentation): ...
orfix(instrumentation): ...
.Fixes #1815. I'm not sure if the response_format span attribute should be added in this PR as well.
Also, the metrics tests are a bit fragile since each executed test adds its metrics to the
reader.get_metrics_data()
result, so figuring out what was added is a bit tricky.