Hi @Logan M . Since all llama index application involve usage of the OpenAI api key and therefore, it costs money to develop this kind of applications, I want to build a cost tracker. I've seen in the documentation that the TokenCountingHandler gives the exact number of tokens used in a query. A few days ago, it wasn't exact, it was an estimation. Am I right?
Also, I have this questions related to cost tracking:
- During the creation of an Index, this TokenCountingHandler computes the number of tokens used for this index creation? (TreeIndex for example).
- If we use the 'tree-summarize' option to obtain a response, does the TokenCountingHandler also takes into account the api calls made during this process?
In the end, what I want to know is if this TokenCountingHandler keeps track of all the OpenAI API calls during a query --> index creation, retrieval, embeddings, node post process, response synthesizer, etc.
Thanks in advanced!