From 42f8b86b11847e58ea9235f9f3d3221ef2b9f037 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:39:55 +0300 Subject: [PATCH] Tool Calling: stringify errors instead of silently failing --- public/scripts/tool-calling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/tool-calling.js b/public/scripts/tool-calling.js index c845a2591..11dc65c5d 100644 --- a/public/scripts/tool-calling.js +++ b/public/scripts/tool-calling.js @@ -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(); } }