tiktoken

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodingForModel added in v0.1.3

func EncodingForModel(model string) (*tiktoken.Tiktoken, error)

func IsEncodingForModel added in v0.5.0

func IsEncodingForModel(model string) bool

func NumTokensFromContent added in v0.4.0

func NumTokensFromContent(tkm *tiktoken.Tiktoken, model string, content any) (numTokens int)

func NumTokensFromMessages

func NumTokensFromMessages(model string, messages []model.ChatCompletionMessage) (numTokens int, err error)

func NumTokensFromString

func NumTokensFromString(model, text string) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL