Skip to content

Function: profileResponse()

ts
function profileResponse(
   toolName, 
   actionKey, 
   blocks, 
   overheadBlocks?, 
   config?): TokenAnalysis;

Defined in: packages/core/src/introspection/TokenEconomics.ts:210

Profile a complete tool response for token economics.

Analyzes all content blocks in a tool response to compute total token usage, overhead ratio, and risk classification.

Parameters

ParameterTypeDefault valueDescription
toolNamestringundefinedName of the tool that produced the response
actionKeystring | nullundefinedAction key (if applicable)
blocksreadonly { text?: string; type: string; }[]undefinedContent blocks from the tool response
overheadBlocksnumber0Number of blocks that are overhead (rules, UI)
configTokenEconomicsConfig{}Token economics configuration

Returns

TokenAnalysis

Complete token analysis