tiktoken

package
v0.0.0-...-260cf69 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenCounter

type TokenCounter struct {
	// Encoding is the encoding to use for tokenization. Defaults to cl100k_base
	Encoding string
}

TokenCounter is an interface for counting tokens in data using tiktoken for tokenization

func (TokenCounter) Count

func (tc TokenCounter) Count(data string) (int, error)

Count returns the number of tokens in the data

Jump to

Keyboard shortcuts

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