Skip to content

Commit 441a607

Browse files
fix: added space to the agent (microsoft#13)
1 parent 51186ab commit 441a607

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/agents/group_chat_manager.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import logging
44
from datetime import datetime
5+
import re
56
from typing import Dict, List
67

78
from autogen_core.base import AgentId, MessageContext
@@ -239,14 +240,22 @@ async def _execute_step(self, session_id: str, step: Step):
239240
action=action_with_history,
240241
agent=step.agent,
241242
)
242-
logging.info(f"Sending ActionRequest to {step.agent.value.title()}")
243+
logging.info(f"Sending ActionRequest to {step.agent.value}")
244+
245+
if step.agent != "":
246+
agent_name = step.agent.value
247+
formatted_agent = re.sub(
248+
r"([a-z])([A-Z])", r"\1 \2", agent_name
249+
)
250+
else:
251+
raise ValueError(f"Check {step.agent} is missing")
243252

244253
await self._memory.add_item(
245254
AgentMessage(
246255
session_id=session_id,
247256
user_id=self._user_id,
248257
plan_id=step.plan_id,
249-
content=f"Requesting {step.agent.value.title()} to perform action: {step.action}",
258+
content=f"Requesting {formatted_agent} to perform action: {step.action}",
250259
source="GroupChatManager",
251260
step_id=step.id,
252261
)

0 commit comments

Comments
 (0)