From 49c8d190487bd3bb6466122f6bf4353becc3ff99 Mon Sep 17 00:00:00 2001 From: umayado17 Date: Thu, 24 Oct 2024 21:00:45 +0900 Subject: [PATCH 1/2] Fix: Change date format string for Windows compatibility - Changed %-d to %d in date format string to support Windows - Fixes ValueError when running with --os flag on Windows --- interpreter/computer_use/loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/computer_use/loop.py b/interpreter/computer_use/loop.py index 84a7a6cd7..00bc11832 100755 --- a/interpreter/computer_use/loop.py +++ b/interpreter/computer_use/loop.py @@ -101,7 +101,7 @@ class APIProvider(StrEnum): * You have access to a code editor tool for viewing and modifying source code files. * You can install and use command-line applications and development tools as needed. * When dealing with large outputs, use redirection to temporary files and tools like `grep` or the str_replace_editor to analyze the content efficiently. -* The current date is {datetime.today().strftime('%A, %B %-d, %Y')}. +* The current date is {datetime.today().strftime('%A, %B %d, %Y')}. """ SYSTEM_PROMPT = f""" From e99f7927e20f155f5350269f9af3545f1eb01db6 Mon Sep 17 00:00:00 2001 From: umayado17 <40725757+umayado17@users.noreply.github.com> Date: Sat, 26 Oct 2024 09:29:44 +0900 Subject: [PATCH 2/2] Update loop.py According to the advice by CyanideByte, I modified as follows: {datetime.today().strftime('%A, %B %#d, %Y' if platform.system() == 'Windows' else '%A, %B %-d, %Y')} --- interpreter/computer_use/loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/computer_use/loop.py b/interpreter/computer_use/loop.py index 00bc11832..9ccb9632d 100755 --- a/interpreter/computer_use/loop.py +++ b/interpreter/computer_use/loop.py @@ -101,7 +101,7 @@ class APIProvider(StrEnum): * You have access to a code editor tool for viewing and modifying source code files. * You can install and use command-line applications and development tools as needed. * When dealing with large outputs, use redirection to temporary files and tools like `grep` or the str_replace_editor to analyze the content efficiently. -* The current date is {datetime.today().strftime('%A, %B %d, %Y')}. +* The current date is {datetime.today().strftime('%A, %B %#d, %Y' if platform.system() == 'Windows' else '%A, %B %-d, %Y')}. """ SYSTEM_PROMPT = f"""