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.58k stars 128 forks source link

Support custom agent #95

Closed wugren closed 7 months ago

wugren commented 7 months ago

Supports defining agents using python code The implementation process is as follows:

  1. Define the agent.py file in the agent directory
  2. Derive a class named Agent from CustomAIAgent, such as

    class Agent(CustomAIAgent):
    def __init__(self):
             super().__init__("test_agent", "gpt-4-1106-preview", 4096, 4096)
    
        async def _process_msg(self, msg: AgentMsg, workspace=None) -> AgentMsg:
                return msg.create_resp_msg("hello world!")