Skip to content

Commit

Permalink
It's working!
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas committed Dec 15, 2023
1 parent 8f2ebde commit cd75f5c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions interpreter/core/computer/mouse/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def move(self, *args, x=None, y=None, index=None, svg=None):
# This could be refactored to be more readable
if len(centers) > 1:
if index == None:
print(
f"(Message for language model) This text ('{text}') was found multiple times on screen. Please try 'click()' again, but pass in an `index` int to identify which one you want to click. The indices have been drawn on the image."
)
# Show the image using matplotlib
plt.imshow(np.array(bounding_box_image))
plt.show()
return
# Error so subsequent code is not executed
raise IndexError(
f"This text ('{text}') was found multiple times on screen. Please try 'click()' again, but pass in an `index` int to identify which one you want to click. The indices have been drawn on the image."
)
else:
center = centers[index]
else:
Expand Down
10 changes: 6 additions & 4 deletions interpreter/terminal_interface/terminal_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,12 @@ def terminal_interface(interpreter, message):

# Display action notifications if we're in OS mode
if interpreter.os and active_block.active_line != None:
action = active_block.code.split("\n")[
active_block.active_line - 1
].strip()
print(action)
action = ""

code_lines = active_block.code.split("\n")
if active_block.active_line < len(code_lines):
action = code_lines[active_block.active_line].strip()

if action.startswith("computer"):
description = None

Expand Down

0 comments on commit cd75f5c

Please sign in to comment.