diff --git a/examples/aider_example.py b/examples/aider_example.py index 82330238..4c98991e 100644 --- a/examples/aider_example.py +++ b/examples/aider_example.py @@ -13,7 +13,6 @@ from motleycache import logger from motleycrew.tools.aider_tool import AiderTool -from aider.io import InputOutput logger.setLevel(logging.INFO) WORKING_DIR = Path(os.path.realpath(".")) @@ -33,12 +32,13 @@ def main(): - crew = MotleyCrew(async_backend=AsyncBackend.THREADING) + crew = MotleyCrew() git_dname = r"../../motleycrew-code-generation-example" # aider coder git dir name - io = InputOutput(yes=True) + tests_file = os.path.join(git_dname, "test_math_functions.py") + fnames = [tests_file] - aider_tool = AiderTool(io=io, git_dname=git_dname, auto_commits=False) + aider_tool = AiderTool(fnames=fnames, git_dname=git_dname, auto_commits=False) shell_tool = ShellTool() developer = CrewAIMotleyAgent( @@ -54,14 +54,12 @@ def main(): create_unit_tests_task = SimpleTask( crew=crew, name="Adding a unit test", - description=f"""Generate unit tests for the module math_functions.py - Using py test, you can also add checks for possible exceptions and comments to the tests - and using parameterization for test functions . - Go to the directory {git_dname} and run created unit tests for math_functions. + description=f"""Generate unit tests for the module math_functions.py, + using pytest, you can also add checks for possible exceptions and + comments to the tests and using parameterization for test functions. + After go to the directory {git_dname} and run created unit tests for math_functions. If the tests were executed successfully, return the result of execution, - if not, rewrite the tests and restart them. - If the command to run unit tests fails, try to run it one more time, - despite the fact that this command has already been executed. + if not, rewrite the tests and restart them. """, agent=developer, )