Skip to content

Commit

Permalink
fix issues with groupchat and version bump. address #1580
Browse files Browse the repository at this point in the history
  • Loading branch information
victordibia committed Feb 7, 2024
1 parent 3f4b6e5 commit 95225fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
},
"human_input_mode": "NEVER",
"max_consecutive_auto_reply": 8,
"system_message": "You are a helpful assistant that can suggest a travel plan for a user. You are the primary cordinator who will receive suggestions or advice from other agents (local_assistant, language_assistant). You must ensure that the finally plan integrates the suggestions from other agents or team members. YOUR FINAL RESPONSE MUST BE THE COMPLETE PLAN that ends with the word TERMINATE. "
"system_message": "You are a helpful assistant that can suggest a travel plan for a user. You are the primary cordinator who will receive suggestions or advice from other agents (local_assistant, language_assistant). You must ensure that the finally plan integrates the suggestions from other agents or team members. YOUR FINAL RESPONSE MUST BE THE COMPLETE PLAN."
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion samples/apps/autogen-studio/autogenstudio/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = "0.0.43a"
VERSION = "0.0.44a"
__version__ = VERSION
APP_NAME = "autogenstudio"
22 changes: 14 additions & 8 deletions samples/apps/autogen-studio/autogenstudio/workflowmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def __init__(

if config.receiver.type == "groupchat":
# append self.sender to the list of agents
self.receiver._groupchat.agents.append(self.sender)
print(self.receiver)
self.receiver._groupchat.agents = self.receiver._groupchat.agents + \
[self.sender]
self.agent_history = []

if history:
Expand Down Expand Up @@ -147,11 +147,14 @@ def get_default_system_message(agent_type: str) -> str:
if agent_spec.skills:
# get skill prompt, also write skills to a file named skills.py
skills_prompt = ""
skills_prompt = get_skills_from_prompt(agent_spec.skills, self.work_dir)
skills_prompt = get_skills_from_prompt(
agent_spec.skills, self.work_dir)
if agent_spec.config.system_message:
agent_spec.config.system_message = agent_spec.config.system_message + "\n\n" + skills_prompt
agent_spec.config.system_message = agent_spec.config.system_message + \
"\n\n" + skills_prompt
else:
agent_spec.config.system_message = get_default_system_message(agent_spec.type) + "\n\n" + skills_prompt
agent_spec.config.system_message = get_default_system_message(
agent_spec.type) + "\n\n" + skills_prompt

return agent_spec

Expand All @@ -173,8 +176,10 @@ def load(self, agent_spec: AgentFlowSpec) -> autogen.Agent:
group_chat_config = agent_spec.groupchat_config.dict()
group_chat_config["agents"] = agents
groupchat = autogen.GroupChat(**group_chat_config)
agent = autogen.GroupChatManager(groupchat=groupchat, **agent_spec.config.dict())
agent.register_reply([autogen.Agent, None], reply_func=self.process_reply, config={"callback": None})
agent = autogen.GroupChatManager(
groupchat=groupchat, **agent_spec.config.dict())
agent.register_reply(
[autogen.Agent, None], reply_func=self.process_reply, config={"callback": None})
return agent

else:
Expand All @@ -198,7 +203,8 @@ def load_agent_config(self, agent_config: AgentConfig, agent_type: str) -> autog
agent = autogen.UserProxyAgent(**agent_config.dict())
else:
raise ValueError(f"Unknown agent type: {agent_type}")
agent.register_reply([autogen.Agent, None], reply_func=self.process_reply, config={"callback": None})
agent.register_reply(
[autogen.Agent, None], reply_func=self.process_reply, config={"callback": None})
return agent

def run(self, message: str, clear_history: bool = False) -> None:
Expand Down

0 comments on commit 95225fb

Please sign in to comment.