fiatrete / OpenDAN-Personal-AI-OS

OpenDAN is an open source Personal AI OS , which consolidates various AI modules in one place for your personal use.
https://opendan.ai
MIT License
1.67k stars 137 forks source link

Workspace Environment #98

Closed waterflier closed 5 months ago

photosssa commented 10 months ago

I've read workspace enviroment codes, some questions:

  1. What's different between workspace's operation and enviroment's function; that says if I can splite work into operation list, and operation list will be executed with codes like:

    async def exec_op_list(self,oplist:List,agent_id:str)->tuple[List[str],bool]:
        result_str = "op list is none"
        if oplist is None:
            return None,False
    
        result_str = []
        have_error = False
        for op in oplist:
            if op["op"] == "create":
                await self.create(op["path"],op["content"])
            elif op["op"] == "write_file":
                is_append = op.get("is_append")
                if is_append is None:
                    is_append = False
                error_str = await self.write(op["path"],op["content"],is_append)
            elif op["op"] == "delete":
                error_str = await self.delete(op["path"])
            elif op["op"] == "rename":
                error_str = await self.rename(op["path"],op["new_name"])
            elif op["op"] == "mkdir":
                error_str = await self.mkdir(op["path"])

    it's totally same as what function call does: dumps function name and paramters into todo list,

  2. And more, who determines what operation a agent can do, if with enviroment's function list, enviroments defines what functions agent can call; but in workspace, it's hardcode in workspace implement, and i can't find how to make agent know what operations supported by workspace do.
waterflier commented 8 months ago

Thanks for your suggestions, this part of the new implementation has been basically completely refactored.

From the implement side, there is no need to distinguish between function and action. For the Agent, function means at least two LLMs, while action can be completed with one LLM in many scenarios.