-
Notifications
You must be signed in to change notification settings - Fork 34
fix(openai-instrumentation): logprobs reporting using span event #172
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
Conversation
| ChatCompletion.Choice.Logprobs | ||
| ChatCompletionChunk.Choice.Logprobs | ||
| CompletionChoice.Logprobs | ||
| null, |
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.
nit: I think it's undefined
, no?
} | ||
|
||
if ("content" in logprobs) { | ||
if (logprobs.content) { |
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.
Isn't it easier to do (logprobs as ChatCompletion.Choice.Logprobs).content
and then you can do it in a single if
?
}; | ||
}); | ||
} | ||
} else if ("token_logprobs" in logprobs) { |
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.
Here you can defintely just do a single if ((logprobs as CompletionChoice.Logprobs).tokens)
No description provided.