Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions livekit-agents/livekit/agents/beta/tools/send_dtmf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio

from ... import function_tool
from ... import StopResponse, function_tool
from ...job import get_job_context
from ..workflows.utils import DtmfEvent, dtmf_event_to_code

Expand All @@ -14,6 +14,9 @@ async def send_dtmf_events(
"""
Send a list of DTMF events to the telephony provider.

After successfully sending all events, yields the turn back to the remote
party (IVR or caller) so the agent waits silently for the next prompt.

Call when:
- User wants to send DTMF events
"""
Expand All @@ -27,4 +30,4 @@ async def send_dtmf_events(
except Exception as e:
return f"Failed to send DTMF event: {event.value}. Error: {str(e)}"

return f"Successfully sent DTMF events: {', '.join(events)}"
raise StopResponse()
Loading