Documentation ¶
Index ¶
- func EncodingForModel(model string) (*tiktoken.Tiktoken, error)
- func IsEncodingForModel(model string) bool
- func NumTokensFromContent(tkm *tiktoken.Tiktoken, model string, content any) (numTokens int)
- func NumTokensFromMessages(model string, messages []model.ChatCompletionMessage) (numTokens int, err error)
- func NumTokensFromString(model, text string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodingForModel ¶ added in v0.1.3
func IsEncodingForModel ¶ added in v0.5.0
func NumTokensFromContent ¶ added in v0.4.0
func NumTokensFromMessages ¶
func NumTokensFromMessages(model string, messages []model.ChatCompletionMessage) (numTokens int, err error)
func NumTokensFromString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.