Skip to content

Commit

Permalink
Improve command execution and follow ups (#1281)
Browse files Browse the repository at this point in the history
* add disable commands override for interactions

* improve command execution and follow ups
  • Loading branch information
Josh-XT authored Nov 25, 2024
1 parent 1f77f84 commit 9b7d441
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions agixt/Interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ async def format_prompt(
- The assistant should never generate a <output> 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 <output> 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 </execute>. 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 <answer> block!
- **THE ASSISTANT CANNOT EXECUTE A COMMAND THAT IS NOT ON THE LIST OF EXAMPLES!**"""
formatted_prompt = self.custom_format(
string=prompt,
Expand Down
18 changes: 15 additions & 3 deletions agixt/extensions/agixt_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 9b7d441

Please sign in to comment.