in livekit-agents version 1.2 there is two functio...
# ask-ai
p
in livekit-agents version 1.2 there is two functions, on_user_turn_completed and llm_node is there a similar functions to it on version 0.12 is it in different naming or something?
t
Thanks for reaching out, Yasser. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just a quick heads-up: the functions
on_user_turn_completed
and
llm_node
aren’t available in livekit-agents version 0.12. These handy features came along with the big update in version 1.0. Here’s the scoop: •
llm_node
is the new kid on the block, replacing the older
before_llm_cb
callback from the 0.x versions. •
on_user_turn_completed
is brand new in version 1.0, so it wasn’t around in 0.12. If you’re still on version 0.12, you’ll want to stick with the old
before_llm_cb
pattern since
llm_node
isn’t there yet. Also, there’s no counterpart for
on_user_turn_completed
in that version. To enjoy these newer features, upgrading to livekit-agents version 1.0 or later is the way to go! Sources: Pipeline nodes and hooks | LiveKit Docs | Agents v0.x migration guide | LiveKit Docs
p
before llm cb is the same as llm_node in functionality or there is something different between them
t
Hey there! Just wanted to share a quick comparison between
before_llm_cb
and `llm_node`—they both help tweak the chat context or customize how the LLM behaves before running inference. But there are some neat differences worth knowing: •
before_llm_cb
in version 0.x was mainly used to adjust the conversation context, like trimming it down to save on token usage. •
llm_node
, which came along in version 1.0, is a more powerful and flexible tool. It not only lets you modify the chat context but also works smoothly with custom LLM providers without needing a plugin, as long as it returns an
AsyncIterable[llm.ChatChunk]
. So, in a nutshell,
llm_node
brings more features and flexibility to the table compared to
before_llm_cb
. Hope this helps clear things up! Sources: VoicePipelineAgent | LiveKit Docs | VoicePipelineAgent | LiveKit Docs | Agents 0.x migration guide | LiveKit Docs | Agents v0.x migration guide | LiveKit Docs | VoicePipelineAgent | LiveKit Docs