()
| 31 | * Create an empty token usage object with all fields initialized to zero. |
| 32 | */ |
| 33 | export 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 |
searching dependent graphs…