patrikzudel / PatrikZeros-ChatGPT-API-UI

Static webpage that allows you to use your OpenAI API key for the same experience as you get with ChatGPT!
https://chat.patrikzudel.me
GNU General Public License v3.0
506 stars 100 forks source link

Token tracking changes #16

Open graham00 opened 1 year ago

graham00 commented 1 year ago

This makes two changes:

  1. It changes the numbers beside each conversation to reflect the current conversation history token count. The previous behavior was that it was reflecting the entire historical token usage (even including when someone might have used 'summarize' to reduce it, or deleted messages) in the course of that conversation. I think most people looking at that number would expect/desire it to show the current effective token count of the conversation though, so that they could know when to expect to hit the 4000 token window and have the AI start to lose memory of earlier bits of a conversation.
  2. When a user uses 'summarize' it takes that into account and reflects the new shortened token history length for the conversation immediately.

The total tokens spent is still tracked properly (the token count in the settings dialog).