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

no usage available when using CreateChatCompletionStream #254

Closed
xoba opened this issue Apr 16, 2023 · 1 comment
Closed

no usage available when using CreateChatCompletionStream #254

xoba opened this issue Apr 16, 2023 · 1 comment

Comments

@xoba
Copy link

xoba commented Apr 16, 2023

whereas ChatCompletionResponse has a Usage field where i can see how many tokens were involved in a request, there is nothing like that for ChatCompletionStream. since i need to monitor usage, this is a problem for me. so i would request that usage is somehow provided for streaming requests. on the other hand, i heard that such information is not even provided by openai, which would be unfortunate. thanks!

@sashabaranov
Copy link
Owner

The OpenAI API does not return usage when streaming, see #223

You can try using https://github.com/pkoukk/tiktoken-go to count tokens, see #200

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

No branches or pull requests

2 participants