add banbanmini backend
This commit is contained in:
0
talkingq-url/interfaces/__init__.py
Normal file
0
talkingq-url/interfaces/__init__.py
Normal file
27
talkingq-url/interfaces/asr.py
Normal file
27
talkingq-url/interfaces/asr.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
class ASR(ABC):
|
||||
@abstractmethod
|
||||
async def connect(self):
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def send_audio(self, audio_data: bytes):
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def send_end(self):
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def receive_results(self):
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def close(self):
|
||||
|
||||
pass
|
||||
19
talkingq-url/interfaces/llm.py
Normal file
19
talkingq-url/interfaces/llm.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List, Dict, AsyncGenerator
|
||||
|
||||
|
||||
class LLM(ABC):
|
||||
@abstractmethod
|
||||
async def generate_response_stream(
|
||||
self, transcript: str, history: List[Dict[str, str]], selected_role: dict
|
||||
) -> AsyncGenerator[str, None]:
|
||||
|
||||
pass
|
||||
|
||||
async def close(self):
|
||||
|
||||
pass
|
||||
|
||||
async def connect(self):
|
||||
|
||||
pass
|
||||
27
talkingq-url/interfaces/tts.py
Normal file
27
talkingq-url/interfaces/tts.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional, List, Any
|
||||
|
||||
|
||||
class TTS(ABC):
|
||||
@abstractmethod
|
||||
async def tts(
|
||||
self,
|
||||
text: str,
|
||||
output_file_prefix: Optional[str] = None,
|
||||
tts_format: str = "mp3",
|
||||
selected_role: dict = None,
|
||||
session: Optional[Any] = None,
|
||||
language: str = None,
|
||||
) -> Optional[List[str]]:
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def connect(self):
|
||||
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def close(self):
|
||||
|
||||
pass
|
||||
Reference in New Issue
Block a user