token

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateTokenCount

func EstimateTokenCount(text string) int

EstimateTokenCount はテキストのトークン数を推定 英語: 約4文字 = 1トークン 日本語: 約1-2文字 = 1トークン 混在を考慮して約2.5文字 = 1トークン

func GetModelTokenLimit

func GetModelTokenLimit(model string) int

GetModelTokenLimit はモデルのトークン上限を取得

func IsTokenLimitError

func IsTokenLimitError(err error) bool

IsTokenLimitError はエラーがトークン上限エラーかどうかを判定

func TruncateToLastLines

func TruncateToLastLines(text string, lastN int) (string, bool)

TruncateToLastLines はテキストを最後のN行に切り詰める 切り詰めた場合は (切り詰め後テキスト, true) を返す

Types

This section is empty.

Jump to

Keyboard shortcuts

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