How do i modify the stt output before feeding it t...
# ask-ai
l
How do i modify the stt output before feeding it to the llm?
t
Thanks for reaching out, Computer. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! You’ve got a few ways to tweak the STT output before sending it over to the LLM. Here’s a quick rundown: 1. Override the STT Node: You can customize the
stt_node
method in your Agent class to clean up the transcribed text. For instance, you might want to remove filler words or add some domain-specific tweaks. 2. Use the Transcription Node: This lets you polish the transcription by fixing punctuation, cleaning up formatting, or swapping out certain words before moving forward. 3. Use the Before LLM Callback: Here, you can adjust the
ChatContext
(which includes the transcribed text) right before it’s sent to the LLM—great for shaping the conversation’s context. Honestly, overriding the
stt_node
is probably the most straightforward way since it lets you process the text right away. If you want, I’m happy to share some detailed examples or help you get it set up! Sources: pipeline-llm/replacing_llm_output.py | VoicePipelineAgent | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | Voice pipeline nodes | LiveKit Docs