# 03 No dead air

> Deepgram workshops › Build a voice agent › Mission 03
> Web version: https://workshops.deepgram.com/voice-agent/slow-tool-calls
> About 30 min (estimate). Check it: `make check 03` (offline, no key).

Trigger a slow tool call and it talks through the wait.

- [Hear the gap](https://workshops.deepgram.com/voice-agent/slow-tool-calls/hear-the-gap.md)
- [Fill it](https://workshops.deepgram.com/voice-agent/slow-tool-calls/fill-it.md)

## Hear the gap

### Trigger the slow one

**Goal:** Trigger a slow tool call and count the silence before the agent speaks.

A tool call is the agent asking your app to run a function, such as deleting a to-do item.

**Do:** Your agent keeps a to-do list, and delete is slow on purpose. Tap **Start the agent**, say "Delete milk," and count the silence.

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

_On the web page, this step shows the code panel with the matching code._

**You should see:** the agent go quiet for about three seconds, then confirm the delete. If no delete runs, say or type "Delete milk" and wait about three seconds before you tap **Check now**.

**Check:** The tool call finished.

### Note how long you waited

**Do:** Your before is the wait from your turn to its first words. Count it, or read it off the check, and keep it for the next page.

**You should see:** the first check quote how long the tool took, and your before. If you missed the gap, run the delete again with {{name.thinking}} off and count the silence, then tap **I did this**.

**Check:** You heard the gap with the switch off. (Optional.)

**How it works**

The list starts with buy milk, call the dentist, and book the flight home. It resets each time you start the agent. There are four functions, the same set as the [todo-voice-agent guide](https://workshops.deepgram.com/todo-voice-agent): add, list, complete, and delete. Delete waits three seconds, like a slow database. The other three answer at once.

A tool call has three parts, all in the console's event log. The agent asks (a function call request). Your browser runs the function. Then the browser sends the result back (a function call response). Between request and response, the agent has nothing to say until something gives it a reason.

The code panel shows both halves. The functions travel in Settings, and your handler answers each request.

Leave the prompt as it is and {{name.thinking}} off for this run. The first check reads the event log for the finished call. It quotes how long the tool took and your before.

## Fill it

### Try the prompt instead

**Goal:** Cover the three-second wait with a spoken line, on two deletes in a row.

**You need:** your before from the last lesson.

A prompt rule is a line in the prompt that tells the agent what to do. This one asks for a short line before the slow tool call.

**Do:** End the **Prompt** with this line, then tap **Reconnect and apply**:

> Before you call a tool, say one short line like "One second."

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

**You should see:** your new line at the end of the **Prompt** in the settings panel. If the agent seems unchanged, tap **Reconnect and apply** so it reads the new Prompt.

### Delete the dentist

**Do:** Say "Delete the dentist" and compare with your before.

**Listen for:** a line before the wait.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

**You should see:** the agent say a line before the wait. If it stays silent until the tool finishes, delete another item, because the check scans every call.

**Check:** It spoke before the tool answered.

### Hard mode: two covered deletes in a row

**Do:** **Hard mode.** Two deletes in one conversation, each covered within 2 seconds.

**You should see:** the check pass once every delete in the conversation has its first words within 2 seconds of your turn.

**Check:** Hard mode: two covered deletes in a row. (Optional.)

_On the web page, this step shows the code panel with the matching code._

### Run the same mission from your own code

Open the starter for your language: [Python](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/python/missions/03-no-dead-air/start.py) or [TypeScript](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/typescript/missions/03-no-dead-air/start.ts).

**What you tuned:** the three-second wait, now filled.

**You should see:** `make check 03` finish with no FAIL lines. If any remain, finish the TODOs and run it again.

**How it works**

A prompt rule works on any model. The check reads the event log for an agent line between the request and the response. It quotes the seconds from the end of your turn to its first words.

The rule lands some of the time, and that's the lesson. A prompt rule is a request, and a text model can drop it when the prompt gets long or the call gets busy. It writes the filler and the call in one pass, so "one second" can land late. If the check says not yet, delete another item.

**Hard mode:** no **Reconnect** between the two. If one goes silent, tighten the rule, tap **Reconnect and apply**, and start the pair again. The check counts them from the event log.

**With {{name.thinking}}.** The **Settings JSON** tab shows whether it's on here.

When it's on, take the prompt rule out and switch on **{{name.thinking}}** in Settings. Tap **Reconnect and apply**, and delete another item. A thinking model built for spoken turns knows a call is coming because it decided to make one. It tends to speak first, so compare the seconds with the prompt rule's.

**Three ways in code:** switch {{name.thinking}} on, inject a line from your code the moment the request arrives, or ask in the prompt. The injected line covers every call on any model. The [Cover the dead air challenge](https://workshops.deepgram.com/todo-voice-agent/challenges#dead-air) builds it. Whichever you pick, an assistant line between request and response is the proof.

The attendee project has the slow delete and the injected line as its TODOs. For a simpler starter, the [todo-voice-agent guide](https://workshops.deepgram.com/todo-voice-agent) builds the same four tools.

**In production**

- **Watch:** the seconds from the end of the caller's turn to the agent's first words, per tool call, and each tool's own run time. Log the time of every function call request and response next to the agent's first line.
- **Start with:** a covering line for any tool that usually takes longer than about a second, and a timeout on every tool, with a spoken answer when it fires.
- **Read:** the [Voice Agent docs](https://developers.deepgram.com/docs/voice-agent) on function calling and the agent's latency events.
