Skip to content
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-instrumentation): logprobs reporting using span event #172

Merged
merged 10 commits into from
Mar 27, 2024

Conversation

galkleinman
Copy link
Contributor

No description provided.

| ChatCompletion.Choice.Logprobs
| ChatCompletionChunk.Choice.Logprobs
| CompletionChoice.Logprobs
| null,
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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)

@galkleinman galkleinman changed the title feat(openai-instrumentation): logprobs reporting using span event fix(openai-instrumentation): logprobs reporting using span event Mar 27, 2024
@galkleinman galkleinman merged commit 923df7f into main Mar 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants