MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / estimateTokensJson

Function estimateTokensJson

src/diagnostics/token-analyzer.ts:81–84  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

79
80/** Estimate tokens for any JSON-serializable value (used for tool_calls). */
81export function estimateTokensJson(value: unknown): number {
82 if (value === undefined || value === null) return 0;
83 return countTokensJson(value);
84}
85
86/**
87 * Group messages into turns. A "turn" starts at each user message and includes the

Callers 3

index.tsFile · 0.85
analyzeMessagesFunction · 0.85

Calls 1

countTokensJsonFunction · 0.85

Tested by

no test coverage detected