orchestrate

Former-commit-id: 21703ef58189df5f10fcf4155b6a7defa93ea38a
pull/160/head
Kye 2 years ago
parent 2aeed21c0b
commit ad155838ff

@ -69,7 +69,25 @@ class Orchestrator:
/ | | \ / | | \
(Task Assignment) (Task Completion) (Task Assignment) (Task Completion) (Task Assignment) (Task Completion) (Task Assignment) (Task Completion)
###Usage
```
from exa import Orchestrator
# Instantiate the Orchestrator with 10 agents
orchestrator = Orchestrator(llm, agent_list=[llm]*10, task_queue=[])
# Add tasks to the Orchestrator
tasks = [{"content": f"Write a short story about a {animal}."} for animal in ["cat", "dog", "bird", "fish", "lion", "tiger", "elephant", "giraffe", "monkey", "zebra"]]
orchestrator.assign_tasks(tasks)
# Run the Orchestrator
orchestrator.run()
# Retrieve the results
for task in tasks:
print(orchestrator.retrieve_result(id(task)))
```
""" """
def __init__( def __init__(
self, self,

Loading…
Cancel
Save