diff --git a/examples/agent/deep_research_agent/deep_research_agent.py b/examples/agent/deep_research_agent/deep_research_agent.py index 9c19945e90..5d6285cf26 100644 --- a/examples/agent/deep_research_agent/deep_research_agent.py +++ b/examples/agent/deep_research_agent/deep_research_agent.py @@ -970,7 +970,7 @@ async def _summarizing(self) -> Msg: ensure_ascii=False, ), ) - self.memory.add(summarize_result) + await self.memory.add(summarize_result) return summarize_result async def reflect_failure(self) -> ToolResponse: diff --git a/src/agentscope/token/_openai_token_counter.py b/src/agentscope/token/_openai_token_counter.py index 8fcf4e6f7a..d0d989cd35 100644 --- a/src/agentscope/token/_openai_token_counter.py +++ b/src/agentscope/token/_openai_token_counter.py @@ -155,7 +155,7 @@ def _calculate_tokens_for_tools( for key in properties.keys(): func_token_count += prop_key p_name = key - p_type = properties[key]["type"] + p_type = properties[key].get("type", "") p_desc = ( properties[key].get("description", "").removesuffix(".") )