send msgs in webhook tool calls

This commit is contained in:
ramnique 2025-02-05 16:22:06 +05:30
parent 39282907d4
commit 80a98f1d7b
4 changed files with 10 additions and 2 deletions

View file

@ -118,7 +118,11 @@ export async function POST(
const toolCallResults = await Promise.all(lastMessage.tool_calls.map(async toolCall => {
console.log('executing tool call', toolCall);
try {
return await callClientToolWebhook(toolCall, session.projectId);
return await callClientToolWebhook(
toolCall,
[...messages, ...unsavedMessages],
session.projectId,
);
} catch (error) {
console.error(`Error executing tool call ${toolCall.id}:`, error);
return { error: "Tool execution failed" };