From 9b7d441f9f7020af3fe41cb8b9e6e3fe2042ed5a Mon Sep 17 00:00:00 2001 From: Josh XT <102809327+Josh-XT@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:23:17 -0500 Subject: [PATCH] Improve command execution and follow ups (#1281) * add disable commands override for interactions * improve command execution and follow ups --- agixt/Interactions.py | 1 + agixt/extensions/agixt_actions.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/agixt/Interactions.py b/agixt/Interactions.py index a528a0e36150..1e6d5afb648c 100644 --- a/agixt/Interactions.py +++ b/agixt/Interactions.py @@ -468,6 +468,7 @@ async def format_prompt( - The assistant should never generate a tag in the response. The assistant will receive the command output and will be able to reference the output in the response. - If there is an tag in the assistants previous responses in context, it refers to the command execution output. Use this output to determine if the command was successful, and to course correct if needed. - Any time the assistant executes a command, the text generation should end with . The assistant will be informed of the command output before the user receives the response to give the assistant the opportunity to evaluate the output and ensure it is correct, exploring different options if needed. +- Command executions should all take place BEFORE the block! - **THE ASSISTANT CANNOT EXECUTE A COMMAND THAT IS NOT ON THE LIST OF EXAMPLES!**""" formatted_prompt = self.custom_format( string=prompt, diff --git a/agixt/extensions/agixt_actions.py b/agixt/extensions/agixt_actions.py index dedb04baf177..773805e8b126 100644 --- a/agixt/extensions/agixt_actions.py +++ b/agixt/extensions/agixt_actions.py @@ -213,9 +213,9 @@ async def schedule_follow_up( self, title: str, follow_up_notes: str, - days: int = 0, - hours: int = 0, - minutes: int = 0, + days: str = 0, + hours: str = 0, + minutes: str = 0, ) -> str: """ Schedule a follow-up interaction with the user. @@ -232,6 +232,18 @@ async def schedule_follow_up( Returns: str: Response confirming the scheduled follow-up. The assistant can choose to tell the user about the scheduled follow-up or choose to surprise them later. """ + try: + days = int(days) + except: + days = 0 + try: + hours = int(hours) + except: + hours = 0 + try: + minutes = int(minutes) + except: + minutes = 0 # Calculate the due date due_date = datetime.datetime.now() + datetime.timedelta( days=days, hours=hours, minutes=minutes