MCPcopy
hub / github.com/promptfoo/promptfoo / createEmptyTokenUsage

Function createEmptyTokenUsage

src/util/tokenUsageUtils.ts:33–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 * Create an empty token usage object with all fields initialized to zero.
32 */
33export function createEmptyTokenUsage(): Required<TokenUsage> {
34 return {
35 prompt: 0,
36 completion: 0,
37 cached: 0,
38 total: 0,
39 numRequests: 0,
40 completionDetails: createEmptyCompletionDetails(),
41 assertions: createEmptyAssertions(),
42 };
43}
44
45/**
46 * Helper to accumulate numeric values

Calls 2

createEmptyAssertionsFunction · 0.85

Tested by 2

createJudgeFunction · 0.72
makeAsyncJudgeFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…