Modify this code to add amazon supported stt model...
# ask-ai
b
Modify this code to add amazon supported stt models: assistant = VoiceAssistant( vad=silero.VAD.load(), stt=deepgram.stt.STT( model="nova-2", language="en-US", ), llm=openai.LLM(model=settings.OPENAI_MODEL), tts=openai.tts.TTS( model="gpt-4o-mini-tts", voice="alloy", ), chat_ctx=chat_context, turn_detector=turn_detector.EOUModel(), min_endpointing_delay=0.8, ) Also, list the dependencies required, which are compatible with these: ivekit==0.19.1 livekit-agents==0.12.11 livekit-api==0.8.1 livekit-plugins-deepgram==0.6.17 livekit-plugins-openai==0.10.14 livekit-plugins-silero==0.7.4 livekit-plugins-turn-detector==0.4.0 livekit-protocol==0.8.0 Avoid version conflicts or plugin incompatibilities. List any additional dependencies required for Amazon STT, ensuring they are compatible with the stack above.
t
Thanks for reaching out, Fatima. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To integrate Amazon Transcribe STT into your VoiceAssistant setup, you can modify your code as follows:
Copy code
from livekit.plugins import aws

assistant = VoiceAssistant(
    vad=silero.VAD.load(),
    stt=aws.STT(
        session_id="my-session-id",
        language="en-US",
        # Optional parameters
        # vocabulary_name="my-vocabulary",
        # vocab_filter_name="my-vocab-filter",
        # vocab_filter_method="mask",
    ),
    llm=openai.LLM(model=settings.OPENAI_MODEL),
    tts=openai.tts.TTS(
        model="gpt-4o-mini-tts",
        voice="alloy",
    ),
    chat_ctx=chat_context,
    turn_detector=turn_detector.EOUModel(),
    min_endpointing_delay=0.8,
)
Additional DependenciesTo ensure compatibility with your existing stack, install the following: •
aioboto3 (>=14.1.0)
amazon-transcribe (>=0.6.2)
livekit-agents[aws] (~=1.0)
AWS AuthenticationAdd your AWS credentials to your
.env
file:
Copy code
AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
AWS_REGION=your-aws-region
This setup ensures compatibility with the versions of LiveKit plugins and dependencies you provided. Let me know if you need further assistance! Sources: Amazon Transcribe STT integration guide | LiveKit Docs | AWS AI and LiveKit | LiveKit Docs | GitHub::livekit::agents | uv.lock
b
I cannot change existing dependency, make sure the requirements you suggest are compatible
t
Hey there! Thanks for helping me clarify things. Let me break down what I've found with the compatibility check: - The good news is that
aioboto3 (>=14.1.0)
and
amazon-transcribe (>=0.6.2)
play nicely with your current setup. - The tricky part is that the
livekit-agents[aws]
plugin needs
livekit-agents (>=1.1.2)
, which doesn't quite match your current version
livekit-agents==0.12.11
. Right now, adding Amazon STT directly would be a bit challenging without changing things up. But no worries! If you're open to upgrading
livekit-agents
to a compatible version, I'd be super happy to walk you through the process. What sounds good to you? I'm here to help make this smooth and easy! 😊 Sources: GitHub::livekit::agents | uv.lock