computer-use-ootb-internal 0.0.109.post1__py3-none-any.whl → 0.0.109.post2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,11 +92,12 @@ class TeachmodeExecutor:
92
92
 
93
93
  if isinstance(tool_result, ToolResult):
94
94
  print(f"[teachmode_executor] tool_result: {tool_result}")
95
- tool_result_message = {"role": "assistant", "content": tool_result['output'], "type": "action", "action_type": tool_result['base_type']}
95
+ tool_result_message = {"role": "assistant", "content": tool_result.output, "type": "action", "action_type": tool_result.base_type}
96
96
  yield tool_result_message
97
97
 
98
98
  elif isinstance(tool_result, ToolError):
99
- tool_result_message = {"role": "assistant", "content": tool_result['output'], "type": "error"}
99
+ print(f"[teachmode_executor] tool_error: {tool_result}")
100
+ tool_result_message = {"role": "assistant", "content": tool_result.output, "type": "error"}
100
101
  yield tool_result_message
101
102
 
102
103
  return tool_result_message
@@ -134,7 +135,7 @@ class TeachmodeExecutor:
134
135
  x, y = action_item["position"]
135
136
  action_item["position"] = (int(x), int(y))
136
137
  refined_output.append({"action": "mouse_move", "text": None, "coordinate": tuple(action_item["position"])})
137
- refined_output.append({"action": "left_click", "text": None, "coordinate": None})
138
+ refined_output.append({"action": "left_click", "text": None, "coordinate": tuple(action_item["position"])})
138
139
 
139
140
  elif action_item["action"] == "INPUT": # 2. input -> type
140
141
  if "text" in action_item:
@@ -293,36 +293,37 @@ class ComputerTool(BaseAnthropicTool):
293
293
  ):
294
294
  if text is not None:
295
295
  raise ToolError(output=f"text is not accepted for {action}", base_type="error")
296
+ # if coordinate is not None:
297
+ # raise ToolError(output=f"coordinate is not accepted for {action}", base_type="error")
298
+
296
299
  if coordinate is not None:
297
- raise ToolError(output=f"coordinate is not accepted for {action}", base_type="error")
300
+ x, y = coordinate
301
+ else:
302
+ x, y = pyautogui.position()
298
303
 
299
304
  if action == "left_click":
300
- x, y = pyautogui.position()
301
305
  show_click(x, y)
302
- pyautogui.click()
306
+ pyautogui.click(x=x, y=y)
303
307
  return ToolResult(output="Left click", base_type="click")
304
308
  elif action == "right_click":
305
- x, y = pyautogui.position()
306
309
  show_click(x, y)
307
- pyautogui.rightClick()
310
+ pyautogui.rightClick(x=x, y=y)
308
311
  return ToolResult(output="Right click", base_type="click")
309
312
  elif action == "middle_click":
310
- x, y = pyautogui.position()
311
313
  show_click(x, y)
312
- pyautogui.middleClick()
314
+ pyautogui.middleClick(x=x, y=y)
313
315
  return ToolResult(output="Middle click", base_type="click")
314
316
  elif action == "double_click":
315
- x, y = pyautogui.position()
316
317
  show_click(x, y)
317
- pyautogui.doubleClick()
318
+ pyautogui.doubleClick(x=x, y=y)
318
319
  return ToolResult(output="Double click", base_type="click")
319
320
  elif action == "left_press":
320
- x, y = pyautogui.position()
321
321
  show_click(x, y)
322
- pyautogui.mouseDown()
322
+ pyautogui.mouseDown(x=x, y=y)
323
323
  time.sleep(1)
324
- pyautogui.mouseUp()
324
+ pyautogui.mouseUp(x=x, y=y)
325
325
  return ToolResult(output="Left press", base_type="click")
326
+
326
327
  elif action == "scroll_down":
327
328
  pyautogui.scroll(-200) # Adjust scroll amount as needed
328
329
  return ToolResult(output="Scrolled down", base_type="scroll")
@@ -391,7 +392,7 @@ class ComputerTool(BaseAnthropicTool):
391
392
  x1 = coordinate[0]+self.offset_x
392
393
  y1 = coordinate[1]+self.offset_y
393
394
 
394
- show_move_to(x0, y0, x1, y1, duration_ms=1000)
395
+ show_move_to(x0, y0, x1, y1)
395
396
  self.marbot_auto_gui.moveTo(x=x1, y=y1)
396
397
 
397
398
  return ToolResult(output=f"Mouse move", base_type="move")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.109.post1
3
+ Version: 0.0.109.post2
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -7,7 +7,7 @@ computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=7Dj0iY4GG7P03tRKYJ2
7
7
  computer_use_ootb_internal/computer_use_demo/animation/click_animation.py,sha256=tP1gsayFy-CKk10UlrE9RlexwlHWiHQUe5Ogg4vQvSg,3234
8
8
  computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif,sha256=4LfwsfFQnREXrNRs32aJU2jO65JXianJoL_8q7-8elg,30966
9
9
  computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=SOJz2yffXTkjuAHqk0IZLcMriR0KQYTo7W1b8wGyRGY,1222
10
- computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=1xver_8cRCrFk85OYqEQ7LUPYs5v2Mvtg944wiGN05A,16562
10
+ computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=TBp_rXSAuHFBmZYyyIFca404c4v5LG1ZVbNaQpuvtzQ,16656
11
11
  computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
12
12
  computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=CxFJbsSb68ERKH7-C4RaaZy7FIhhzrzGx5qQJ4C37cA,13907
13
13
  computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py,sha256=OOVxy4Qlbk5q-X9kXFXqt6AmuOMl6FWWqtH269DvJJA,10005
@@ -18,20 +18,18 @@ computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py,sh
18
18
  computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py,sha256=zWAHa37fhIWCYpIEvQsIe5prfBJQ9yZFQwAi_dm8baE,4158
19
19
  computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py,sha256=SBnWMhwZoCFji9-ii7VSfPYAhDKUWvlJgJzw9-Ei3-g,7750
20
20
  computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py,sha256=fxC-7lg8TLAi9f69zs5y5Pwga8Y5mY7Yfc5NNZNRJgM,1558
21
- computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/run_vlm.py,sha256=9IaX15dhFFOALr0vcsI-EtEU4pDLfdzlmwCy3HRbISA,1441
23
21
  computer_use_ootb_internal/computer_use_demo/tools/__init__.py,sha256=Pj8_5L4_PPQK298X4NV3KMbP-84t-bM0pbjEeb5_SJQ,343
24
22
  computer_use_ootb_internal/computer_use_demo/tools/aws_request.py,sha256=12UVzeA2PmpZhpy2Pt5Vh48-_q1e8ZjVQux6r3pbAcw,2629
25
23
  computer_use_ootb_internal/computer_use_demo/tools/base.py,sha256=4HHSxDg6GsCoraamWor75ZnoR7tAcRarMv4MzvqMWGU,2099
26
24
  computer_use_ootb_internal/computer_use_demo/tools/bash.py,sha256=rHetQ80_v-TTi-1oxIA7ncFEwJxFTh8FJCErIoZbGeY,4236
27
25
  computer_use_ootb_internal/computer_use_demo/tools/collection.py,sha256=8RzHLobL44_Jjt8ltXS6I8XJlEAQOfc75dmnDUaHE-8,922
28
26
  computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py,sha256=cvlmnhAImDTwoRRwhT5au7mNFhfAD7ZfeoDEVdVzDKw,892
29
- computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=Z-kt6XxGIeZJaeaj02ktAcUQL8vG7co2bedzC5pSAsc,26794
27
+ computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=lm3bzh-ZzeFGAqrgQGkDr6SnvoB9d4NvVo8D1PNOoAk,26745
30
28
  computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZuWz9ArfP3Zss-afnscrPkgCtB5UWbCy7HwAOvO2bo,5970
31
29
  computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
32
30
  computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
33
31
  computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
34
- computer_use_ootb_internal-0.0.109.post1.dist-info/METADATA,sha256=sK_kPqyLBjBFbinqhhx7t83mYHAHyeyPnQlr-h3PAQA,916
35
- computer_use_ootb_internal-0.0.109.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
- computer_use_ootb_internal-0.0.109.post1.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
37
- computer_use_ootb_internal-0.0.109.post1.dist-info/RECORD,,
32
+ computer_use_ootb_internal-0.0.109.post2.dist-info/METADATA,sha256=jTj_Um-WzpFJjLXIQ_iK6veWsvkwPcuvJ5p4GTC0vCA,916
33
+ computer_use_ootb_internal-0.0.109.post2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ computer_use_ootb_internal-0.0.109.post2.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
35
+ computer_use_ootb_internal-0.0.109.post2.dist-info/RECORD,,
@@ -1,46 +0,0 @@
1
- import base64
2
- import logging
3
-
4
-
5
- def run_vlm(messages, system, vlm="gpt-4o-mini", max_tokens=512, temperature=0, stop=None):
6
- log_prompt(messages)
7
-
8
- # turn string prompt into list
9
- if isinstance(messages, str):
10
- messages = [messages]
11
- elif isinstance(messages, list):
12
- pass
13
- else:
14
- raise ValueError(f"Invalid prompt type: {type(messages)}")
15
-
16
- if vlm.startswith("gpt"): # gpt series
17
- from .oai import run_oai_interleaved
18
- response, token_usage = run_oai_interleaved(
19
- messages=messages,
20
- system=system,
21
- llm=llm,
22
- max_tokens=max_tokens,
23
- temperature=temperature
24
- )
25
- elif vlm.startswith("gemini"): # gemini series
26
- from .gemini import run_gemini_interleaved
27
-
28
- response, token_usage = run_gemini_interleaved(
29
- messages=messages,
30
- system=system,
31
- vlm=vlm,
32
- max_tokens=max_tokens,
33
- temperature=temperature
34
- )
35
- else:
36
- raise ValueError(f"Invalid llm: {llm}")
37
- logging.info(
38
- f"========Output for {vlm}=======\n{response}\n============================")
39
- return response
40
-
41
- def log_prompt(prompt):
42
- prompt_display = [prompt] if isinstance(prompt, str) else prompt
43
- prompt_display = "\n\n".join(prompt_display)
44
- logging.info(
45
- f"========Prompt=======\n{prompt_display}\n============================")
46
-