From 953e25bd8f70c83b7fcd3f288357add355651c37 Mon Sep 17 00:00:00 2001 From: Ashpreet Bedi Date: Tue, 9 Jan 2024 14:36:07 +0000 Subject: [PATCH] assistant delegation working --- phi/assistant/assistant.py | 2 +- phi/tools/function.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phi/assistant/assistant.py b/phi/assistant/assistant.py index d5bcb9175..3e36335f2 100644 --- a/phi/assistant/assistant.py +++ b/phi/assistant/assistant.py @@ -34,7 +34,7 @@ def get_delegation_function(self, task: Task) -> Function: """ def delegation_function(task_description: str): - return self.run(task_description, stream=False) + return self.run(message=task_description, stream=False) _f = Function.from_callable(delegation_function) _f.name = f_name diff --git a/phi/tools/function.py b/phi/tools/function.py index 64103a308..7db9efdec 100644 --- a/phi/tools/function.py +++ b/phi/tools/function.py @@ -89,7 +89,7 @@ def execute(self) -> bool: except Exception as e: logger.warning(f"Could not run function {self.get_call_str()}") logger.error(e) - self.result = e + self.result = str(e) return False try: @@ -98,5 +98,5 @@ def execute(self) -> bool: except Exception as e: logger.warning(f"Could not run function {self.get_call_str()}") logger.error(e) - self.result = e + self.result = str(e) return False