()
| 58 | |
| 59 | |
| 60 | def config() -> argparse.Namespace: |
| 61 | parser = argparse.ArgumentParser(description="Run end-to-end evaluation on the benchmark") |
| 62 | parser.add_argument("--render", action="store_true", help="Render the browser") |
| 63 | |
| 64 | parser.add_argument( |
| 65 | "--slow_mo", |
| 66 | type=int, |
| 67 | default=0, |
| 68 | help="Slow down the browser by the specified amount", |
| 69 | ) |
| 70 | parser.add_argument("--action_set_tag", default="id_accessibility_tree", help="Action type") |
| 71 | parser.add_argument( |
| 72 | "--observation_type", |
| 73 | choices=[ |
| 74 | "accessibility_tree", |
| 75 | "accessibility_tree_with_captioner", |
| 76 | "html", |
| 77 | "image", |
| 78 | "image_som", |
| 79 | ], |
| 80 | default="accessibility_tree", |
| 81 | help="Observation type", |
| 82 | ) |
| 83 | parser.add_argument( |
| 84 | "--current_viewport_only", |
| 85 | action="store_true", |
| 86 | help="Only use the current viewport for the observation", |
| 87 | ) |
| 88 | parser.add_argument("--viewport_width", type=int, default=1280) |
| 89 | parser.add_argument("--viewport_height", type=int, default=2048) |
| 90 | parser.add_argument("--save_trace_enabled", action="store_true") |
| 91 | parser.add_argument("--sleep_after_execution", type=float, default=0.0) |
| 92 | |
| 93 | parser.add_argument("--max_steps", type=int, default=30) |
| 94 | |
| 95 | # agent config |
| 96 | parser.add_argument("--agent_type", type=str, default="reflexion") |
| 97 | # TODO what to do of the instruction path? |
| 98 | # multimodal or som or reflexion? |
| 99 | parser.add_argument( |
| 100 | "--instruction_path", |
| 101 | type=str, |
| 102 | default="agent/prompts/jsons/p_multimodal_cot_id_actree_3s_reflexion.json", |
| 103 | ) |
| 104 | parser.add_argument( |
| 105 | "--parsing_failure_th", |
| 106 | help="When consecutive parsing failures exceed this threshold, the agent will terminate early.", |
| 107 | type=int, |
| 108 | default=3, |
| 109 | ) |
| 110 | parser.add_argument( |
| 111 | "--repeating_action_failure_th", |
| 112 | help="When consecutive repeated actions exceed this threshold, the agent will terminate early.", |
| 113 | type=int, |
| 114 | default=5, |
| 115 | ) |
| 116 | |
| 117 | # for reflexion |
no outgoing calls
no test coverage detected