diff --git a/interpreter/interpreter.py b/interpreter/interpreter.py index 7c96a8589a..a794e5bfce 100644 --- a/interpreter/interpreter.py +++ b/interpreter/interpreter.py @@ -6,6 +6,7 @@ from .llama_2 import get_llama_2_instance import os +import platform #new, see OS request line 99 import openai import getpass import requests @@ -96,7 +97,9 @@ def get_info_for_system_message(self): # Add user info username = getpass.getuser() current_working_directory = os.getcwd() - operating_system = os.name if os.name != 'nt' else os.uname().sysname + + #Retrieve OS in a way that fine on both Win and Linux etc OS + operating_system = os.name if os.name != 'nt' else platform.system() info += f"\n\n[User Info]\nName: {username}\nCWD: {current_working_directory}\nOS: {operating_system}" if not self.local: @@ -405,4 +408,4 @@ def respond(self): if chunk["choices"][0]["finish_reason"] != "function_call": # Done! self.active_block.end() - return \ No newline at end of file + return