Overview
WaitReassuranceLLMExtension keeps a conversation from going silent while the user waits on background work: an asynchronous function call (cancel_on_interruption=False), or work delegated to an LLMWithBackend backend. Once nothing has been said for interval_secs with work in flight, the LLM says one short sentence in its own words, shaped by what the user asked for, or answers with a silent mark to say nothing.
The extension belongs on a text LLM. A speech-to-speech service’s audio carries no mark to read.
How It Works
- At start, the extension sets the user aggregator’s waiting timeout to
interval_secs. - It adds
instructionto the LLM’s system instruction. - When the conversation has been quiet for
interval_secswith background work in progress, it appendspromptto the conversation as a developer message and runs the LLM. - If the reply opens with
silent_mark, the reply is dropped before the TTS or any observer sees it, and nothing is recorded in the context. The decision is broadcast as anLLMMarkerResponseFramewithkind="silent", and the user aggregator starts the interval over. - Otherwise the bot speaks the reply, which starts the interval over through the bot’s speech.
bot-llm-marker, and a scripted eval asserts it with event: llm_marker and marker: silent.
To answer the wait another way, such as a canned phrase or music, use the user aggregator’s user_waiting_timeout and on_user_waiting event instead.
Configuration
Seconds the conversation stays quiet, with background work in progress, before
the LLM is asked whether to say something.
Standing guidance added to the LLM’s system instruction. A template with
{mark} for the silent mark, so any other brace in it is doubled.The developer message appended each time the user has waited. A template with
{quiet_secs} for how long nothing has been said, and optionally {mark}.
The default opens with “The user is waiting on background work you started on
their behalf”, which is how instruction refers to it.Usage
Pass the extension in the LLM service’s settings:Notes
- A change in the wording of
instructionorpromptcan change what the model says, or whether it stays silent. Check the result with a scripted eval after changing either. - Judge a reassurance in a scripted eval with
allow_continue: falseon the expectation, so the judge treats the reply as final.