MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatTokenUsage

Function formatTokenUsage

packages/acp-adapter/src/session.ts:1476–1483  ·  view source on GitHub ↗
(usage: NonNullable<SessionUsage['total']>)

Source from the content-addressed store, hash-verified

1474}
1475
1476function formatTokenUsage(usage: NonNullable<SessionUsage['total']>): string {
1477 return [
1478 `input ${usage.inputOther.toLocaleString('en-US')}`,
1479 `output ${usage.output.toLocaleString('en-US')}`,
1480 `cache read ${usage.inputCacheRead.toLocaleString('en-US')}`,
1481 `cache creation ${usage.inputCacheCreation.toLocaleString('en-US')}`,
1482 ].join(', ');
1483}
1484
1485// agent-core emits `contextUsage` as a 0..1 fraction (`contextTokens /
1486// maxContextTokens` — see agent-core/src/agent/index.ts:419-422). It can

Callers 1

formatUsageReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected