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

Extending Graph Group Chat - Prioritise choosing an executor from eligible_speakers when the previous_speaker produced code #778

Closed
joshkyh opened this issue Nov 27, 2023 · 9 comments · Fixed by #1791
Labels
group chat/teams group-chat-related issues

Comments

@joshkyh
Copy link
Collaborator

joshkyh commented Nov 27, 2023

During the review of #753, @JieyuZ2 suggested prioritising choosing an executor from eligible_speakers when the previous_speaker produced code in GraphGroupChat.

image

Couple of considerations:

  1. Limit the code language detection to Python for this iteration. Do we have a Python code detector currently?
  2. Do not pick a random executor if there are at least two eligible executors, and ask the LLM instead.
  3. Allow the Agent class, along with its attributes like able to execute code to be passed into the NetworkX Graph class instead of strings.

Please feel free to add considerations if anyone can think of any.

@joshkyh joshkyh mentioned this issue Nov 27, 2023
3 tasks
@JieyuZ2
Copy link
Collaborator

JieyuZ2 commented Nov 27, 2023

re code detector: https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L664

@JieyuZ2
Copy link
Collaborator

JieyuZ2 commented Nov 27, 2023

And to do this, we better follow the trigger-match mechanism in conversableagent https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L954

There we trigger a reply func if the condition is satisfied, and reply funcs are checked in order
Here we mark an agent as eligible once the condition is satisfied.

@sonichi sonichi added the group chat/teams group-chat-related issues label Dec 3, 2023
@joshkyh
Copy link
Collaborator Author

joshkyh commented Dec 5, 2023

Maybe we don't want to prioritise executors if the previous message contains code.
image

@ragyabraham can you tell us a little more about the use case? Under what circumstances did you generate code in the previous talk turn and did not want to execute it in the current talkturn?

@ragyabraham
Copy link
Collaborator

yeah, the way I see it is that at present, Autogen is very much geared towards performing tasks with code, which is why this bias exists of "if there's code, then execute code". However, if Autogen is to extend its utility beyond that to become a generalised LLM framework, the user should be able to dictate "code behaviour".

If I want to chat with an agent or group of agents and I do not want any code to be executed but rather purely from an education/knowledge perspective, I should, in theory, have the ability to do that.

@ragyabraham
Copy link
Collaborator

Perhaps there should be a flag somewhere where a user can set their code preference.
As in "What should we do when we see code." And that could be:

  • Nothing
  • Execute
  • write to file
  • etc.

@JieyuZ2
Copy link
Collaborator

JieyuZ2 commented Dec 5, 2023

Maybe we don't want to prioritise executors if the previous message contains code. image

yes i agree. In that case, we don't have to put an executor in the group chat at the beginning. And the trigger-match mechanism does not mean to always prioritise choosing an executor when there is code, but rather a choice of users: the user can bind a "code trigger" with the executor, then the executor will become eligible when there is code ("code trigger" is matched)

@JieyuZ2
Copy link
Collaborator

JieyuZ2 commented Dec 5, 2023

Perhaps there should be a flag somewhere where a user can set their code preference. As in "What should we do when we see code." And that could be:

  • Nothing
  • Execute
  • write to file
  • etc.

yes, in this case, the user can:

  • do nothing
  • bind the "code trigger" with an executor so it extracts and execute the code
  • bind the "code trigger" with an file writer so it extracts and cp the code to a file

@ragyabraham
Copy link
Collaborator

For reference, this is what is currently happening.

Screenshot 2023-12-05 at 2 57 21 pm

@joshkyh
Copy link
Collaborator Author

joshkyh commented Dec 5, 2023

For reference, this is what is currently happening.

Screenshot 2023-12-05 at 2 57 21 pm

Yeah, interesting the user is trying to learn Rust without wanting to run code. I guess for now, we have to remove the executor abilities for the User Proxy agent in your use-case @ragyabraham.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group chat/teams group-chat-related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants