openai-cookbook
openai-cookbook copied to clipboard
how to calculate tokens and pricing for the chat API
[optional format]
Identify the file to be fixed How_to_count_tokens_with_tiktoken.ipynb
Describe the problem This notebook explains how to calculate the total token for a conversation. But how can we measure the pricing for a chatbot given that for every query, the entire previous conversation is the input to the model? In this case, the number of tokens is much more than what is available in the example in the notebook