From 68a67f6e93bf8c2cf2ac90d7acc917f5c18926ec Mon Sep 17 00:00:00 2001 From: agentmarketbot Date: Wed, 8 Jan 2025 11:08:16 +0100 Subject: [PATCH] agent bot commit --- aider_modify_repo.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 aider_modify_repo.py diff --git a/aider_modify_repo.py b/aider_modify_repo.py new file mode 100644 index 0000000..4776c1a --- /dev/null +++ b/aider_modify_repo.py @@ -0,0 +1,42 @@ +import argparse + +from aider.coders import Coder +from aider.io import InputOutput +from aider.models import Model + + +def modify_repo_with_aider(model_name, solver_command, test_command=None) -> None: + io = InputOutput(yes=True) + model = Model(model_name) + coder = Coder.create(main_model=model, io=io, use_git=False) + coder.run(solver_command) + + if test_command: + coder.run(f"/test {test_command}") + + +def main(): + parser = argparse.ArgumentParser(description="Modify a repository with Aider.") + parser.add_argument( + "--model-name", type=str, required=True, help="The name of the model to use." + ) + parser.add_argument( + "--solver-command", + type=str, + required=True, + help="The command to run the solver.", + ) + parser.add_argument( + "--test-command", + type=str, + required=False, + help="An optional test command to run.", + ) + + args = parser.parse_args() + + modify_repo_with_aider(args.model_name, args.solver_command, args.test_command) + + +if __name__ == "__main__": + main()