What I Did:
Implemented a new --token-usage flag to display token statistics when generating comments via the Groq API.
Modified the logic to capture token usage and log it to the console if the flag is used.
How I Did It:
Used the commander library to check for the presence of the --token-usage flag.
Added logic to capture the token usage from the API response and print it in a readable format.
Why I Made These Choices:
This feature allows users to monitor their API usage, which can be important for keeping track of costs and performance when working with API rate limits.
Problems Encountered:
No major issues encountered during development, though I tested edge cases to ensure the flag works correctly without breaking existing functionality
What I Did: Implemented a new --token-usage flag to display token statistics when generating comments via the Groq API. Modified the logic to capture token usage and log it to the console if the flag is used.
How I Did It: Used the commander library to check for the presence of the --token-usage flag. Added logic to capture the token usage from the API response and print it in a readable format.
Why I Made These Choices: This feature allows users to monitor their API usage, which can be important for keeping track of costs and performance when working with API rate limits.
Problems Encountered: No major issues encountered during development, though I tested edge cases to ensure the flag works correctly without breaking existing functionality