How to commit user turn without generating a response?

When using a cascaded approach (STT –> LLM –> TTS) and manual turn taking like Turns overview | LiveKit Documentation .

I would like to simply commit the current user turn (i.e. flush the STT transcript etc. to local context) but not trigger a response.

It seems session.commit_user_turn() generates a reply by default and I cannot see an idiomatic way to do all the boilerplate of commiting a user turn without a response - is there one? If not, I’d like to make a feature request for that.

e.g. maybe an argument session.commit_user_turn(request_agent_response=False) which defaults to True.

Thanks for any assistance!

If you want to flush STT/transcript state into your local context without generating a reply, you need to bypass commit_user_turn() and manage that state yourself (e.g., by consuming transcripts via events or pipeline hooks and updating your own context store).

My goal would be to update the livekit local context in the normal way (so that all the livekit features work naturally, like conversation added event hooks, clearing the STT and transcript buffer etc.) - the only thing I do not need is to pass this to the LLM to get a response.

If you want to flush STT/transcript state into your local context without generating a reply, you need to bypass commit_user_turn() and manage that state yourself (e.g., by consuming transcripts via events or pipeline hooks and updating your own context store).

I could consume the transcript creation event and manually add it to the local context maybe like

@self._session.on("user_input_transcribed")
...

        agent = session.current_agent
        agent._chat_ctx.items.append(chat_msg)
        session._conversation_item_added(chat_msg)

But how best I grab “flush” the STT to get the latest available transcript as input - I believe that is what commit_user_turn() does but we do not need the automatic-response-generation that comes with it.

To give a little more context, we have a situation in manual turn taking where we need to force the user to give up their turn and get the agent to “say” something specific - so in this case, we do not want to trigger the agent to say anything because we already have triggered it elsewhere to say something, but we do wish to commit the currently pending transcript/STT buffer to local context.

Another idea would be to do

  1. commit_user_turn()
  2. session.interupt()
  3. generate agent speech

But as it says here Search | DeepWiki I think that would not be bulletproof either as its possible to interrupt before the LLM request starts making the interrupt a no-op.

I will bring this up with the team

@CWilson thanks for your help on this, did you get a chance to get any feedback from the team? Maybe I should make a “Feature request” issue

I think a feature request (or PR) would be greate. That is essentially what I did internally but I think have something externally trackable would be helpful.