From 5f050396174cf33c70ed338fe569c39484db92b0 Mon Sep 17 00:00:00 2001 From: Eric Zhu Date: Sat, 9 Nov 2024 17:58:52 -0800 Subject: [PATCH] mypy --- .../user-guide/agentchat-user-guide/tutorial/agents.ipynb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/tutorial/agents.ipynb b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/tutorial/agents.ipynb index 592b8535c84a..5b14e0e72952 100644 --- a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/tutorial/agents.ipynb +++ b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/tutorial/agents.ipynb @@ -324,9 +324,7 @@ " def produced_message_types(self) -> List[type[ChatMessage]]:\n", " return [TextMessage]\n", "\n", - " async def on_messages(\n", - " self, messages: Sequence[ChatMessage], cancellation_token: CancellationToken\n", - " ) -> AgentMessage | Response:\n", + " async def on_messages(self, messages: Sequence[ChatMessage], cancellation_token: CancellationToken) -> Response:\n", " # Calls the on_messages_stream.\n", " response: Response | None = None\n", " async for message in self.on_messages_stream(messages, cancellation_token):\n", @@ -338,7 +336,7 @@ " async def on_messages_stream(\n", " self, messages: Sequence[ChatMessage], cancellation_token: CancellationToken\n", " ) -> AsyncGenerator[AgentMessage | Response, None]:\n", - " inner_messages = []\n", + " inner_messages: List[AgentMessage] = []\n", " for i in range(self._count, 0, -1):\n", " msg = TextMessage(content=f\"{i}...\", source=self.name)\n", " inner_messages.append(msg)\n",