MCPcopy Create free account
hub / github.com/microsoft/Webwright / quickTokenEstimate

Function quickTokenEstimate

assets/compare_trajectory/app.js:277–283  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

275}
276
277function quickTokenEstimate(text) {
278 const source = String(text || '');
279 if (!source.trim()) {
280 return 0;
281 }
282 return Math.max(1, Math.ceil(source.length / 4));
283}
284
285function mergeEstimateParts(parts) {
286 const grouped = new Map();

Callers 1

enrichTraceTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected