Skip to content

Estimate token usage, cost #546

Answered by zzstoatzz
ww-jermaine asked this question in Q&A
Discussion options

You must be logged in to vote

hey all, apologies for the radio silence here. I'll try to keep better track of these going forward

I've answered similar questions in discord (come chat!) but here's a gist

tldr

  • subclass MarvinClient and add some ChatCompletion processor to do what you want with the usage OpenAI gives back
  • you can use some basic util like I have here to inspect payloads before we send them out. we should probably add this ourselves to make it easy

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ww-jermaine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants