coderabbitai / ai-pr-reviewer

AI-based Pull Request Summarizer and Reviewer with Chat Capabilities.
https://coderabbit.ai
MIT License
1.41k stars 256 forks source link

Feature request: Show total token and cost as comment #498

Open cquanu opened 7 months ago

cquanu commented 7 months ago

Feature Request: I kindly request the implementation of a feature that enables users to view the total token count and associated cost as a comment in the PR.

Use cases:

  1. Simplify Token Management: With the feature in place, users won't have to switch between different tabs or APIs to check token usage. A simple glance at the comments section will provide the required information.

  2. Prevent Token Exhaustion: By displaying token count and cost in real-time as a comment, developers will have instant visibility into the potential token depletion and take necessary actions to avoid service disruptions.

  3. Optimize Workflows: Users can better understand which actions or workflows consume a significant number of tokens and modify them accordingly to reduce overall token consumption.

  4. Team Collaboration: When multiple team members work on a project, the token count and cost comment will serve as a shared reference point for everyone involved, avoiding unnecessary token conflicts and oversights.

Proposed Implementation: The feature could be implemented by introducing a new comment or a comment at the end of the Action logs.

Additional Notes: The comment displaying token count and cost could be styled differently from regular comments to make it more noticeable. It would also be beneficial to allow users to disable this feature if desired.

Implementing this feature would greatly enhance the token management capabilities, saving users time and effort in monitoring token usage while fostering a more efficient and collaborative development experience.

Thank you for your consideration.