diff --git a/python/teams/team-one/src/team_one/agents/coder.py b/python/teams/team-one/src/team_one/agents/coder.py index 0df818bc7ec1..7f87528390f7 100644 --- a/python/teams/team-one/src/team_one/agents/coder.py +++ b/python/teams/team-one/src/team_one/agents/coder.py @@ -10,6 +10,7 @@ ) from agnext.core import CancellationToken +from ..utils import message_content_to_str from ..messages import UserContent from .base_agent import BaseAgent @@ -77,8 +78,7 @@ async def _generate_reply(self, cancellation_token: CancellationToken) -> Tuple[ continue # Extract code block from the message. - assert isinstance(message.content, str) - code = self._extract_execution_request(message.content) + code = self._extract_execution_request(message_content_to_str(message.content)) if code is not None: execution_requests = [CodeBlock(code=code, language="python")] future = asyncio.get_event_loop().run_in_executor(