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

Method call

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

Source from the content-addressed store, hash-verified

87 super().__init__(cfg)
88
89 def call(self, params: Union[str, dict], **kwargs):
90 params = self._verify_json_format_args(params)
91 action = params["action"]
92 if action == "key":
93 return self._key(params["text"])
94 elif action == "click":
95 return self._click(
96 coordinate=params["coordinate"]
97 )
98 elif action == "long_press":
99 return self._long_press(
100 coordinate=params["coordinate"], time=params["time"]
101 )
102 elif action == "swipe":
103 return self._swipe(
104 coordinate=params["coordinate"], coordinate2=params["coordinate2"]
105 )
106 elif action == "type":
107 return self._type(params["text"])
108 elif action == "system_button":
109 return self._system_button(params["button"])
110 elif action == "open":
111 return self._open(params["text"])
112 elif action == "wait":
113 return self._wait(params["time"])
114 elif action == "terminate":
115 return self._terminate(params["status"])
116 else:
117 raise ValueError(f"Unknown action: {action}")
118
119 def _key(self, text: str):
120 raise NotImplementedError()

Callers

nothing calls this directly

Calls 9

_keyMethod · 0.95
_clickMethod · 0.95
_long_pressMethod · 0.95
_swipeMethod · 0.95
_typeMethod · 0.95
_system_buttonMethod · 0.95
_openMethod · 0.95
_waitMethod · 0.95
_terminateMethod · 0.95

Tested by

no test coverage detected