added cli command + code cleanup TODO: need better refactoring

This commit is contained in:
Lorenze Jay
2024-07-11 10:06:21 -07:00
parent 28929e1c5f
commit 3aa5d16a6f
7 changed files with 90 additions and 85 deletions

View File

@@ -21,3 +21,13 @@ def train():
except Exception as e:
raise Exception(f"An error occurred while training the crew: {e}")
def replay_from_task():
"""
Replay the crew execution from a specific task.
"""
try:
{{crew_name}}Crew().crew().replay_from_task(task_id=sys.argv[1])
except Exception as e:
raise Exception(f"An error occurred while replaying the crew: {e}")

View File

@@ -11,6 +11,7 @@ crewai = { extras = ["tools"], version = "^0.35.8" }
[tool.poetry.scripts]
{{folder_name}} = "{{folder_name}}.main:run"
train = "{{folder_name}}.main:train"
replay_from_task = "{{folder_name}}.main:replay_from_task"
[build-system]
requires = ["poetry-core"]