go-openai icon indicating copy to clipboard operation
go-openai copied to clipboard

Ability to count tokens before sending

Open AndrewMohawk opened this issue 2 years ago • 0 comments

Reading the Open AI docs on Chat completion they specifically call out counting tokens on input (as you are billed on these as well as the amount of tokens on output). They use their TikToken python library, it would be awesome if there was something in this lib to do the same

AndrewMohawk avatar Mar 26 '23 16:03 AndrewMohawk