feat: debug logging for tool calls

This commit is contained in:
Zoe
2026-09-19 15:19:50 -05:00
parent 1a4e4d0a97
commit c49f228847
+5 -2
View File
@@ -77,8 +77,11 @@ async function main(): Promise<void> {
console.log(`Model turn ${turn + 1}`); console.log(`Model turn ${turn + 1}`);
const response = await complete(config, await context(), toolDefinitions, controller.signal); const response = await complete(config, await context(), toolDefinitions, controller.signal);
append(response); append(response);
if (response.reasoning_content) {
console.log(`Thinking:\n${response.reasoning_content}`);
}
if (response.content) { if (response.content) {
console.log(response.content); console.log(`Response:\n${response.content}`);
} }
const calls = response.tool_calls ?? []; const calls = response.tool_calls ?? [];
if (mode === "probe") { if (mode === "probe") {
@@ -100,7 +103,7 @@ async function main(): Promise<void> {
} }
database.prepare("INSERT INTO operations (run_id, call_id, name, arguments, status) VALUES (?, ?, ?, ?, 'started')") database.prepare("INSERT INTO operations (run_id, call_id, name, arguments, status) VALUES (?, ?, ?, ?, 'started')")
.run(id, call.id, call.function.name, call.function.arguments); .run(id, call.id, call.function.name, call.function.arguments);
console.log(`Tool: ${call.function.name}`); console.log(`Tool: ${call.function.name}\nArguments: ${call.function.arguments}`);
let result: unknown; let result: unknown;
let state = "succeeded"; let state = "succeeded";
try { try {