MCPcopy Create free account
hub / github.com/ChenWu98/agent-attack / config

Function config

scripts/eval_pipeline_attack_tree_search_attack.py:63–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls

Tested by

no test coverage detected