-
Notifications
You must be signed in to change notification settings - Fork 521
fix: Add Chat Completions choices data in traces when using streaming #725
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
|
seratch
left a comment
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 for sending this patch!
I have a few points on the suggested changes:
- my comment on the conversion logic maintenance cost
- add unit tests covering the scenario
| ) { | ||
| response.choices = event.response.output | ||
| .flatMap((o): OpenAI.Chat.Completions.ChatCompletion.Choice[] => { | ||
| if (o.type === 'function_call') { |
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.
The logic here requires updates when the platform adds new types. We'd like to explore more robust way to handle the conversion here.
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.
Yeah, I was worried about that too. Do you have any suggestions? This is the first time I've actually looked into this API!
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.
@seratch do you have any preferences on how to handle the conversion here?
|
This PR is stale because it has been open for 10 days with no activity. |
This PR attempts to fix the issue described at the bottom of #652 - the
choicesare missing from spans for Chat Completions, forGenerationspans.I'm unsure if this is the best way to do this, so I'm opening this to get a discussion going!