You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to implement a GroupChatPipeline that agents can freely talk rather than speak one by one sequencely
SisterAgent: @MomAgent mommmmm! Tom hit me!!!!MomAgent: oh my baby, let me check your injuriesMomAgent: em fine. That's not a big problemSisterAgent: ouch! mom I really feel hurtMomAgent: TOM YOU BASTARD! COME HERE RIGHT NOW!BrotherAgent: what happended?
Describe the solution you'd like
# -*- coding:utf-8 -*-# built-in packagesfromtypingimportCallable, List# third-party packagesfromagentscope.agentsimportAgentBase# self-defined packagesclassGroupContext(object):
passclassBaseAgentAttendStrategy(object):
# should an agent attend the group chat of current topic?passclassKeywordsAgentAttendStrategy(BaseAgentAttendStrategy):
# attend current topic if match some keywordspassclassBeenMentionedAgentAttendStrategy(BaseAgentAttendStrategy):
# attend current topic if been mentionedpassclassAgentWithAttendStrategy(object):
agent: AgentBaseattend_strategies: List[BaseAgentAttendStrategy]
classGroupChatPipeline(object):
def__init__(self):
self.context=GroupContext()
self.members: List[AgentWithAttendStrategy] = []
deftrigger_next_speaker(self, msg) ->AgentBase:
passdef__call__(self,
start_agent: AgentBase,
start_words: str,
max_rounds: int,
ending_func: Callable[[GroupContext], bool]
):
next_speaker=start_agentmsg=start_wordsn_round=0whilen_round<max_roundsandnotending_func(self.context):
n_round+=1msg=next_speaker(msg)
next_speaker=self.trigger_next_speaker(msg)
Additional context
I am wondering:
Is there any existing workaround functions or tools to achieve the GroupChatPipeline?
if Q1 answer is not. Do the team have a plan to make something alike?
The text was updated successfully, but these errors were encountered:
Morriaty-The-Murderer
changed the title
[Feature]:
[Feature]: implement a GroupChatPipeline that agents can freely talk rather than speak one by one sequencely
May 24, 2024
The key point is freely chat, there is no fixed order, a group of Agents will decide whether to join the conversation based on the context and their own personality and memory. They can refuse to respond even if they have been metioned.
In short logic:
init_msg=Msg(role="assistant", content="....")
ifSomeForcedRules:
speaker=select_agent_by_forced_rules(agents, SomeForcedRules)
else:
speaker=Nonemax_prob=0forbotinagents:
possibilities=bot.think(f"how possible should I respond the msg: {init_msg}")
ifpossibilities>max_prob:
max_prob=possibilitiesspeaker=botresponse=speaker()
Is your feature request related to a problem? Please describe.
I'm trying to implement a
GroupChatPipeline
that agents can freely talk rather than speak one by one sequencelyDescribe the solution you'd like
Additional context
I am wondering:
GroupChatPipeline
?The text was updated successfully, but these errors were encountered: