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 BaseOpenAIChatCompletionClient token usage #4770

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gziz
Copy link
Contributor

@gziz gziz commented Dec 20, 2024

Why are these changes needed?

To correctly track the token usage in BaseOpenAIChatCompletionClient, more info on the issue.

Related issue number

#4769

Checks

@gziz gziz changed the title Fix openai client token usage (#4769) Fix BaseOpenAIChatCompletionClient token usage Dec 20, 2024
@@ -561,8 +554,7 @@ async def create(
logprobs=logprobs,
)

_add_usage(self._actual_usage, usage)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what's the difference between these two...

@gziz gziz requested a review from ekzhu December 21, 2024 01:26
@ekzhu ekzhu requested review from lspinheiro and jackgerrits and removed request for ekzhu December 22, 2024 02:03
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.

1 participant