Imporve /open command: detetive target before open.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user