Skip to content

Commit

Permalink
update aider_example for sync run
Browse files Browse the repository at this point in the history
  • Loading branch information
User committed Jun 6, 2024
1 parent fe6a8b7 commit 911f045
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions examples/aider_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("."))
Expand All @@ -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(
Expand All @@ -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,
)
Expand Down

0 comments on commit 911f045

Please sign in to comment.