nsarrazin HF Staff commited on
Commit
c31c50e
·
unverified ·
1 Parent(s): 332ed42

feat(tools): more detailed errors from tools

Browse files
src/lib/server/textGeneration/tools.ts CHANGED
@@ -95,13 +95,14 @@ async function* callTool(
95
  type: MessageUpdateType.Tool,
96
  subtype: MessageToolUpdateType.Error,
97
  uuid,
98
- message: "Error occurred",
99
  };
100
 
101
  return {
102
  call,
103
  status: ToolResultStatus.Error,
104
- message: "Error occurred",
 
105
  };
106
  }
107
  }
 
95
  type: MessageUpdateType.Tool,
96
  subtype: MessageToolUpdateType.Error,
97
  uuid,
98
+ message: "An error occurred while calling the tool " + call.name,
99
  };
100
 
101
  return {
102
  call,
103
  status: ToolResultStatus.Error,
104
+ message:
105
+ "An error occurred while calling the tool " + call.name + ": " + stringifyError(error),
106
  };
107
  }
108
  }