Skip to content

Conversation

@sauravpanda
Copy link
Member

@sauravpanda sauravpanda commented Jun 19, 2024

Summary

Updated handling of total_token logic for consistency across multiple modules.

Details

  • Introduced a structured approach to total_token handling by initializing total_usage with specific token categories.
  • Updated total_usage initialization to include prompt_tokens and completion_tokens categories.
  • Implemented the new token structure in multiple modules to ensure consistency.
  • Refactored code in ui.py, code_review.py, and work_summarizer.py to incorporate the new token handling logic.
  • Updated project version to 0.2.6 in pyproject.toml for version consistency.

✨ Generated with love by Kaizen ❤️

Original Description None

@sauravpanda sauravpanda linked an issue Jun 19, 2024 that may be closed by this pull request
@kaizen-bot
Copy link
Contributor

kaizen-bot bot commented Jun 19, 2024

Code Review

All Clear: This PR is ready to merge! 👍

Improvements

[important] -> Initialize 'total_usage' with structured data instead of None.

Potential Solution:

Instead of initializing 'total_usage' with None in multiple places, initialize it with structured data like{"prompt_tokens": 0, "completion_tokens": 0}. This ensures consistency and avoids potential errors.

kaizen/generator/ui.py | 81 - 81

request_for_change: True

[important] -> Initialize 'total_usage' consistently with structured data.

Potential Solution:

Ensure 'total_usage' is consistently initialized with{"prompt_tokens": 0, "completion_tokens": 0}throughout the codebase for clarity and consistency.

kaizen/reviewer/work_summarizer.py | 22 - 22

request_for_change: True

✨ Generated with love by Kaizen ❤️

@sauravpanda sauravpanda merged commit 5c6967b into main Jun 19, 2024
@cloudcodeai-nightly
Copy link

Code Review

All Clear: This PR is ready to merge! 👍

✨ Generated with love by Kaizen ❤️

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.

bug in token calculation

2 participants