repiar tool try catch errors.

This commit is contained in:
dal 2025-08-06 16:52:21 -06:00
parent d211a2cd25
commit 2b5efe790e
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 13 additions and 7 deletions

View File

@ -12,13 +12,19 @@ export const repairToolCall = async ({
tools: ToolSet;
error: NoSuchToolError | InvalidToolInputError;
}) => {
if (error instanceof NoSuchToolError) {
return null; // TODO: Implement repair tool response for unknown tools
}
try {
if (error instanceof NoSuchToolError) {
return null; // TODO: Implement repair tool response for unknown tools
}
if (error instanceof InvalidToolInputError) {
return healToolWithLlm({ toolCall, tools });
}
if (error instanceof InvalidToolInputError) {
return healToolWithLlm({ toolCall, tools });
}
return null; // TODO: Generic error handling try again?
return null; // TODO: Generic error handling try again?
} catch (healError) {
console.error('Failed to repair tool call:', healError);
// Return null to indicate repair failed
return null;
}
};