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

Function get_direction

eval/utils/evaluator.py:138–150  ·  view source on GitHub ↗
(point, to)

Source from the content-addressed store, hash-verified

136 return closest_direction
137
138def get_direction(point, to):
139 if isinstance(to, str):
140 if to in ["up", "down", "left", "right"]:
141 return to
142 else:
143 return "no direction"
144 elif isinstance(to, list):
145 try:
146 point1 = {"x": point[0], "y": point[1]}
147 point2 = {"x": to[0], "y": to[1]}
148 return _get_direction(point1, point2)
149 except Exception as e:
150 return "no direction"
151
152class ActionEvaluator(object):
153

Callers 2

aitw_2_uitarsFunction · 0.90
_parse_action_Method · 0.70

Calls 1

_get_directionFunction · 0.85

Tested by

no test coverage detected