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

Add token summary to text generation output #336

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented Feb 14, 2024

Closes #287.

The summary looks like this token_summary: %{input: 5, output: 20, padding: 95}. When streaming, there is a new option :stream_done, which enables a final message and includes the usual result except for text, for example {:done, %{token_summary: ...}}.

@jonatanklosko jonatanklosko merged commit 1b24085 into main Feb 14, 2024
2 checks passed
@jonatanklosko jonatanklosko deleted the jk-num-output-tokens branch February 14, 2024 19:42
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.

Support returning token count information
2 participants