Add input and output tokens used and model to the response object.
One of the very useful things about the Open AI API is that the response includes the amount of input and output tokens used , as well as the model that was hit. I am recording this data per call in my firebase instance for my app along with time of processing to monitor performance. I also add the appropriate cost per model in there and so I dynamically calculate the costs per model call as well. This helps me make business case decisions on how I use the AI.
It would be great to have that available in the Vertex AI API calls as well.
Is the way to get that now to make a separate call?
const { totalTokens, totalBillableCharacters } = await model.countTokens([prompt, imagePart]);