First cut at sample 6 rewrite with pipelines

This commit is contained in:
Moishe Lettvin
2024-03-04 07:28:10 -05:00
parent 3b282cc921
commit 763a50f8ec
3 changed files with 30 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
import asyncio
import os
from dailyai.pipeline.pipeline import Pipeline
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.azure_ai_services import AzureLLMService, AzureTTSService
@@ -44,21 +45,19 @@ async def main(room_url: str, token):
tma_in = LLMUserContextAggregator(messages, transport._my_participant_id)
tma_out = LLMAssistantContextAggregator(messages, transport._my_participant_id)
await tts.run_to_queue(
transport.send_queue,
tma_out.run(
fl2.run(
llm.run(
tma_in.run(
fl.run(
transport.get_receive_frames()
)
)
)
)
)
)
pipeline = Pipeline(
source=transport.receive_queue,
sink=transport.send_queue,
processors=[
fl,
tma_in,
llm,
fl2,
tma_out,
tts
],
)
await pipeline.run_pipeline()
transport.transcription_settings["extra"]["endpointing"] = True
transport.transcription_settings["extra"]["punctuate"] = True