Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
moonbox3 committed Jan 27, 2025
1 parent 6ed00db commit 71e42f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/semantic_kernel/agents/group_chat/agent_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import asyncio
import logging
import threading
from collections.abc import AsyncGenerator, AsyncIterable
from collections.abc import AsyncIterable

from pydantic import Field, PrivateAttr

Expand Down Expand Up @@ -54,13 +54,13 @@ def invoke(self, agent: Agent | None = None, is_joining: bool = True) -> AsyncIt
"""Invoke the agent asynchronously."""
raise NotImplementedError("Subclasses should implement this method")

async def get_messages_in_descending_order(self) -> AsyncGenerator[ChatMessageContent, None]:
async def get_messages_in_descending_order(self) -> AsyncIterable[ChatMessageContent]:
"""Get messages in descending order asynchronously."""
for index in range(len(self.history.messages) - 1, -1, -1):
yield self.history.messages[index]
await asyncio.sleep(0) # Yield control to the event loop

async def get_chat_messages(self, agent: "Agent | None" = None) -> AsyncGenerator[ChatMessageContent, None]:
async def get_chat_messages(self, agent: "Agent | None" = None) -> AsyncIterable[ChatMessageContent]:
"""Get chat messages asynchronously."""
self.set_activity_or_throw()

Expand Down

0 comments on commit 71e42f0

Please sign in to comment.