Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for __main__.py #25

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 45 additions & 46 deletions integuru/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,51 @@
import asyncio
import click

if __name__ == "__main__":

@click.command()
@click.option(
"--model", default="gpt-4o", help="The LLM model to use (default is gpt-4o)"
)
@click.option("--prompt", required=True, help="The prompt for the model")
@click.option(
"--har-path",
default="./network_requests.har",
help="The HAR file path (default is ./network_requests.har)",
)
@click.option(
"--cookie-path",
default="./cookies.json",
help="The cookie file path (default is ./cookies.json)",
)
@click.option(
"--max_steps", default=20, type=int, help="The max_steps (default is 20)"
)
@click.option(
"--input_variables",
multiple=True,
type=(str, str),
help="Input variables in the format key value",
)
@click.option(
"--generate-code",
is_flag=True,
default=False,
help="Whether to generate the full integration code",
)
def cli(
model, prompt, har_path, cookie_path, max_steps, input_variables, generate_code
):
input_vars = dict(input_variables)
asyncio.run(
call_agent(
model,
prompt,
har_path,
cookie_path,
input_variables=input_vars,
max_steps=max_steps,
to_generate_code=generate_code,
)
@click.command()
@click.option(
"--model", default="gpt-4o", help="The LLM model to use (default is gpt-4o)"
)
@click.option("--prompt", required=True, help="The prompt for the model")
@click.option(
"--har-path",
default="./network_requests.har",
help="The HAR file path (default is ./network_requests.har)",
)
@click.option(
"--cookie-path",
default="./cookies.json",
help="The cookie file path (default is ./cookies.json)",
)
@click.option(
"--max_steps", default=20, type=int, help="The max_steps (default is 20)"
)
@click.option(
"--input_variables",
multiple=True,
type=(str, str),
help="Input variables in the format key value",
)
@click.option(
"--generate-code",
is_flag=True,
default=False,
help="Whether to generate the full integration code",
)
def cli(
model, prompt, har_path, cookie_path, max_steps, input_variables, generate_code
):
input_vars = dict(input_variables)
asyncio.run(
call_agent(
model,
prompt,
har_path,
cookie_path,
input_variables=input_vars,
max_steps=max_steps,
to_generate_code=generate_code,
)
)

if __name__ == "__main__":
cli()
Loading