Skip to content

Commit f7f0ba3

Browse files
committed
wtf 🇺🇸
1 parent b9a50f5 commit f7f0ba3

File tree

4 files changed

+256
-41
lines changed

4 files changed

+256
-41
lines changed

‎interpreter/core/computer/keyboard/keyboard.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import os
22
import platform
33
import time
4+
45
from ...utils.lazy_import import lazy_import
56

67
# Lazy import of pyautogui
7-
pyautogui = lazy_import('pyautogui')
8+
pyautogui = lazy_import("pyautogui")
9+
810

911
class Keyboard:
1012
"""A class to simulate keyboard inputs"""
1113

1214
def __init__(self, computer):
1315
self.computer = computer
1416

15-
def write(self, text, interval=None, **kwargs):
17+
def write(self, text, interval=None, delay=0.30, **kwargs):
1618
"""
17-
Type out a string of characters.
19+
Type out a string of characters with some realistic delay.
1820
"""
19-
time.sleep(0.15)
21+
time.sleep(delay / 2)
2022

2123
if interval:
2224
pyautogui.write(text, interval=interval)
@@ -52,7 +54,7 @@ def write(self, text, interval=None, **kwargs):
5254
except:
5355
pass
5456

55-
time.sleep(0.15)
57+
time.sleep(delay / 2)
5658

5759
def press(self, *args, presses=1, interval=0.1):
5860
keys = args

‎poetry.lock

Lines changed: 38 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,14 @@
22
name = "open-interpreter"
33
packages = [
44
{include = "interpreter"},
5+
{include = "scripts"},
56
]
67
version = "0.3.4" # Use "-rc1", "-rc2", etc. for pre-release versions
78
description = "Let language models run code"
89
authors = ["Killian Lucas <[email protected]>"]
910
readme = "README.md"
1011

1112
[tool.poetry.dependencies]
12-
python = ">=3.9,<4"
13-
setuptools = "*"
14-
astor = "^0.8.1"
15-
git-python = "^1.0.3"
16-
inquirer = "^3.1.3"
17-
litellm = "^1.35.32"
18-
pyyaml = "^6.0.1"
19-
rich = "^13.4.2"
20-
six = "^1.16.0"
21-
tokentrim = "^0.1.13"
22-
wget = "^3.2"
23-
psutil = "^5.9.6"
24-
pyreadline3 = {version = "^3.4.1", markers = "sys_platform == 'win32'"}
25-
html2image = "^2.0.4.3"
26-
send2trash = "^1.8.2"
27-
ipykernel = "^6.26.0"
28-
jupyter-client = "^8.6.0"
29-
matplotlib = "^3.8.2"
30-
toml = "^0.10.2"
31-
tiktoken = "^0.6.0"
32-
platformdirs = "^4.2.0"
33-
pydantic = "^2.6.4"
34-
google-generativeai = "^0.7.1"
3513

3614
# Optional [os] dependencies
3715
opencv-python = { version = "^4.8.1.78", optional = true }
@@ -48,7 +26,6 @@ screeninfo = { version = "^0.8.1", optional = true }
4826

4927
# Optional [safe] dependencies
5028
semgrep = { version = "^1.52.0", optional = true }
51-
yaspin = { version = "^3.0.1", optional = true }
5229

5330
# Optional [local] dependencies
5431
transformers = { version = "^4.40.1", optional = true }
@@ -61,9 +38,37 @@ fastapi = { version = "^0.111.0", optional = true }
6138
uvicorn = { version = "^0.30.1", optional = true }
6239
janus = { version = "^1.0.0", optional = true }
6340

41+
# Required dependencies
42+
python = ">=3.9,<4"
43+
setuptools = "*"
44+
astor = "^0.8.1"
45+
git-python = "^1.0.3"
46+
inquirer = "^3.1.3"
47+
litellm = "^1.35.32"
48+
pyyaml = "^6.0.1"
49+
rich = "^13.4.2"
50+
six = "^1.16.0"
51+
tokentrim = "^0.1.13"
52+
wget = "^3.2"
53+
psutil = "^5.9.6"
54+
pyreadline3 = {version = "^3.4.1", markers = "sys_platform == 'win32'"}
55+
html2image = "^2.0.4.3"
56+
send2trash = "^1.8.2"
57+
ipykernel = "^6.26.0"
58+
jupyter-client = "^8.6.0"
59+
matplotlib = "^3.8.2"
60+
toml = "^0.10.2"
61+
tiktoken = "^0.6.0"
62+
platformdirs = "^4.2.0"
63+
pydantic = "^2.6.4"
64+
google-generativeai = "^0.7.1"
65+
pynput = "^1.7.7"
66+
pyperclip = "^1.9.0"
67+
yaspin = "^3.0.2"
68+
6469
[tool.poetry.extras]
6570
os = ["opencv-python", "pyautogui", "plyer", "pywinctl", "pytesseract", "sentence-transformers", "ipywidgets", "torch", "timm", "screeninfo"]
66-
safe = ["semgrep", "yaspin"]
71+
safe = ["semgrep"]
6772
local = ["opencv-python", "pytesseract", "torch", "transformers", "einops", "torchvision", "easyocr"]
6873
server = ["fastapi", "janus", "uvicorn"]
6974

@@ -82,6 +87,7 @@ build-backend = "poetry.core.masonry.api"
8287
interpreter = "interpreter.terminal_interface.start_terminal_interface:main"
8388
i = "interpreter.terminal_interface.start_terminal_interface:main"
8489
ibench = "benchmarks.simple:main"
90+
wtf = "scripts.wtf:main"
8591

8692
[tool.black]
8793
target-version = ['py311']

0 commit comments

Comments
 (0)