| 8 | from .shopping_admin import * |
| 9 | |
| 10 | def manual_solver(env, config_file, render_helper, agent, args, intent, field_dict): |
| 11 | # return solver_364(env, config_file, render_helper, agent, args, intent, field_dict) |
| 12 | agent.reset(config_file) |
| 13 | trajectory: Trajectory = [] |
| 14 | obs, info = env.reset(options={"config_file": config_file}) |
| 15 | state_info: StateInfo = {"observation": obs, "info": info} |
| 16 | trajectory.append(state_info) |
| 17 | |
| 18 | meta_data = {"action_history": ["None"]} |
| 19 | traces = [] |
| 20 | |
| 21 | obs_info = info["observation_metadata"]["text"] |
| 22 | dom_tree, nodes_info = obs_info["dom_info"]["dom_tree"], obs_info["obs_nodes_info"] |
| 23 | |
| 24 | print(field_dict) |
| 25 | while True: |
| 26 | obs_info = state_info["info"]["observation_metadata"]["text"] |
| 27 | dom_tree, nodes_info = obs_info["dom_info"]["dom_tree"], obs_info["obs_nodes_info"] |
| 28 | target_action = input() |
| 29 | res = step_once(env, trajectory, render_helper, traces, state_info, agent, args, intent, meta_data, target_action) |
| 30 | if res is None: |
| 31 | return traces, trajectory |
| 32 | state_info, dom_tree, nodes_info = res |
| 33 | |