agentBase.py 417 B

12345678910111213141516
  1. # -*- coding: utf-8 -*-
  2. from uuid import uuid4
  3. from abc import abstractmethod
  4. from digitalHuman.protocol import BaseMessage
  5. from digitalHuman.core import BaseRunner
  6. __all__ = ["BaseAgent"]
  7. class BaseAgent(BaseRunner):
  8. async def createConversation(self, **kwargs) -> str:
  9. return str(uuid4())
  10. @abstractmethod
  11. async def run(self, input: BaseMessage, **kwargs):
  12. raise NotImplementedError