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

Function add_current_place

eval_heldout/science-world/data_utils/data_utils.py:91–105  ·  view source on GitHub ↗
(curr_obs, look, places)

Source from the content-addressed store, hash-verified

89# return curr_task_seq
90
91def add_current_place(curr_obs, look, places):
92 # Extract current place
93 index = curr_obs.find("move to the")
94 if index != -1:
95 place = curr_obs[index + 12: -1].strip()
96 if place not in places:
97 places.append(place)
98
99 # Extract the first room the where the agent is
100 start = look.find("This room is called the")
101 end = look.find(".")
102 if start != -1:
103 if look[start + 24 : end] not in places:
104 places.append(look[start + 24 : end])
105 return
106
107
108def add_current_objects(task_id, look, objects, limit=20):

Callers 1

data_convert.pyFile · 0.90

Calls 1

findMethod · 0.45

Tested by

no test coverage detected