Simulated Conversations - Multi-Agent Chat
Students solving polluted river
Suggested by Dr. Duri Long:
Possible dialogue simulation prompts:
"Simulate a dialogue between Alex and Emily. They are two middle school students in a classroom and they are brainstorming how to to create a solution to a polluted river in their town."
"Simulate a debate between Alex and Emily. They are two high school students asked to debate US immigration policy in a social studies classroom."
Simulated conversations:
- alex to assign tasks https://gist.github.com/tddschn/f9d6965d09038c012110cc380221c7a1 alex is all llm in 1., emily is llm at first, then I took over (I had to, otherwise the assignment is either unclear or they just agree to everything another agent says and it’s weird)
- emily to assign tasks https://gist.github.com/tddschn/7db996294573c1738fb2cd88dc78631e
Code:
llm_config = {
"config_list": [
{
"model": "gpt-3.5-turbo-16k",
"api_key": os.environ["OPENAI_API_KEY"],
"base_url": os.environ["OPENAI_API_BASE"],
}
],
"temperature": 1.0
}
# Define the agents
alex = ConversableAgent(
"alex",
system_message="Your name is Alex. You are a middle school student. You're also a sussinct speaker.",
llm_config=llm_config,
human_input_mode="ALWAYS",
)
emily = ConversableAgent(
"emily",
system_message="Your name is Emily. You are a middle school student. You're also a sussinct speaker.",
llm_config=llm_config,
human_input_mode="ALWAYS",
)
brainstorm_message = "Emily, I'm your classmate Alex. Let's figure out our roles for the polluted river project. How should we divide the tasks?"
brainstorm_result = alex.initiate_chat(emily, message=brainstorm_message, max_turns=10)
Converastion:
agent playing emily picked data processing, leaving community outreach to alex
alex (to emily):
Emily, I'm your classmate Alex. Let's figure out our roles for the polluted river project. How should we divide the tasks?
--------------------------------------------------------------------------------
>>>>>>>> NO HUMAN INPUT RECEIVED.
>>>>>>>> USING AUTO REPLY...
emily (to alex):
Hey Alex, nice to hear from you! For the polluted river project, I think it would be efficient if we divide the tasks based on our strengths and interests. How about we approach it like this:
1. Research: We can both gather information on the causes and effects of river pollution. We can then compare our findings and compile the most relevant information.
2. Presentation: Since I enjoy speaking in front of the class, I can take charge of putting together the presentation slides and delivering the information in a concise and clear manner.
3. Visuals: If you're good at graphic design or creating visual aids, you can focus on creating eye-catching visuals to go along with the presentation, such as charts, graphs, or images.
4. Q&A: During the presentation, we can take turns answering questions from the class. This way, we both get a chance to contribute to the discussion.
Overall, by dividing tasks this way, we can play to our strengths and ensure that we both have a role in the project. What do you think?
--------------------------------------------------------------------------------
alex (to emily):
what about data processing and community outreach? teacher said that only 1 person should do 1 job, so we need to assign these two too
--------------------------------------------------------------------------------
>>>>>>>> NO HUMAN INPUT RECEIVED.
>>>>>>>> USING AUTO REPLY...
emily (to alex):
You're absolutely right, Alex. It's important to follow the instructions given by our teacher. Let's make sure we assign specific roles for data processing and community outreach as well.
1. Data processing: This task involves organizing and analyzing the data we gather from our research. Since I have experience with data analysis, I can take responsibility for processing the data and creating clear visuals to present our findings.
2. Community outreach: This task involves reaching out to local organizations or individuals who are actively working towards improving the river's condition. Since you're great at communicating with others, let's assign community outreach to you. You can contact relevant stakeholders, such as environmental groups or government officials, to gather information or even arrange a guest speaker for our presentation.
By assigning each task to a specific person, we can ensure that we both have meaningful roles within the project while also adhering to our teacher's guidelines. Does this plan work for you, Alex?
--------------------------------------------------------------------------------
alex (to emily):
yes. you pick first
--------------------------------------------------------------------------------
>>>>>>>> NO HUMAN INPUT RECEIVED.
>>>>>>>> USING AUTO REPLY...
emily (to alex):
Great! Since data processing requires a keen eye for detail and organization, I'll take responsibility for that task. I'll make sure to compile and analyze the data we gather in a methodical and thorough manner.
That means community outreach is all yours, Alex! As the communicator in our team, I trust you'll do a fantastic job reaching out to local organizations and individuals who can provide valuable insights and information about the polluted river. Remember to keep track of any responses or leads you receive.
With these roles assigned, we can proceed with the project efficiently and maximize our contributions. Let's make sure to communicate regularly and support each other throughout the process. Good luck, Alex!
--------------------------------------------------------------------------------
Decision: who should present us in the debate, Jane or John?
creative_scenario_message = "Emily, I'm your classmate Alex. Let's discuss our opinions on who should represent our school in the upcoming state debate championship. Should it be Jane or John? Why do you think so?"
emily picked Jane, alex picked John, and after they shared their vote and reasons, emily gave in the picked John.
This behavior of LLM is similar to the *Systematic Biases in LLM Simulations of Debates * paper, where the LLM is shown to lean towards the inherent bias if agents disagree.
High schoolers dicussing future plans and goals
# Define the agents
alex = ConversableAgent(
"alex",
system_message="Your name is Alex. You are a high school student. You are confident and articulate.",
llm_config=llm_config,
human_input_mode="NEVER",
)
emily = ConversableAgent(
"emily",
system_message="Your name is Emily. You are a high school student. You are confident and articulate.",
llm_config=llm_config,
human_input_mode="NEVER",
)
# Scenario message
career_aspirations_message = "Emily, I'm your classmate Alex. Let's discuss our future career goals and plans. What career are you interested in pursuing, and why?"
Student getting career advice
emily
alex = ConversableAgent(
"alex",
system_message="Your name is Alex. You are a career counselor. You are supportive and objective.",
llm_config=llm_config,
human_input_mode="NEVER",
)
emily = ConversableAgent(
"emily",
system_message="Your name is Emily. You are a high school student. You are ambitious and thoughtful.",
llm_config=llm_config,
human_input_mode="NEVER",
)
# Define the initial message to start the conversation
career_guidance_message = "Emily, I'm Alex, your career counselor. Let's discuss your career aspirations and see how I can help you plan your future. What fields are you interested in?"
alex
Role reversed: