Normalize model call output

This commit is contained in:
2026-05-18 18:59:09 +03:00
parent e520c412af
commit 9d6cdb008b
4 changed files with 54 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import test from "node:test";
import assert from "node:assert/strict";
const {summarizeModelOutput} = await import("../dist/ai/response-model-output.js");
test("model output summary trims text and copies attachment records", () => {
const toolExecutions = [{toolName: "read_file", callId: "1", argumentsText: "{}", resultChars: 10}];
const outputAttachments = [{artifactKind: "generated_file", fileName: "out.txt", sizeBytes: 12}];
const summary = summarizeModelOutput({
text: " hello world ",
toolExecutions,
outputAttachments,
});
assert.deepEqual(summary, {
text: "hello world",
toolExecutions,
outputAttachments,
});
});