Closed nchan1994 closed 1 month ago
This project is undergoing a major revamp; closing out old issues as part of the prep process.
The chatgpt
package is pretty outdated at this point. I recommend that you use the openai package or the openai-fetch package instead.
Verify latest release
chatgpt
releaseVerify webapp is working
Environment details
Typescript, Visual Studio Code
Describe the Bug
Not a bug, but hoping to get some guidance.
Not very familiar with Typescript, but hoping to make a couple of changes to pre-existing code using this awesome ChatGPT API.
I want to grab and store the token usage for each prompt and response to and from openai. But idk how to grab the token response. The code snippet I have is below:
Would be great if someone could tell me how I can edit/add to this so I can get the token usage. I read through some of the issues and someone recommended looking at 'details'? Where would I add this because I tried several ways doesn't seem to work.
Many thanks!