MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / set_actions

Method set_actions

eval_heldout/webarena/agent/agent.py:105–129  ·  view source on GitHub ↗
(self, action_seq: str | list[str])

Source from the content-addressed store, hash-verified

103
104 @beartype
105 def set_actions(self, action_seq: str | list[str]) -> None:
106 if isinstance(action_seq, str):
107 action_strs = action_seq.strip().split("\n")
108 else:
109 action_strs = action_seq
110 action_strs = [a.strip() for a in action_strs]
111
112 actions = []
113 for a_str in action_strs:
114 try:
115 if self.action_set_tag == "playwright":
116 cur_action = create_playwright_action(a_str)
117 elif self.action_set_tag == "id_accessibility_tree":
118 cur_action = create_id_based_action(a_str)
119 else:
120 raise ValueError(
121 f"Unknown action type {self.action_set_tag}"
122 )
123 except ActionParsingError as e:
124 cur_action = create_none_action()
125
126 cur_action["raw_prediction"] = a_str
127 actions.append(cur_action)
128
129 self.actions: list[Action] = actions
130
131 @beartype
132 def next_action(

Callers 1

resetMethod · 0.95

Calls 3

create_playwright_actionFunction · 0.90
create_id_based_actionFunction · 0.90
create_none_actionFunction · 0.90

Tested by

no test coverage detected