From 5e60d659179d9338259ca3774173d5c649db98f9 Mon Sep 17 00:00:00 2001 From: Michael Schock Date: Thu, 25 Apr 2024 13:16:39 -0700 Subject: [PATCH] experimental[patch]: return from HuggingGPT task executor task.run() exception (#20219) **Description:** Fixes a bug in the HuggingGPT task execution logic here: except Exception as e: self.status = "failed" self.message = str(e) self.status = "completed" self.save_product() where a caught exception effectively just sets `self.message` and can then throw an exception if, e.g., `self.product` is not defined. **Issue:** None that I'm aware of. **Dependencies:** None **Twitter handle:** https://twitter.com/michaeljschock Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> --- .../autonomous_agents/hugginggpt/task_executor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py b/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py index 62a4c95da95..c149a11cbd7 100644 --- a/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py +++ b/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py @@ -69,6 +69,8 @@ class Task: except Exception as e: self.status = "failed" self.message = str(e) + return self.message + self.status = "completed" self.save_product()