signebedi / gptty

ChatGPT wrapper in your TTY
MIT License
47 stars 7 forks source link

[tests] add `tiktoken` to show token count in debug / verbose mode #29

Closed signebedi closed 1 year ago

signebedi commented 1 year ago

Users may have a legitimate desire to see token counts in verbose mode to help keep track of API usage.

https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb

In fact, it may even be useful to write this to the output.txt file to track usage over time.