livekit / agents

Build real-time multimodal AI applications 🤖🎙️📹
https://docs.livekit.io/agents
Apache License 2.0
1.08k stars 215 forks source link

before_llm_cb is not triggered for text messages from user #783

Open willsmanley opened 12 hours ago

willsmanley commented 12 hours ago

before_llm_cb is only called when there is an audio message from the user

If there is a text message, before_llm_cb is not called.

It seems like, for consistency purposes, this method should also be called for text messages.

theomonnom commented 9 hours ago

Hey, it is because the LLMStream is created manually when using the chat messages: See https://github.com/livekit/agents/blob/fe4471aa147346d4357c542b93917605c6700750/examples/voice-assistant/minimal_assistant.py#L63