[WIP] AWS Nova Sonic service

This commit is contained in:
Paul Kompfner
2025-04-24 13:55:09 -04:00
parent d789334a60
commit 13569a5a5a
2 changed files with 71 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import os
from dotenv import load_dotenv
from loguru import logger
# import logging
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.audio.vad.vad_analyzer import VADParams
from pipecat.frames.frames import LLMMessagesAppendFrame
@@ -23,6 +24,11 @@ from pipecat.transports.network.webrtc_connection import SmallWebRTCConnection
# Load environment variables
load_dotenv(override=True)
# logging.basicConfig(
# level=logging.DEBUG,
# format='%(asctime)s - %(levelname)s - %(message)s'
# )
async def run_bot(webrtc_connection: SmallWebRTCConnection):
logger.info(f"Starting bot")
@@ -51,9 +57,11 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection):
# Respond to what the user said in a creative and helpful way.
# """
# TODO: looks like Nova Sonic can't handle new lines?
system_instruction = "You are a friendly assistant. The user and you will engage in a spoken dialog " \
"exchanging the transcripts of a natural real-time conversation. Keep your responses short, " \
"generally two or three sentences for chatty scenarios."
system_instruction = (
"You are a friendly assistant. The user and you will engage in a spoken dialog "
"exchanging the transcripts of a natural real-time conversation. Keep your responses short, "
"generally two or three sentences for chatty scenarios."
)
llm = AWSNovaSonicService(
instruction=system_instruction,