feat: debug logging for tool calls
This commit is contained in:
+5
-2
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user