MCPcopy Index your code
hub / github.com/simstudioai/sim / estimateGenericTokens

Function estimateGenericTokens

apps/sim/lib/tokenization/estimators.ts:303–306  ·  view source on GitHub ↗

* Generic token estimation fallback

(text: string, avgCharsPerToken: number)

Source from the content-addressed store, hash-verified

301 * Generic token estimation fallback
302 */
303function estimateGenericTokens(text: string, avgCharsPerToken: number): number {
304 const charCount = text.trim().length
305 return Math.ceil(charCount / avgCharsPerToken)
306}
307
308/**
309 * Estimates tokens for input content including context

Callers 1

estimateTokenCountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected