Build and run agents you can see, understand and trust.
Python agentchatbotlarge-language-modelsllmllm-agentmcpmulti-agentmulti-modalreact-agentrealtime-agentvoice-agentvoice-assistant
fix(pipeline): use `Sequence` for covariant type substitution in MsgHub (#909)
cccc51145a9e9b53
diff --git a/src/agentscope/pipeline/_msghub.py b/src/agentscope/pipeline/_msghub.pyindex 4dfb23433..d13ae1611 100644--- a/src/agentscope/pipeline/_msghub.py+++ b/src/agentscope/pipeline/_msghub.py@@ -1,11 +1,12 @@# -*- coding: utf-8 -*-"""MsgHub is designed to share messages among a group of agents."""++from collections.abc import Sequencefrom typing import Anyimport shortuuidfrom .._logging import logger-from ..agent import AgentBasefrom ..message import Msg@@ -40,7 +41,7 @@ class MsgHub:def __init__(self,- participants: list[AgentBase],+ participants: Sequence[AgentBase],announcement: list[Msg] | Msg | None = None,enable_auto_broadcast: bool = True,name: str | None = None,@@ -63,8 +64,9 @@ class MsgHub:The name of this MsgHub. If not provided, a random IDwill be generated."""+self.name = name or shortuuid.uuid()- self.participants = participants+ self.participants = list(participants)self.announcement = announcementself.enable_auto_broadcast = enable_auto_broadcast