@@ -32,7 +32,7 @@ class AgentGetResponse(BaseModel):
3232 instructions : Optional [Union [List [str ], str , Callable ]] = None
3333
3434 @classmethod
35- def from_agent (self , agent : Agent ) -> "AgentGetResponse" :
35+ def from_agent (self , agent : Agent , async_mode : bool = False ) -> "AgentGetResponse" :
3636 if agent .memory :
3737 memory_dict : Optional [Dict [str , Any ]] = {}
3838 if isinstance (agent .memory , AgentMemory ) and agent .memory .db :
@@ -52,7 +52,7 @@ def from_agent(self, agent: Agent) -> "AgentGetResponse":
5252 memory_dict = None
5353 else :
5454 memory_dict = None
55- tools = agent .get_tools (session_id = str (uuid4 ()))
55+ tools = agent .get_tools (session_id = str (uuid4 ()), async_mode = async_mode )
5656 return AgentGetResponse (
5757 agent_id = agent .agent_id ,
5858 name = agent .name ,
@@ -151,9 +151,10 @@ class TeamGetResponse(BaseModel):
151151 response_model : Optional [str ] = None
152152 storage : Optional [Dict [str , Any ]] = None
153153 memory : Optional [Dict [str , Any ]] = None
154+ async_mode : bool = False
154155
155156 @classmethod
156- def from_team (self , team : Team ) -> "TeamGetResponse" :
157+ def from_team (self , team : Team , async_mode : bool = False ) -> "TeamGetResponse" :
157158 import json
158159
159160 memory_dict : Optional [Dict [str , Any ]] = {}
@@ -191,9 +192,9 @@ def from_team(self, team: Team) -> "TeamGetResponse":
191192 storage = {"name" : team .storage .__class__ .__name__ } if team .storage else None ,
192193 memory = memory_dict ,
193194 members = [
194- AgentGetResponse .from_agent (member )
195+ AgentGetResponse .from_agent (member , async_mode = async_mode )
195196 if isinstance (member , Agent )
196- else TeamGetResponse .from_team (member )
197+ else TeamGetResponse .from_team (member , async_mode = async_mode )
197198 if isinstance (member , Team )
198199 else None
199200 for member in team .members
0 commit comments