这是indexloc提供的服务,不要输入任何密码
Skip to content

Add support for capturing usage prompt_tokens_details and completion_tokens_details #94

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

antsmc2
Copy link
Contributor

@antsmc2 antsmc2 commented Mar 16, 2025

The existing code does not capture prompt_tokens_details and completion_tokens_details usage objects. For example, prompt_tokens_details contains the cached_tokens attribute, which can be useful in understanding how much input prompts are cached (related doc here ). This PR adds PromptTokensDetails and PromptTokensDetails attributes to the existing Usage class. I expect this change to be backward-compatible.

Related API reference here

@Lambdua Lambdua merged commit b2ca240 into Lambdua:main Mar 18, 2025
@antsmc2 antsmc2 deleted the antsmc2/add-support-for-prompt_tokens_details-and-completion_tokens_details branch March 18, 2025 05:07
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