Tool Calling: stringify errors instead of silently failing

This commit is contained in:
Cohee 2024-10-09 22:39:55 +03:00
parent ac7135c386
commit 42f8b86b11

View File

@ -292,10 +292,10 @@ export class ToolManager {
if (error instanceof Error) {
error.cause = name;
return error;
return error.toString();
}
return new Error('Unknown error occurred while invoking the tool.', { cause: name });
return new Error('Unknown error occurred while invoking the tool.', { cause: name }).toString();
}
}