From 5b036b3292e2d3acf08b85a45c8f300072e362ff Mon Sep 17 00:00:00 2001 From: qbc Date: Thu, 25 Apr 2024 19:15:00 +0800 Subject: [PATCH] change name of decorator, change type of glb_doing_signal_dict --- src/agentscope/agents/agent.py | 2 +- src/agentscope/agents/user_agent.py | 2 +- src/agentscope/web/studio/studio.py | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/agentscope/agents/agent.py b/src/agentscope/agents/agent.py index 00c5d9a88..e18956304 100644 --- a/src/agentscope/agents/agent.py +++ b/src/agentscope/agents/agent.py @@ -71,7 +71,7 @@ def __call__(cls, *args: tuple, **kwargs: dict) -> Any: return instance def __new__(mcs, name: Any, bases: Any, attrs: Any) -> Any: - if "reply" in attrs and not attrs.get("_skip_decorator", False): + if "reply" in attrs and not attrs.get("_skip_reply_decorator", False): original_reply = attrs["reply"] attrs["reply"] = pre_reply_decorator(original_reply) return super().__new__(mcs, name, bases, attrs) diff --git a/src/agentscope/agents/user_agent.py b/src/agentscope/agents/user_agent.py index ca0b281e4..be8725d9c 100644 --- a/src/agentscope/agents/user_agent.py +++ b/src/agentscope/agents/user_agent.py @@ -30,7 +30,7 @@ def __init__(self, name: str = "User", require_url: bool = False) -> None: self.name = name self.require_url = require_url - _skip_decorator = True + _skip_reply_decorator = True def reply( self, diff --git a/src/agentscope/web/studio/studio.py b/src/agentscope/web/studio/studio.py index 880fb517f..26e81acc9 100644 --- a/src/agentscope/web/studio/studio.py +++ b/src/agentscope/web/studio/studio.py @@ -43,13 +43,8 @@ def init_uid_list() -> list: return [] -def init_uid_dict() -> dict: - """Initialize an empty dict for storing user IDs.""" - return {} - - glb_history_dict = defaultdict(init_uid_list) -glb_doing_signal_dict = defaultdict(init_uid_dict) +glb_doing_signal_dict = defaultdict(init_uid_list) glb_signed_user = []