-
Notifications
You must be signed in to change notification settings - Fork 60
/
examples.py
48 lines (41 loc) · 1.42 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import click
from browserpilot.agents.gpt_selenium_agent import GPTSeleniumAgent
# from browserpilot.agents.goal_agent import GoalAgent
# Set up multiple command CLI.
@click.group()
def cli():
pass
@cli.command()
@click.argument("instructions")
@click.option("--chromedriver_path", default="./chromedriver", help="chromedriver path")
@click.option("--model", default="gpt-4o-mini", help="which model?")
@click.option("--memory_folder", default=None, help="Memory folder.")
@click.option("--debug", is_flag=True, help="Enable debugging.")
@click.option("--output", default=None, help="Instruction output file.")
def selenium(instructions, chromedriver_path, model, memory_folder, debug, output):
with open(instructions, "r") as instructions:
agent = GPTSeleniumAgent(
instructions,
chromedriver_path,
instruction_output_file=output,
model_for_instructions=model,
memory_folder=memory_folder,
debug=debug,
retry=True,
)
agent.run()
"""🤫
@cli.command()
@click.option("--instructions", default=None, help="Instructions file.")
@click.option("--memory_folder", is_flag=True, help="Enable memory.")
def goal(instructions, memory_folder):
agent = GoalAgent(
instructions,
"./chromedriver",
memory_folder=memory_folder,
debug=True,
)
agent.run()
"""
if __name__ == "__main__":
cli()