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

Function logTokenizationDetails

apps/sim/lib/tokenization/utils.ts:149–174  ·  view source on GitHub ↗
(
  operation: string,
  details: {
    blockId?: string
    blockType?: string
    model?: string
    provider?: string
    inputLength?: number
    outputLength?: number
    tokens?: TokenUsage
    cost?: { input?: number; output?: number; total?: number }
    method?: string
  }
)

Source from the content-addressed store, hash-verified

147 * Logs tokenization operation details
148 */
149export function logTokenizationDetails(
150 operation: string,
151 details: {
152 blockId?: string
153 blockType?: string
154 model?: string
155 provider?: string
156 inputLength?: number
157 outputLength?: number
158 tokens?: TokenUsage
159 cost?: { input?: number; output?: number; total?: number }
160 method?: string
161 }
162): void {
163 logger.info(`${operation}`, {
164 blockId: details.blockId,
165 blockType: details.blockType,
166 model: details.model,
167 provider: details.provider,
168 inputLength: details.inputLength,
169 outputLength: details.outputLength,
170 tokens: details.tokens,
171 cost: details.cost,
172 method: details.method,
173 })
174}

Callers 2

processStreamingBlockLogFunction · 0.90
calculateStreamingCostFunction · 0.90

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected