Added better interruptability
This commit is contained in:
@@ -147,13 +147,17 @@ class TTSService(AIService):
|
||||
|
||||
if text:
|
||||
async for audio_chunk in self.run_tts(text):
|
||||
yield AudioQueueFrame(audio_chunk)
|
||||
print(f"audio chunk size: {len(audio_chunk)}")
|
||||
size = 8000
|
||||
for i in range(0, len(audio_chunk), size):
|
||||
print(f"i is {i}")
|
||||
yield AudioQueueFrame(audio_chunk[i : i+size])
|
||||
yield TTSCompletedFrame(text)
|
||||
|
||||
async def finalize(self):
|
||||
if self.current_sentence:
|
||||
async for audio_chunk in self.run_tts(self.current_sentence):
|
||||
yield AudioQueueFrame(audio_chunk)
|
||||
yield AudioQueueFrame(audio_chunk)
|
||||
|
||||
# Convenience function to send the audio for a sentence to the given queue
|
||||
async def say(self, sentence, queue: asyncio.Queue):
|
||||
|
||||
@@ -158,8 +158,9 @@ class BaseTransportService():
|
||||
break
|
||||
# elif not isinstance(frame, TranscriptionQueueFrame):
|
||||
# continue
|
||||
|
||||
if hasattr(frame, 'participantId') and frame.participantId == self._my_participant_id:
|
||||
# TODO-CB: Verify this is an accurate replacement
|
||||
# if hasattr(frame, 'participantId') and frame.participantId == self._my_participant_id:
|
||||
if not isinstance(frame, UserStoppedSpeakingFrame):
|
||||
continue
|
||||
|
||||
if current_response_task:
|
||||
|
||||
7
src/dailyai/services/groq_ai_services.py
Normal file
7
src/dailyai/services/groq_ai_services.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import aiohttp
|
||||
from dailyai.services.ai_services import LLMService
|
||||
|
||||
|
||||
class GroqLLMService(LLMService):
|
||||
def __init__(self, *, api_key, model="llama2-70b-4096"):
|
||||
pass
|
||||
Reference in New Issue
Block a user