diff --git a/swarms/__init__.py b/swarms/__init__.py index 9b866975..5ee363d8 100644 --- a/swarms/__init__.py +++ b/swarms/__init__.py @@ -7,3 +7,6 @@ from swarms.swarms import * # noqa: E402, F403 from swarms.structs import * # noqa: E402, F403 from swarms.models import * # noqa: E402, F403 from swarms.telemetry import * # noqa: E402, F403 +from swarms.utils import * # noqa: E402, F403 +from swarms.prompts import * # noqa: E402, F403 +# from swarms.cli import * # noqa: E402, F403 \ No newline at end of file diff --git a/swarms/structs/task.py b/swarms/structs/task.py index caf812ae..81351b4f 100644 --- a/swarms/structs/task.py +++ b/swarms/structs/task.py @@ -4,8 +4,6 @@ from typing import ( Callable, Dict, List, - Optional, - Sequence, Union, ) diff --git a/tests/structs/test_task.py b/tests/structs/test_task.py index 85bc1daf..2c116402 100644 --- a/tests/structs/test_task.py +++ b/tests/structs/test_task.py @@ -118,26 +118,49 @@ def test_task_creation(): assert task.result is None assert task.agents == [agent] + def test_task_with_dependencies(): agent = Agent() - task = Task(id="2", task="Task2", result=None, agents=[agent], dependencies=["Task1"]) + task = Task( + id="2", + task="Task2", + result=None, + agents=[agent], + dependencies=["Task1"], + ) assert task.dependencies == ["Task1"] + def test_task_with_args(): agent = Agent() - task = Task(id="3", task="Task3", result=None, agents=[agent], args=["arg1", "arg2"]) + task = Task( + id="3", + task="Task3", + result=None, + agents=[agent], + args=["arg1", "arg2"], + ) assert task.args == ["arg1", "arg2"] + def test_task_with_kwargs(): agent = Agent() - task = Task(id="4", task="Task4", result=None, agents=[agent], kwargs={"kwarg1": "value1"}) + task = Task( + id="4", + task="Task4", + result=None, + agents=[agent], + kwargs={"kwarg1": "value1"}, + ) assert task.kwargs == {"kwarg1": "value1"} + # ... continue creating tests for different scenarios + # Test execute method def test_execute(): agent = Agent() task = Task(id="5", task="Task5", result=None, agents=[agent]) # Assuming execute method returns True on successful execution - assert task.execute() == True \ No newline at end of file + assert task.execute() == True