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 support for cached tokens in cost calculation #222

Open
wants to merge 115 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Oct 22, 2024

Add support for cached tokens in cost calculation

This pull request implements support for cached tokens in the cost calculation function. It addresses the issue described in #215.

Changes

  • Updated function to accept a parameter
  • Modified cost calculation formula to account for cached tokens
  • Updated the docstring with an example demonstrating the use of cached tokens
  • Added support for retrieving cached tokens from the dictionary in messages

Testing

The changes have been tested with various scenarios, including:

  • Cost calculation with and without cached tokens
  • Cost calculation using custom token costs
  • Cost calculation from message objects

Please review and let me know if any further changes or tests are needed.

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

@svilupp svilupp force-pushed the feature/cached-tokens-cost-calculation branch from 0c34f50 to 2117e1c Compare November 26, 2024 10:32
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.

9 participants