You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/customization/custom-transcriber.mdx
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,22 @@ You'll learn how to:
43
43
Your server forwards the audio to Deepgram (or your chosen transcriber) using its SDK. Deepgram processes the audio and returns transcript events that include a `channel_index` (e.g. `[0, ...]` for customer, `[1, ...]` for assistant). The service buffers the incoming data, processes the transcript events (with debouncing and channel detection), and emits a final transcript.
44
44
</Step>
45
45
<Steptitle="Response">
46
-
The final transcript is sent back to Vapi as a JSON message:
46
+
The transcript is sent back to Vapi as a JSON message:
47
47
```json
48
48
{
49
49
"type": "transcriber-response",
50
50
"transcription": "The transcribed text",
51
-
"channel": "customer"// or "assistant"
51
+
"channel": "customer",
52
+
"transcriptType": "final"
52
53
}
53
54
```
55
+
56
+
The optional `transcriptType` field controls how Vapi handles the transcript:
57
+
58
+
-**`"final"`** (default) — the transcription is definitive.
59
+
-**`"partial"`** — the transcription is provisional and may be superseded by a later message. Each partial replaces the previous one until a `"final"` arrives.
60
+
61
+
If omitted, `transcriptType` defaults to `"final"` for backward compatibility.
54
62
</Step>
55
63
</Steps>
56
64
@@ -362,6 +370,7 @@ You'll learn how to:
362
370
type: "transcriber-response",
363
371
transcription: text,
364
372
channel,
373
+
transcriptType: "final",
365
374
};
366
375
ws.send(JSON.stringify(response));
367
376
logger.logDetailed("INFO", "Sent transcription to client", "Server", {
@@ -423,12 +432,13 @@ You'll learn how to:
423
432
- The `"start"` message initializes the Deepgram session.
424
433
- PCM audio data is forwarded to Deepgram.
425
434
- Deepgram returns transcript events, which are processed with channel detection and debouncing.
426
-
- The final transcript is sent back as a JSON message:
435
+
- The transcript is sent back as a JSON message:
427
436
```json
428
437
{
429
438
"type": "transcriber-response",
430
439
"transcription": "The transcribed text",
431
-
"channel": "customer"// or "assistant"
440
+
"channel": "customer",
441
+
"transcriptType": "final"
432
442
}
433
443
```
434
444
</Step>
@@ -444,6 +454,8 @@ You'll learn how to:
444
454
The solution buffers PCM audio and performs simple validation (e.g. ensuring stereo PCM data length is a multiple of 4). If the audio data is malformed, it is trimmed to a valid length.
445
455
-**Channel detection:**
446
456
Transcript events from Deepgram include a `channel_index` array. The service uses the first element to determine whether the transcript is from the customer (`0`) or the assistant (`1`). Ensure Deepgram's response format remains consistent with this logic.
457
+
-**Partial transcripts:**
458
+
Set `transcriptType` to `"partial"` to send progressive transcription updates. Each partial supersedes the previous one until a `"final"` message arrives. This is useful for STT providers that emit fast, low-latency partials that get refined over time (e.g. ElevenLabs Scribe). If `transcriptType` is omitted, Vapi treats the message as `"final"`.
Copy file name to clipboardExpand all lines: fern/server-url/events.mdx
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -289,13 +289,14 @@ For final-only events, you may receive `type: "transcript[transcriptType=\"final
289
289
290
290
### Model Output
291
291
292
-
Tokens or tool-call outputs as the model generates.
292
+
Tokens or tool-call outputs as the model generates. The optional `turnId` groups all tokens from the same LLM response, so you can correlate output with a specific turn.
293
293
294
294
```json
295
295
{
296
296
"message": {
297
297
"type": "model-output",
298
-
"output": { /* token or tool call */ }
298
+
"output": { /* token or tool call */ },
299
+
"turnId": "abc-123"
299
300
}
300
301
}
301
302
```
@@ -339,10 +340,13 @@ Fires whenever a transfer occurs.
339
340
340
341
### User Interrupted
341
342
343
+
Sent when the user interrupts the assistant. The optional `turnId` identifies the LLM turn that was interrupted, matching the `turnId` on `model-output` messages so you can discard that turn's tokens.
0 commit comments