Former-commit-id: c4129b84a62c17e52412d506ec1181066e17f592
pull/160/head
Kye 2 years ago
parent 710f146860
commit 4a9e288af4

@ -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."

@ -1,3 +1,3 @@
# from swarms import Swarms, swarm
from swarms.swarms import Swarms, swarm
from swarms.agents import worker_node, WorkerUltraNode
from swarms.agents import worker_node, WorkerUltra

@ -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

Loading…
Cancel
Save