Skip to content

Commit cd00f1b

Browse files
committed
Update Pydantic, avoid recurring computer API
1 parent 68245cb commit cd00f1b

File tree

5 files changed

+1328
-1306
lines changed

5 files changed

+1328
-1306
lines changed

interpreter/core/computer/computer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
from .contacts.contacts import Contacts
88
from .display.display import Display
99
from .docs.docs import Docs
10+
from .files.files import Files
1011
from .keyboard.keyboard import Keyboard
1112
from .mail.mail import Mail
1213
from .mouse.mouse import Mouse
1314
from .os.os import Os
1415
from .skills.skills import Skills
1516
from .sms.sms import SMS
1617
from .terminal.terminal import Terminal
17-
from .files.files import Files
18+
1819

1920
class Computer:
2021
def __init__(self, interpreter):
@@ -45,7 +46,7 @@ def __init__(self, interpreter):
4546
self.api_base = "https://api.openinterpreter.com/v0"
4647
self.save_skills = True
4748

48-
self.import_computer_api = True
49+
self.import_computer_api = False # Defaults to false
4950
self._has_imported_computer_api = False # Because we only want to do this once
5051

5152
# Shortcut for computer.terminal.languages

interpreter/core/computer/skills/skills.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def import_skills(self):
4949

5050
output = self.computer.run("python", code_to_run)
5151

52-
if "traceback" in output.lower():
52+
if type(output) == str and "traceback" in output.lower():
5353
# Import them individually
5454
for file in glob.glob(os.path.join(self.path, "*.py")):
5555
with open(file, "r") as f:
@@ -60,7 +60,7 @@ def import_skills(self):
6060

6161
output = self.computer.run("python", code_to_run)
6262

63-
if "traceback" in output.lower():
63+
if type(output) == str and "traceback" in output.lower():
6464
print(
6565
f"Skill at {file} might be broken— it produces a traceback when run."
6666
)

interpreter/core/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(
6969
custom_instructions="",
7070
computer=None,
7171
sync_computer=True,
72-
import_computer_api=True,
72+
import_computer_api=False,
7373
skills_path=None,
7474
import_skills=True,
7575
multi_line=False,

0 commit comments

Comments
 (0)