Skip to content

Commit 3d9d7dd

Browse files
committed
add back point and function argument types
1 parent a76eefe commit 3d9d7dd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stagehand/agent/anthropic_cua.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,13 @@ def _convert_tool_use_to_agent_action(
501501
and x is not None
502502
and y is not None
503503
):
504+
path_points = [
505+
Point(x=start_x, y=start_y),
506+
Point(x=x, y=y),
507+
]
504508
action_payload_dict = {
505509
"type": "drag",
506-
"path": [
507-
{"x": start_x, "y": start_y},
508-
{"x": x, "y": y},
509-
],
510+
"path": path_points,
510511
}
511512
action_type_str = "drag" # Normalize
512513
else:
@@ -566,7 +567,7 @@ def _convert_tool_use_to_agent_action(
566567
action_payload_dict = {
567568
"type": "function",
568569
"name": "goto",
569-
"arguments": {"url": url},
570+
"arguments": FunctionArguments(url=url),
570571
}
571572
action_type_str = "function"
572573
else:
@@ -579,7 +580,7 @@ def _convert_tool_use_to_agent_action(
579580
action_payload_dict = {
580581
"type": "function",
581582
"name": "navigate_back",
582-
"arguments": None,
583+
"arguments": FunctionArguments(),
583584
}
584585
action_type_str = "function"
585586
else:

0 commit comments

Comments
 (0)