diff --git a/doc/QuickStart zh-CN.md b/doc/QuickStart zh-CN.md index 326229e..ceddc63 100644 --- a/doc/QuickStart zh-CN.md +++ b/doc/QuickStart zh-CN.md @@ -1,4 +1,5 @@ # OpenDAN Quick Start + OpenDAN (Open and Do Anything Now with AI) is revolutionizing the AI landscape with its Personal AI Operating System. Designed for seamless integration of diverse AI modules, it ensures unmatched interoperability. OpenDAN empowers users to craft powerful AI agents—from butlers and assistants to personal tutors and digital companions—all while retaining control. These agents can team up to tackle complex challenges, integrate with existing services, and command smart(IoT) devices. With OpenDAN, we're putting AI in your hands, making life simpler and smarter. diff --git a/src/aios_kernel/workflow_env.py b/src/aios_kernel/workflow_env.py index c62fc45..9e0e85c 100644 --- a/src/aios_kernel/workflow_env.py +++ b/src/aios_kernel/workflow_env.py @@ -39,11 +39,6 @@ class CalenderEnvironment(Environment): self.add_ai_function(SimpleAIFunction("get_time", "get current time", self._get_now)) - - #self.add_ai_function(SimpleAIFunction("serach_events", - # "search events in calender", - # self._search_events)) - get_param = { "start_time": "start time (UTC) of event", "end_time": "end time (UTC) of event" diff --git a/src/component/agent_manager/agent_manager.py b/src/component/agent_manager/agent_manager.py index 083b680..06ed62c 100644 --- a/src/component/agent_manager/agent_manager.py +++ b/src/component/agent_manager/agent_manager.py @@ -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: diff --git a/src/component/workflow_manager/workflow_manager.py b/src/component/workflow_manager/workflow_manager.py index ee5ef9e..28bd523 100644 --- a/src/component/workflow_manager/workflow_manager.py +++ b/src/component/workflow_manager/workflow_manager.py @@ -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: diff --git a/src/service/aios_shell/aios_shell.py b/src/service/aios_shell/aios_shell.py index b10ac84..43441b4 100644 --- a/src/service/aios_shell/aios_shell.py +++ b/src/service/aios_shell/aios_shell.py @@ -233,7 +233,7 @@ class AIOS_Shell: match tunnel_type: case "telegram": tunnel_config["type"] = "TelegramTunnel" - input_table["token"] = UserConfigItem("telegram bot token") + input_table["token"] = UserConfigItem("telegram bot token\n You can get it from https://t.me/BotFather ,read https://core.telegram.org/bots#how-do-i-create-a-bot for more details") input_table["allow"] = UserConfigItem("allow group (default is member,you can choose contact or guest)") case "email": tunnel_config["type"] = "EmailTunnel" @@ -491,6 +491,16 @@ class AIOS_Shell: else: topic = "default" + target_exist = False + if await AgentManager.get_instance().is_exist(target_id): + target_exist = True + if await WorkflowManager.get_instance().is_exist(target_id): + target_exist = True + + if target_exist is False: + show_text = FormattedText([("class:error", f"Target {target_id} not exist!")]) + return show_text + self.current_target = target_id self.current_topic = topic show_text = FormattedText([("class:title", f"current session switch to {topic}@{target_id}")])