Former-commit-id: 31451c6f60
discord-bot
Kye 1 year ago
parent 530837bfe9
commit 7e96c29dcf

@ -1,5 +1,5 @@
from langchain.llms import OpenAIChat
from swarms.swarms import GroupChat
from swarms.swarms import GroupChat, GroupChatManager
from swarms.workers import Worker
llm = OpenAIChat(
@ -48,12 +48,27 @@ messages = [
}
]
group = GroupChat(
nodes,
messages,
nodes=nodes,
max_rounds=3,
max_consecutive_auto_reply=3,
human_input_mode="NEVER",
system_message="Group chat manager",
)
output = group.run()
manager = GroupChatManager(
groupchat=group,
name="chat_manager",
max_consecutive_auto_reply=3,
human_input_mode="NEVER",
system_message="Group chat manager",
)
output = group.run(
messages,
sender=node,
config=group,
)
print(output)

@ -4,6 +4,7 @@ from typing import Dict, List, Optional, Union
from swarms.workers.worker import Worker
@dataclass
class GroupChat:
"""A group chat with multiple participants with a list of workers and a max number of rounds"""
@ -77,7 +78,6 @@ class GroupChatManager(Worker):
self,
groupchat: GroupChat,
name: Optional[str] = "chat_manager",
#unlimited auto reply
max_consecutive_auto_reply: Optional[int] = sys.maxsize,
human_input_mode: Optional[str] = "NEVER",
system_message: Optional[str] = "Group chat manager",

Loading…
Cancel
Save