Documentation
¶
Index ¶
- Constants
- func CountOpenAIChatCompletion(msgs []openai.ChatCompletionMessageParamUnion, ...) int64
- func CountOpenAIChatCompletionParams(p openai.ChatCompletionNewParams) int64
- func CountOpenAIMessages(msgs []openai.ChatCompletionMessageParamUnion, model string) int64
- func CountTools(tools []openai.ChatCompletionToolUnionParam, model string) int64
- func EncoderForModel(model string) (*tiktoken.Tiktoken, error)
- func MessageOverhead(model string) (tokensPerMessage, tokensPerName int)
- func TextTokens(text string, model string) int64
- func VisionTokensForDataURL(url string) int64
- func VisionTokensForFile(path string) int64
Constants ¶
View Source
const ( DefaultEncoding = tiktoken.MODEL_O200K_BASE DefaultModel = "gpt-4o" )
Variables ¶
This section is empty.
Functions ¶
func CountOpenAIChatCompletion ¶
func CountOpenAIChatCompletion(msgs []openai.ChatCompletionMessageParamUnion, tools []openai.ChatCompletionToolUnionParam, model string) int64
func CountOpenAIChatCompletionParams ¶
func CountOpenAIChatCompletionParams(p openai.ChatCompletionNewParams) int64
func CountOpenAIMessages ¶
func CountOpenAIMessages(msgs []openai.ChatCompletionMessageParamUnion, model string) int64
func CountTools ¶
func CountTools(tools []openai.ChatCompletionToolUnionParam, model string) int64
func MessageOverhead ¶
func TextTokens ¶
func VisionTokensForDataURL ¶
func VisionTokensForFile ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.