Appends a tool call and its result as one exchange.
Program to edit.
Call and result to record.
A new program; the input is left untouched.
const next = appendToolInteraction(program, { callId: call.id, name: call.name, args: JSON.parse(call.args), result: await tool.execute(args, ctx),}); Copy
const next = appendToolInteraction(program, { callId: call.id, name: call.name, args: JSON.parse(call.args), result: await tool.execute(args, ctx),});
Appends a tool call and its result as one exchange.