Fixes #2318 by adding prompt and completion tokens to the assistant spans.
In addition:
Add gen_ai.system = openai attribute.
Fix the dict key lookup that caused the assistant.run spans to have end_time later than the actual value (sometimes caused the span to outlive the parent)
Remove time.sleep from test because it has a VCR fixture, reducing openai tests time from 38s to 12s
[X] I have added tests that cover my changes.
[ ] If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
[X] PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
[ ] (If applicable) I have updated the documentation accordingly.
Fixes #2318 by adding prompt and completion tokens to the assistant spans.
In addition:
gen_ai.system = openai
attribute.time.sleep
from test because it has a VCR fixture, reducing openai tests time from 38s to 12sfeat(instrumentation): ...
orfix(instrumentation): ...
.