anthropic CUA - support right_click (#2267)
This commit is contained in:
@@ -420,7 +420,7 @@ async def parse_anthropic_actions(
|
|||||||
tool_call_id=tool_call_id,
|
tool_call_id=tool_call_id,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif action in ["left_click", "double_click", "triple_click"]:
|
elif action in ["left_click", "double_click", "triple_click", "right_click"]:
|
||||||
coordinate = tool_call_input.get("coordinate")
|
coordinate = tool_call_input.get("coordinate")
|
||||||
if not coordinate and idx - 1 >= 0:
|
if not coordinate and idx - 1 >= 0:
|
||||||
prev_tool_call = tool_calls[idx - 1]
|
prev_tool_call = tool_calls[idx - 1]
|
||||||
@@ -446,12 +446,15 @@ async def parse_anthropic_actions(
|
|||||||
|
|
||||||
response = f"Click at: ({x}, {y})"
|
response = f"Click at: ({x}, {y})"
|
||||||
reasoning = reasoning or response
|
reasoning = reasoning or response
|
||||||
|
button = "left"
|
||||||
|
if action == "right_click":
|
||||||
|
button = "right"
|
||||||
actions.append(
|
actions.append(
|
||||||
ClickAction(
|
ClickAction(
|
||||||
element_id="",
|
element_id="",
|
||||||
x=x,
|
x=x,
|
||||||
y=y,
|
y=y,
|
||||||
button="left",
|
button=button,
|
||||||
repeat=repeat,
|
repeat=repeat,
|
||||||
reasoning=reasoning,
|
reasoning=reasoning,
|
||||||
intention=reasoning,
|
intention=reasoning,
|
||||||
|
|||||||
Reference in New Issue
Block a user