MCPcopy Create free account
hub / github.com/astercloud/aster / SimpleTokenCounter

Struct SimpleTokenCounter

pkg/context/token_counter.go:211–213  ·  view source on GitHub ↗

SimpleTokenCounter 简单的基于字符的 Token 计数器 使用启发式规则估算 Token 数量,无需调用外部 API

Source from the content-addressed store, hash-verified

209// SimpleTokenCounter 简单的基于字符的 Token 计数器
210// 使用启发式规则估算 Token 数量,无需调用外部 API
211type SimpleTokenCounter struct {
212 config ModelConfig
213}
214
215// NewSimpleTokenCounter 创建一个简单的 Token 计数器
216func NewSimpleTokenCounter(config ModelConfig) *SimpleTokenCounter {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected