|
|
|
|
@@ -32,12 +32,13 @@ from pipecat.pipeline.runner import PipelineRunner
|
|
|
|
|
from pipecat.pipeline.task import PipelineParams, PipelineTask
|
|
|
|
|
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
|
|
|
|
|
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
|
|
|
|
|
from pipecat.runner.types import RunnerArguments
|
|
|
|
|
from pipecat.runner.types import DailyRunnerArguments, RunnerArguments, SmallWebRTCRunnerArguments
|
|
|
|
|
from pipecat.services.cartesia.tts import CartesiaTTSService
|
|
|
|
|
from pipecat.services.deepgram.stt import DeepgramSTTService
|
|
|
|
|
from pipecat.services.openai.llm import OpenAILLMService
|
|
|
|
|
from pipecat.transports.base_transport import BaseTransport, TransportParams
|
|
|
|
|
from pipecat.transports.network.small_webrtc import SmallWebRTCTransport
|
|
|
|
|
from pipecat.transports.services.daily import DailyParams, DailyTransport
|
|
|
|
|
|
|
|
|
|
load_dotenv(override=True)
|
|
|
|
|
|
|
|
|
|
@@ -108,16 +109,33 @@ async def run_bot(transport: BaseTransport):
|
|
|
|
|
async def bot(runner_args: RunnerArguments):
|
|
|
|
|
"""Main bot entry point for the bot starter."""
|
|
|
|
|
|
|
|
|
|
transport = SmallWebRTCTransport(
|
|
|
|
|
params=TransportParams(
|
|
|
|
|
audio_in_enabled=True,
|
|
|
|
|
audio_out_enabled=True,
|
|
|
|
|
vad_analyzer=SileroVADAnalyzer(),
|
|
|
|
|
),
|
|
|
|
|
webrtc_connection=runner_args.webrtc_connection,
|
|
|
|
|
)
|
|
|
|
|
transport = None
|
|
|
|
|
|
|
|
|
|
await run_bot(transport)
|
|
|
|
|
if isinstance(runner_args, SmallWebRTCRunnerArguments):
|
|
|
|
|
transport = SmallWebRTCTransport(
|
|
|
|
|
params=TransportParams(
|
|
|
|
|
audio_in_enabled=True,
|
|
|
|
|
audio_out_enabled=True,
|
|
|
|
|
vad_analyzer=SileroVADAnalyzer(),
|
|
|
|
|
),
|
|
|
|
|
webrtc_connection=runner_args.webrtc_connection,
|
|
|
|
|
)
|
|
|
|
|
elif isinstance(runner_args, DailyRunnerArguments):
|
|
|
|
|
transport = DailyTransport(
|
|
|
|
|
runner_args.room_url,
|
|
|
|
|
runner_args.token,
|
|
|
|
|
"Pipecat Quickstart",
|
|
|
|
|
params=DailyParams(
|
|
|
|
|
audio_in_enabled=True,
|
|
|
|
|
audio_out_enabled=True,
|
|
|
|
|
vad_analyzer=SileroVADAnalyzer(),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
logger.warning("Unsupported transport")
|
|
|
|
|
|
|
|
|
|
if transport:
|
|
|
|
|
await run_bot(transport)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
|