bstraehle commited on
Commit
d56f6b1
1 Parent(s): dd9a7ec

Update multi_agent.py

Browse files
Files changed (1) hide show
  1. multi_agent.py +17 -25
multi_agent.py CHANGED
@@ -22,7 +22,7 @@ def run_multi_agent(llm, task):
22
  "After each step is done by others, check the progress and "
23
  "instruct the remaining steps. If a step fails, try to "
24
  "workaround",
25
- description="Given a task, determine what "
26
  "information is needed to complete the task. "
27
  "After each step is done by others, check the progress and "
28
  "instruct the remaining steps",
@@ -32,25 +32,13 @@ def run_multi_agent(llm, task):
32
  engineer = autogen.AssistantAgent(
33
  name="Engineer",
34
  llm_config=llm_config,
35
- description="Write code based on the plan "
36
  "provided by the planner.",
37
  )
38
 
39
- writer = autogen.ConversableAgent(
40
- name="Writer",
41
- llm_config=llm_config,
42
- system_message="Writer. "
43
- "Please write blogs in markdown format (with relevant titles)"
44
- " and put the content in pseudo ```md``` code block. "
45
- "You take feedback from the admin and refine your blog.",
46
- description="After all the info is available, "
47
- "write blogs based on the code execution results and take "
48
- "feedback from the admin to refine the blog. ",
49
- )
50
-
51
  executor = autogen.ConversableAgent(
52
  name="Executor",
53
- description="Execute the code written by the "
54
  "engineer and report the result.",
55
  human_input_mode="NEVER",
56
  code_execution_config={
@@ -59,19 +47,23 @@ def run_multi_agent(llm, task):
59
  "use_docker": False,
60
  },
61
  )
62
-
 
 
 
 
 
 
 
 
 
 
 
 
63
  groupchat = autogen.GroupChat(
64
  agents=[user_proxy, engineer, writer, executor, planner],
65
  messages=[],
66
- max_round=50,
67
- allowed_or_disallowed_speaker_transitions={
68
- user_proxy: [engineer, writer, executor, planner],
69
- engineer: [user_proxy, executor],
70
- writer: [user_proxy, planner],
71
- executor: [user_proxy, engineer, planner],
72
- planner: [user_proxy, engineer, writer],
73
- },
74
- speaker_transitions_type="allowed",
75
  )
76
 
77
  manager = autogen.GroupChatManager(
 
22
  "After each step is done by others, check the progress and "
23
  "instruct the remaining steps. If a step fails, try to "
24
  "workaround",
25
+ description="Planner. Given a task, determine what "
26
  "information is needed to complete the task. "
27
  "After each step is done by others, check the progress and "
28
  "instruct the remaining steps",
 
32
  engineer = autogen.AssistantAgent(
33
  name="Engineer",
34
  llm_config=llm_config,
35
+ description="An engineer that writes code based on the plan "
36
  "provided by the planner.",
37
  )
38
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  executor = autogen.ConversableAgent(
40
  name="Executor",
41
+ system_message="Execute the code written by the "
42
  "engineer and report the result.",
43
  human_input_mode="NEVER",
44
  code_execution_config={
 
47
  "use_docker": False,
48
  },
49
  )
50
+
51
+ writer = autogen.ConversableAgent(
52
+ name="Writer",
53
+ llm_config=llm_config,
54
+ system_message="Writer."
55
+ "Please write blogs in markdown format (with relevant titles)"
56
+ " and put the content in pseudo ```md``` code block. "
57
+ "You take feedback from the admin and refine your blog.",
58
+ description="Writer."
59
+ "Write blogs based on the code execution results and take "
60
+ "feedback from the admin to refine the blog."
61
+ )
62
+
63
  groupchat = autogen.GroupChat(
64
  agents=[user_proxy, engineer, writer, executor, planner],
65
  messages=[],
66
+ max_round=25,
 
 
 
 
 
 
 
 
67
  )
68
 
69
  manager = autogen.GroupChatManager(