(value: unknown)
| 95 | } |
| 96 | |
| 97 | function extractOutputTokens(value: unknown): DevToolsUsage["outputTokens"] | undefined { |
| 98 | if (typeof value === "number") { |
| 99 | return value; |
| 100 | } |
| 101 | |
| 102 | if (!isRecord(value)) { |
| 103 | return undefined; |
| 104 | } |
| 105 | |
| 106 | const total = extractTokenTotal(value); |
| 107 | if (total === undefined) { |
| 108 | return undefined; |
| 109 | } |
| 110 | |
| 111 | return { |
| 112 | total, |
| 113 | text: extractOptionalTokenCount(value, "text"), |
| 114 | reasoning: extractOptionalTokenCount(value, "reasoning"), |
| 115 | }; |
| 116 | } |
| 117 | |
| 118 | function createEmptyStep( |
| 119 | stepId: string, |
no test coverage detected