live_transcribe
Transcribe a voice interaction in real-time.
Name | Type | Default | Description |
---|---|---|---|
live_transcribe Required | object | - | An object that accepts the live_transcribe parameters . |
live_transcribe Parameters
Name | Type | Default | Description |
---|---|---|---|
action Required | string | object | - | The action to perform. An object that contains one of the live_transcribe actions .Possible Values: [ stop , start , summarize ] |
Example
- Start Example
- Stop Example
- Summarize Example
In the below example, the SWML script answers an incoming call and then starts recording the call.
The script then starts a live transcription session by using the start
action. The script will transcribe the conversation in
English
After the translation session has started, the script connects the call to a destination number.
- YAML
- JSON
sections:
main:
- answer: {}
- record_call:
format: wav
stereo: 'true'
- live_transcribe:
action:
start:
webhook: 'https://example.com/webhook'
lang: en
live_events: true
ai_summary: false
speech_timeout: 30
vad_silence_ms: 500
vad_thresh: 0.6
debug_level: 2
direction:
- remote-caller
- local-caller
speech_engine: default
summary_prompt: Summarize this conversation
- connect:
from: '+1XXXXXXXXXX'
to: '+1XXXXXXXXXX'
{
"sections": {
"main": [
{
"answer": {}
},
{
"record_call": {
"format": "wav",
"stereo": "true"
}
},
{
"live_transcribe": {
"action": {
"start": {
"webhook": "https://example.com/webhook",
"lang": "en",
"live_events": true,
"ai_summary": false,
"speech_timeout": 30,
"vad_silence_ms": 500,
"vad_thresh": 0.6,
"debug_level": 2,
"direction": [
"remote-caller",
"local-caller"
],
"speech_engine": "default",
"summary_prompt": "Summarize this conversation"
}
}
}
},
{
"connect": {
"from": "+1XXXXXXXXXX",
"to": "+1XXXXXXXXXX"
}
}
]
}
}
In the below example, the SWML script answers an incoming call and then starts recording the call.
The script then initiates a start
action to start a live_transcribe
session.
The script then connects the call to a destination number.
After the call is connected, the script plays a message to the caller stating that the transcribe session is ending.
Finally, the script stops the live_transcribe
by passing the stop
action.
- YAML
- JSON
sections:
main:
- answer: {}
- record_call:
format: wav
stereo: 'true'
- live_transcribe:
action:
start:
webhook: 'https://example.com/webhook'
lang: en
live_events: true
direction:
- remote-caller
- local-caller
- connect:
from: '+1XXXXXXXXXX'
to: '+1XXXXXXXXXX'
- play:
url: 'say: Thank you for using the live translation service. We will now end the translation session.'
- live_transcribe:
action: "stop"
{
"sections": {
"main": [
{
"answer": {}
},
{
"record_call": {
"format": "wav",
"stereo": "true"
}
},
{
"live_transcribe": {
"action": {
"start": {
"webhook": "https://example.com/webhook",
"lang": "en",
"live_events": true,
"direction": [
"remote-caller",
"local-caller"
]
}
}
}
},
{
"connect": {
"from": "+1XXXXXXXXXX",
"to": "+1XXXXXXXXXX"
}
},
{
"play": {
"url": "say: Thank you for using the live translation service. We will now end the translation session."
}
},
{
"live_transcribe": {
"action": "stop"
}
}
]
}
}
In the below example, the SWML script answers an incoming call and then starts recording the call.
The script then initiates a summarize
action to summarize the conversation. A webhook url
is provided to send the summarized conversation to a webhook, and the prompt
parameter is used to provide
instructions to the AI on how to summarize the conversation.
- YAML
- JSON
sections:
main:
- answer: {}
- record_call:
format: wav
stereo: 'true'
- live_transcribe:
action:
summarize:
webhook: 'https://example.com/webhook'
prompt: Summarize the key points of this conversation.
- connect:
from: '+1XXXXXXXXXX'
to: '+1XXXXXXXXXX'
{
"sections": {
"main": [
{
"answer": {}
},
{
"record_call": {
"format": "wav",
"stereo": "true"
}
},
{
"live_transcribe": {
"action": {
"summarize": {
"webhook": "https://example.com/webhook",
"prompt": "Summarize the key points of this conversation."
}
}
}
},
{
"connect": {
"from": "+1XXXXXXXXXX",
"to": "+1XXXXXXXXXX"
}
}
]
}
}