diff --git a/pyproject.toml b/pyproject.toml index 464e219ea0..d5cbb26014 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "crewai" -version = "0.36.0" +version = "0.41.0" description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks." authors = ["Joao Moura "] readme = "README.md" @@ -21,7 +21,7 @@ opentelemetry-sdk = "^1.22.0" opentelemetry-exporter-otlp-proto-http = "^1.22.0" instructor = "1.3.3" regex = "^2023.12.25" -crewai-tools = { version = "^0.4.8", optional = true } +crewai-tools = { version = "^0.4.26", optional = true } click = "^8.1.7" python-dotenv = "^1.0.0" appdirs = "^1.4.4" @@ -46,7 +46,7 @@ mkdocs-material = { extras = ["imaging"], version = "^9.5.7" } mkdocs-material-extensions = "^1.3.1" pillow = "^10.2.0" cairosvg = "^2.7.1" -crewai-tools = "^0.4.8" +crewai-tools = "^0.4.26" [tool.poetry.group.test.dependencies] pytest = "^8.0.0" diff --git a/src/crewai/cli/templates/main.py b/src/crewai/cli/templates/main.py index 86832d7eb1..2ec1cc6b09 100644 --- a/src/crewai/cli/templates/main.py +++ b/src/crewai/cli/templates/main.py @@ -2,9 +2,15 @@ import sys from {{folder_name}}.crew import {{crew_name}}Crew +# This main file is intended to be a way for your to run your +# crew locally, so refrain from adding necessary logic into this file. +# Replace with inputs you want to test with, it will automatically +# interpolate any tasks and agents information def run(): - # Replace with your inputs, it will automatically interpolate any tasks and agents information + """ + Run the crew. + """ inputs = { 'topic': 'AI LLMs' } @@ -15,19 +21,21 @@ def train(): """ Train the crew for a given number of iterations. """ - inputs = {"topic": "AI LLMs"} + inputs = { + "topic": "AI LLMs" + } try: {{crew_name}}Crew().crew().train(n_iterations=int(sys.argv[1]), inputs=inputs) except Exception as e: raise Exception(f"An error occurred while training the crew: {e}") -def replay_from_task(): +def replay(): """ Replay the crew execution from a specific task. """ try: - {{crew_name}}Crew().crew().replay_from_task(task_id=sys.argv[1]) + {{crew_name}}Crew().crew().replay(task_id=sys.argv[1]) except Exception as e: raise Exception(f"An error occurred while replaying the crew: {e}") diff --git a/src/crewai/cli/templates/pyproject.toml b/src/crewai/cli/templates/pyproject.toml index 4d1d5e15e9..26a82cd678 100644 --- a/src/crewai/cli/templates/pyproject.toml +++ b/src/crewai/cli/templates/pyproject.toml @@ -6,12 +6,12 @@ authors = ["Your Name "] [tool.poetry.dependencies] python = ">=3.10,<=3.13" -crewai = { extras = ["tools"], version = "^0.35.8" } +crewai = { extras = ["tools"], version = "^0.41.0" } [tool.poetry.scripts] {{folder_name}} = "{{folder_name}}.main:run" train = "{{folder_name}}.main:train" -replay = "{{folder_name}}.main:replay_from_task" +replay = "{{folder_name}}.main:replay" [build-system] requires = ["poetry-core"] diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 3d54aedc37..c4d09b0682 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -838,7 +838,7 @@ def _find_task_index( None, ) - def replay_from_task( + def replay( self, task_id: str, inputs: Optional[Dict[str, Any]] = None ) -> CrewOutput: stored_outputs = self._task_output_handler.load()