Imporve /open command: detetive target before open.

This commit is contained in:
Liu Zhicong
2023-10-03 18:52:10 -07:00
parent a92b3f15dc
commit 4f43c4abed
5 changed files with 25 additions and 7 deletions
@@ -48,6 +48,12 @@ class AgentManager:
pass
async def is_exist(self,agent_id:str) -> bool:
the_aget = await self.get(agent_id)
if the_aget:
return True
return False
async def get(self,agent_id:str) -> AIAgent:
the_agent = self.loaded_agent_instance.get(agent_id)
if the_agent:
@@ -57,7 +57,13 @@ class WorkflowManager:
if await self._load_workflow_agents(sub_workflow) is False:
return False
return True
async def is_exist(self,workflow_id:str) -> bool:
the_workflow = await self.get_workflow(workflow_id)
if the_workflow:
return True
return False
async def get_workflow(self,workflow_id:str) -> Workflow:
the_workflow : Workflow = self.loaded_workflow.get(workflow_id)
if the_workflow: