MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / call

Method call

eval/utils/utils_qwen/agent_function_call.py:227–247  ·  view source on GitHub ↗
(self, params: Union[str, dict], **kwargs)

Source from the content-addressed store, hash-verified

225 super().__init__(cfg)
226
227 def call(self, params: Union[str, dict], **kwargs):
228 params = self._verify_json_format_args(params)
229 action = params["action"]
230 if action in ["left_click", "right_click", "middle_click", "double_click"]:
231 return self._mouse_click(action)
232 elif action == "key":
233 return self._key(params["keys"])
234 elif action == "type":
235 return self._type(params["text"])
236 elif action == "mouse_move":
237 return self._mouse_move(params["coordinate"])
238 elif action == "left_click_drag":
239 return self._left_click_drag(params["coordinate"])
240 elif action == "scroll":
241 return self._scroll(params["pixels"])
242 elif action == "wait":
243 return self._wait(params["time"])
244 elif action == "terminate":
245 return self._terminate(params["status"])
246 else:
247 raise ValueError(f"Invalid action: {action}")
248
249 def _mouse_click(self, button: str):
250 raise NotImplementedError()

Callers

nothing calls this directly

Calls 8

_mouse_clickMethod · 0.95
_keyMethod · 0.95
_typeMethod · 0.95
_mouse_moveMethod · 0.95
_left_click_dragMethod · 0.95
_scrollMethod · 0.95
_waitMethod · 0.95
_terminateMethod · 0.95

Tested by

no test coverage detected