how do i reduce the time for a DTMF tool call to b...
# ask-ai
c
how do i reduce the time for a DTMF tool call to be called? it looks like the tool is taking over 5 seconds to call?
t
Thanks for reaching out, Faraz. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to reduce the ~5s delay before a DTMF tool is invoked — thanks, that’s clear. Short answer: reduce the DTMF input timeout and/or handle DTMF events immediately instead of waiting for the input timeout. What to change • Reduce
dtmf_input_timeout
in the
GetDtmfTask
(default ~4.0s). Example:
Copy code
result = await GetDtmfTask(
  num_digits=4,
  dtmf_input_timeout=2.0,
  chat_ctx=self.chat_ctx
)
• If your flow accepts single-digit choices, process the digit as soon as it arrives in your DTMF event handler instead of waiting for a stop digit or timeout:
Copy code
@room.on("sip_dtmf_received")
def on_dtmf_received(dtmf: rtc.SipDTMF):
    handle_menu_selection(dtmf.digit)
• Check any other agent timeouts like
inter_digit_timeout
/
dtmf_timeout
and lower them if configured. If you share which task/config you’re using and whether you need multi-digit input or single-key menus, I’ll suggest the exact timeout values and code changes. Sources: Handling DTMF | LiveKit docs | Tasks and task groups | LiveKit docs
c
how do i decrease the amount of thinking time for my agent to make a decision on which tool to call? i have 5 tools
t
You're asking how to shorten the agent's "thinking time" when choosing among five tools — thanks, that's clear. Quick, actionable steps you can take now • Set tool_choice to "required" when a tool call is expected to skip the "should I call a tool?" step. • Only register the subset of tools relevant to the current context (pass fewer tools into the AgentSession). • Use a faster LLM (smaller / low-latency model) to reduce model inference time. • Add explicit tool descriptions and preconditions so the model can choose faster. • Consider a lightweight router tool that quickly dispatches to the correct tool via simple logic (string matching/heuristics) instead of the LLM. • Enable preemptive_generation to hide latency by starting generation from partial input (if using non-realtime LLM). • Use Agent Insights / trace view to measure where time is spent (LLM vs routing vs tool execution). To give precise recommendations, please tell me: 1. Which LLM provider and model are you using? 2. Are you using Realtime API or standard LLM calls? 3. Are all 5 tools always registered, or can some be disabled for certain contexts? 4. Share a short example of your tool descriptions or the decision-related prompt (a few lines). Tell me those details and I’ll recommend exact config changes and timeout/model choices. Sources: Together AI LLM plugin guide | LiveKit Docs | xAI LLM plugin guide | LiveKit Docs | OpenAI LLM plugin guide | LiveKit Docs | Groq LLM plugin guide | LiveKit Docs | External data and RAG | LiveKit Docs