Documentation ¶
Overview ¶
Package tokenizer provides utilities for tokenizing text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claude ¶ added in v0.0.47
type Claude struct {
// contains filtered or unexported fields
}
func (*Claude) GetNumTokens ¶ added in v0.0.47
GetNumTokens returns the number of tokens in the provided text.
func (*Claude) GetNumTokensFromMessage ¶ added in v0.0.47
func (t *Claude) GetNumTokensFromMessage(messages schema.ChatMessages) (uint, error)
GetNumTokensFromMessage returns the number of tokens in the provided chat messages.
type Cohere ¶ added in v0.0.30
type Cohere struct {
// contains filtered or unexported fields
}
func (*Cohere) GetNumTokens ¶ added in v0.0.30
GetNumTokens returns the number of tokens in the provided text.
func (*Cohere) GetNumTokensFromMessage ¶ added in v0.0.30
func (t *Cohere) GetNumTokensFromMessage(messages schema.ChatMessages) (uint, error)
GetNumTokensFromMessage returns the number of tokens in the provided chat messages.
type GPT2 ¶ added in v0.0.24
type GPT2 struct {
// contains filtered or unexported fields
}
func (*GPT2) GetNumTokens ¶ added in v0.0.24
GetNumTokens returns the number of tokens in the provided text.
func (*GPT2) GetNumTokensFromMessage ¶ added in v0.0.24
func (t *GPT2) GetNumTokensFromMessage(messages schema.ChatMessages) (uint, error)
GetNumTokensFromMessage returns the number of tokens in the provided chat messages.
type OpenAI ¶
type OpenAI struct {
// contains filtered or unexported fields
}
func (*OpenAI) GetNumTokens ¶
GetNumTokens returns the number of tokens in the provided text.
func (*OpenAI) GetNumTokensFromMessage ¶
func (t *OpenAI) GetNumTokensFromMessage(messages schema.ChatMessages) (uint, error)
GetNumTokensFromMessage returns the number of tokens in the provided chat messages.