init
This commit is contained in:
commit
4c255ebd59
51 files changed
+3424
No files matched your search
@@ -0,0 +1,41 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
#------ 抽象 ASR, LLM, TTS 类 ------ #
|
||||
class ASR(ABC):
|
||||
@abstractmethod
|
||||
async def stream_recognize(self, chunk):
|
||||
pass
|
||||
|
||||
class LLM(ABC):
|
||||
@abstractmethod
|
||||
def chat(self, assistant, prompt, db):
|
||||
pass
|
||||
|
||||
class TTS(ABC):
|
||||
@abstractmethod
|
||||
def synthetize(self, assistant, text):
|
||||
pass
|
||||
# --------------------------------- #
|
||||
|
||||
|
||||
# ----------- 抽象服务类 ----------- #
|
||||
class UserAudioService(ABC):
|
||||
@abstractmethod
|
||||
def user_audio_process(self, audio:str, **kwargs) -> str:
|
||||
pass
|
||||
|
||||
class PromptService(ABC):
|
||||
@abstractmethod
|
||||
def prompt_process(self, prompt:str, **kwargs) -> str:
|
||||
pass
|
||||
|
||||
class LLMMsgService(ABC):
|
||||
@abstractmethod
|
||||
def llm_msg_process(self, llm_chunk:list, **kwargs) -> list:
|
||||
pass
|
||||
|
||||
class TTSAudioService(ABC):
|
||||
@abstractmethod
|
||||
def tts_audio_process(self, audio:bytes, **kwargs) -> bytes:
|
||||
pass
|
||||
# --------------------------------- #
|
||||
Reference in new issue
Block a user