Skip to content

Commit

Permalink
Merge pull request OpenInterpreter#2 from nirvor/main
Browse files Browse the repository at this point in the history
Update interpreter.py for multi OS request

Former-commit-id: 24fb69a
Former-commit-id: 359b87aae3e14c040113e009f0948c37a36b49ad
Former-commit-id: 33b66b11d74a5a0c19149775e7ede022bdedb625 [formerly f86ae2b4ac8d0a38b2d5a6f7b2864c035603b387]
Former-commit-id: 7c33839f8361b39298c42244d418561e5a718bea
  • Loading branch information
KillianLucas authored Aug 8, 2023
2 parents 0601253 + 4deb5b9 commit 9cd4050
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -405,4 +408,4 @@ def respond(self):
if chunk["choices"][0]["finish_reason"] != "function_call":
# Done!
self.active_block.end()
return
return

0 comments on commit 9cd4050

Please sign in to comment.