ian
12/17/2025, 1:42 AMdata: {"id": ...} chunks being streamed through fine.
However, on the voice side, VAPI just queues all of the chunks up and speaks them together. Which sorta ruins the point of the waiting message.
How do you get VAPI to speak at designated chunks rather than wait for the entire stream to finish?
Conversely, I've tried using the controlClient to say a response when the tool starts, but VAPI breaks the connection when this happens.Vapi Support Bot
12/17/2025, 1:43 AMjs
// Stream interim message
res.write('data: {"id":"stream_1","path":"chat.output[0].content","delta":"Hang on let me check that for you."}\n\n');
// End interim message so VAPI speaks it
res.write('data: [DONE]\n\n');
// Now trigger the tool call event
// ...send tool call payload...
This ensures VAPI speaks the interim message immediately, then waits for the tool call result before continuing. See the [Custom LLM Tool Calling Integration documentation](https://docs.vapi.ai/customization/tool-calling-integration) for more details.
Source:
- [Custom LLM Tool Calling Integration documentation](https://docs.vapi.ai/customization/tool-calling-integration)ian
12/17/2025, 1:45 AMVapi Support Bot
12/17/2025, 1:46 AMdata: [DONE] twice—once after the interim message and again after the final response. This signals Vapi to speak each message segment immediately. Here’s a concrete example:
js
// 1. Stream interim message
res.write('data: {"id":"stream_1","path":"chat.output[0].content","delta":"Hang on let me check that for you."}\n\n');
res.write('data: [DONE]\n\n'); // Ends interim message
// 2. After tool call, stream final response
res.write('data: {"id":"stream_2","path":"chat.output[0].content","delta":"Here is the result of your request."}\n\n');
res.write('data: [DONE]\n\n'); // Ends final message
This ensures Vapi speaks each part at the right time.
Reference: [Custom LLM Tool Calling Integration documentation](https://docs.vapi.ai/customization/tool-calling-integration)
Source:
- [Custom LLM Tool Calling Integration documentation](https://docs.vapi.ai/customization/tool-calling-integration)ian
12/17/2025, 1:47 AMVapi Support Bot
12/17/2025, 1:47 AMian
12/17/2025, 2:30 AMVapi Support Bot
12/17/2025, 2:32 AMdata: [DONE] after each message), but only the first part is spoken—this is not addressed in the official documentation. Since the expected approach isn't working, I recommend reaching out to [Vapi Support](https://docs.vapi.ai/support) with your implementation details and logs for further troubleshooting. There may be an internal issue or undocumented limitation affecting your use case.
Source:
- [Custom LLM Tool Calling Integration documentation](https://docs.vapi.ai/customization/tool-calling-integration)Chiranjeet Mishra
12/19/2025, 12:19 AMpath fields or multiple [DONE] markers.
What’s going wrong
- After the first data: [DONE], VAPI considers the entire LLM response fully completed and closes the stream.
- Because of this, you cannot send multiple [DONE] messages in a single Custom LLM request.
- This is why only the first spoken segment is heard — everything after the first [DONE] is ignored.
Recommendation:
Use the <flush /> tag in a single stream
This is the supported and reliable way to force VAPI to speak interim content immediately without ending the stream.
Example (standard OpenAI streaming format):
js
// Interim message — spoken immediately
res.write(
'data: {"choices":[{"delta":{"content":"Hang on, let me check that for you.<flush />"}}]}\n\n'
);
// Tool call
res.write(
'data: {"choices":[{"delta":{"tool_calls":[{"id":"call_123","type":"function","function":{"name":"search","arguments":"{}"}}]}}]}\n\n'
);
// Final spoken response
res.write(
'data: {"choices":[{"delta":{"content":"Here is the result of your request."}}]}\n\n'
);
// End the stream ONCE
res.write('data: [DONE]\n\n');
Key takeaways
- Use standard OpenAI streaming JSON (choices[].delta)
- Do not send multiple [DONE] events
- Use <flush /> to control when VAPI speaks
- End the stream exactly once
This should resolve the issue where only the first chunk is spoken.ian
12/19/2025, 3:19 PMian
12/19/2025, 3:38 PM