| 55 | |
| 56 | |
| 57 | def config() -> argparse.Namespace: |
| 58 | parser = argparse.ArgumentParser( |
| 59 | description="Run end-to-end evaluation on the benchmark" |
| 60 | ) |
| 61 | parser.add_argument( |
| 62 | "--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( |
| 71 | "--action_set_tag", default="id_accessibility_tree", help="Action type" |
| 72 | ) |
| 73 | parser.add_argument( |
| 74 | "--observation_type", |
| 75 | choices=["accessibility_tree", "html", "image"], |
| 76 | default="accessibility_tree", |
| 77 | help="Observation type", |
| 78 | ) |
| 79 | parser.add_argument( |
| 80 | "--current_viewport_only", |
| 81 | action="store_true", |
| 82 | help="Only use the current viewport for the observation", |
| 83 | ) |
| 84 | parser.add_argument("--viewport_width", type=int, default=1280) |
| 85 | parser.add_argument("--viewport_height", type=int, default=720) |
| 86 | parser.add_argument("--save_trace_enabled", action="store_true") |
| 87 | parser.add_argument("--sleep_after_execution", type=float, default=0.0) |
| 88 | |
| 89 | parser.add_argument("--max_steps", type=int, default=30) |
| 90 | |
| 91 | # agent config |
| 92 | parser.add_argument("--agent_type", type=str, default="prompt") |
| 93 | parser.add_argument( |
| 94 | "--instruction_path", |
| 95 | type=str, |
| 96 | default="agents/prompts/state_action_agent.json", |
| 97 | ) |
| 98 | parser.add_argument( |
| 99 | "--parsing_failure_th", |
| 100 | help="When concesecutive parsing failure exceeds this threshold, the agent will stop", |
| 101 | type=int, |
| 102 | default=3, |
| 103 | ) |
| 104 | parser.add_argument( |
| 105 | "--repeating_action_failure_th", |
| 106 | help="When concesecutive repeating action exceeds this threshold, the agent will stop", |
| 107 | type=int, |
| 108 | default=3, |
| 109 | ) |
| 110 | |
| 111 | # lm config |
| 112 | parser.add_argument("--provider", type=str, default="openai") |
| 113 | parser.add_argument("--model", type=str, default="gpt-3.5-turbo-0613") |
| 114 | parser.add_argument("--mode", type=str, default="chat") |