chat, add_agents

Former-commit-id: 698de340b8
group-chat
Kye 1 year ago
parent 8ccc26981c
commit 23ee44a0e2

@ -245,3 +245,23 @@ class Orchestrator:
documents=[message],
ids=[f"{sender_id}_to_{receiver_id}"]
)
def add_agents(
self,
num_agents: int
):
for _ in range(num_agents):
self.agents.put(self.agent())
self.executor = ThreadPoolExecutor(
max_workers=self.agents.qsize()
)
def remove_agents(self, num_agents):
for _ in range(num_agents):
if not self.agents.empty():
self.agents.get()
self.executor = ThreadPoolExecutor(
max_workers=self.agents.qsize()
)
Loading…
Cancel
Save