Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin takeover in group chat #1209

Merged
merged 4 commits into from
Sep 7, 2023
Merged

admin takeover in group chat #1209

merged 4 commits into from
Sep 7, 2023

Conversation

sonichi
Copy link
Contributor

@sonichi sonichi commented Sep 4, 2023

Why are these changes needed?

  1. allow admin take over during group chat by keyboard interruption.
  2. add a more complex group chat notebook example.

Related issue number

Checks

@@ -12,6 +12,7 @@ class GroupChat:
agents: List[Agent]
messages: List[Dict]
max_round: int = 10
admin_name: str = "Admin" # the name of the admin agent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check if admin_name exists here? So you don't need to throw expection in run_chat

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we check it "here"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understand is admin_name must be the name of an agent in agents, Otherwise the keyboardInterruption will be raised when human user tries to interrupt group chat?

If my understand is correct it would be better to check if admin_name is legit(a.k.a is one of an agents) in constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin_name is optional. There doesn't have to be an admin. Only when there is, we support using KeyboardInterruption to take over.

# speaker selection msg from an agent
speaker = config.select_speaker(speaker, self)
reply = speaker.generate_reply(sender=self)
if i != groupchat.max_round - 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to explain what's being done here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

Copy link
Collaborator

@pcdeadeasy pcdeadeasy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Although there can be a few more comments added to the notebook to explain the role of the different agents.

@sonichi sonichi added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 6, 2023
@sonichi sonichi added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 6, 2023
@sonichi sonichi added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 6, 2023
@sonichi sonichi added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 6, 2023
@sonichi sonichi added this pull request to the merge queue Sep 7, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 7, 2023
@sonichi sonichi added this pull request to the merge queue Sep 7, 2023
Merged via the queue into main with commit 93b9e09 Sep 7, 2023
13 of 16 checks passed
@sonichi sonichi deleted the groupchat branch September 7, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants