MCPcopy
hub / github.com/Doorman11991/smallcode / recordModelResponse

Method recordModelResponse

bin/trace_recorder.js:62–75  ·  view source on GitHub ↗

* Record a model response (text or tool decision).

(content, toolCalls)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

redactStringFunction · 0.85
redactValueFunction · 0.50

Tested by

no test coverage detected