* Record a model response (text or tool decision).
(content, toolCalls)
| 60 | * Record a model response (text or tool decision). |
| 61 | */ |
| 62 | recordModelResponse(content, toolCalls) { |
| 63 | if (!this.recording || !this.current) return; |
| 64 | this.current.steps.push({ |
| 65 | type: 'model_response', |
| 66 | content: content ? redactString(content).slice(0, 1000) : null, |
| 67 | toolCalls: toolCalls ? toolCalls.map(tc => ({ |
| 68 | name: tc.function.name, |
| 69 | args: typeof tc.function.arguments === 'string' |
| 70 | ? redactString(tc.function.arguments) |
| 71 | : JSON.stringify(redactValue(tc.function.arguments || {})), |
| 72 | })) : null, |
| 73 | timestamp: Date.now(), |
| 74 | }); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Record token usage for this trace. |
nothing calls this directly
no test coverage detected