base.py 560 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. """Base skill definitions for document chat."""
  3. from abc import ABC, abstractmethod
  4. from core.document_chat.schemas import DocumentChatSkillInput, DocumentChatSkillOutput
  5. class BaseDocumentChatSkill(ABC):
  6. def __init__(self, name: str, function_name: str):
  7. self.name = name
  8. self.function_name = function_name
  9. @abstractmethod
  10. async def run(self, skill_input: DocumentChatSkillInput) -> DocumentChatSkillOutput:
  11. """Run the skill and return a normalized output."""
  12. raise NotImplementedError