|
7 | 7 | import asyncio |
8 | 8 | import click |
9 | 9 |
|
10 | | -if __name__ == "__main__": |
11 | | - |
12 | | - @click.command() |
13 | | - @click.option( |
14 | | - "--model", default="gpt-4o", help="The LLM model to use (default is gpt-4o)" |
15 | | - ) |
16 | | - @click.option("--prompt", required=True, help="The prompt for the model") |
17 | | - @click.option( |
18 | | - "--har-path", |
19 | | - default="./network_requests.har", |
20 | | - help="The HAR file path (default is ./network_requests.har)", |
21 | | - ) |
22 | | - @click.option( |
23 | | - "--cookie-path", |
24 | | - default="./cookies.json", |
25 | | - help="The cookie file path (default is ./cookies.json)", |
26 | | - ) |
27 | | - @click.option( |
28 | | - "--max_steps", default=20, type=int, help="The max_steps (default is 20)" |
29 | | - ) |
30 | | - @click.option( |
31 | | - "--input_variables", |
32 | | - multiple=True, |
33 | | - type=(str, str), |
34 | | - help="Input variables in the format key value", |
35 | | - ) |
36 | | - @click.option( |
37 | | - "--generate-code", |
38 | | - is_flag=True, |
39 | | - default=False, |
40 | | - help="Whether to generate the full integration code", |
41 | | - ) |
42 | | - def cli( |
43 | | - model, prompt, har_path, cookie_path, max_steps, input_variables, generate_code |
44 | | - ): |
45 | | - input_vars = dict(input_variables) |
46 | | - asyncio.run( |
47 | | - call_agent( |
48 | | - model, |
49 | | - prompt, |
50 | | - har_path, |
51 | | - cookie_path, |
52 | | - input_variables=input_vars, |
53 | | - max_steps=max_steps, |
54 | | - to_generate_code=generate_code, |
55 | | - ) |
| 10 | +@click.command() |
| 11 | +@click.option( |
| 12 | + "--model", default="gpt-4o", help="The LLM model to use (default is gpt-4o)" |
| 13 | +) |
| 14 | +@click.option("--prompt", required=True, help="The prompt for the model") |
| 15 | +@click.option( |
| 16 | + "--har-path", |
| 17 | + default="./network_requests.har", |
| 18 | + help="The HAR file path (default is ./network_requests.har)", |
| 19 | +) |
| 20 | +@click.option( |
| 21 | + "--cookie-path", |
| 22 | + default="./cookies.json", |
| 23 | + help="The cookie file path (default is ./cookies.json)", |
| 24 | +) |
| 25 | +@click.option( |
| 26 | + "--max_steps", default=20, type=int, help="The max_steps (default is 20)" |
| 27 | +) |
| 28 | +@click.option( |
| 29 | + "--input_variables", |
| 30 | + multiple=True, |
| 31 | + type=(str, str), |
| 32 | + help="Input variables in the format key value", |
| 33 | +) |
| 34 | +@click.option( |
| 35 | + "--generate-code", |
| 36 | + is_flag=True, |
| 37 | + default=False, |
| 38 | + help="Whether to generate the full integration code", |
| 39 | +) |
| 40 | +def cli( |
| 41 | + model, prompt, har_path, cookie_path, max_steps, input_variables, generate_code |
| 42 | +): |
| 43 | + input_vars = dict(input_variables) |
| 44 | + asyncio.run( |
| 45 | + call_agent( |
| 46 | + model, |
| 47 | + prompt, |
| 48 | + har_path, |
| 49 | + cookie_path, |
| 50 | + input_variables=input_vars, |
| 51 | + max_steps=max_steps, |
| 52 | + to_generate_code=generate_code, |
56 | 53 | ) |
| 54 | + ) |
57 | 55 |
|
| 56 | +if __name__ == "__main__": |
58 | 57 | cli() |
0 commit comments