input/output -> receive/send queues, for transport service

This commit is contained in:
Moishe Lettvin
2024-01-16 21:11:38 -05:00
parent 755059c358
commit 115b744861
3 changed files with 22 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ async def main(room_url):
llm_to_tts_queue = asyncio.Queue()
tts = ElevenLabsTTSService(
llm_to_tts_queue, transport.get_async_output_queue(), voice_id="29vD33N1CtxCmqQRPOHJ"
llm_to_tts_queue, transport.get_async_send_queue(), voice_id="29vD33N1CtxCmqQRPOHJ"
)
llm = AzureLLMService(text_to_llm_queue, llm_to_tts_queue)

View File

@@ -32,7 +32,7 @@ async def main(room_url:str, token):
]
sentence = ""
async for frame in transport.get_media_frames():
async for frame in transport.get_receive_frames():
if frame.frame_type != FrameType.TRANSCRIPTION:
continue
@@ -50,7 +50,7 @@ async def main(room_url:str, token):
async for response in llm.run_llm_async_sentences(messages):
full_response += response
async for audio in tts.run_tts(response):
await transport.output_queue.put(QueueFrame(FrameType.AUDIO, audio))
await transport.send_queue.put(QueueFrame(FrameType.AUDIO, audio))
messages.append({"role": "assistant", "content": full_response})