diff --git a/playground/worker_ultra.py b/playground/worker_ultra.py new file mode 100644 index 00000000..55d5492b --- /dev/null +++ b/playground/worker_ultra.py @@ -0,0 +1,5 @@ +from swarms import WorkerUltra + +objective = "What is the capital of the UK?" +result = WorkerUltra(objective) +print(result) # Prints: "The capital of the UK is London." \ No newline at end of file diff --git a/swarms/__init__.py b/swarms/__init__.py index 44a0bdb4..92413173 100644 --- a/swarms/__init__.py +++ b/swarms/__init__.py @@ -1,3 +1,3 @@ # from swarms import Swarms, swarm from swarms.swarms import Swarms, swarm -from swarms.agents import worker_node, WorkerUltraNode \ No newline at end of file +from swarms.agents import worker_node, WorkerUltra \ No newline at end of file diff --git a/swarms/agents/workers/WorkerUltraNode.py b/swarms/agents/workers/WorkerUltraNode.py index 0e8da00f..ab79570b 100644 --- a/swarms/agents/workers/WorkerUltraNode.py +++ b/swarms/agents/workers/WorkerUltraNode.py @@ -92,8 +92,7 @@ class WorkerUltraNode: "answer": res["output"], "files": [self.uploader.upload(file) for file in files], } - - + def execute(self): try: @@ -104,7 +103,12 @@ class WorkerUltraNode: logging.error(f"Error while executing: {str(e)}") raise e -# from worker_node import UltraNode -# node = UltraNode('objective') -# result = node.execute() + +def WorkerUltra(objective: str): + # Instantiate WorkerUltraNode with the user's objective + worker_node = WorkerUltraNode(objective) + + # Return the result of the execution + return worker_node.result +