From Bright Pattern Documentation
getVoiceTranscript
Gets the voice transcript for a voice call interaction and returns a list of transcription chunks from the call. Only available for Communicator Widget 2.0.
Request
Syntax
| getVoiceTranscript(interactionId?: string): Promise<OperationResult<VoiceTranscript>> |
Where:
type VoiceTranscript = {
chunks: VoiceTranscriptChunk[] } type VoiceTranscriptChunk = { id: string startTime: number endTime: number text: string senderName: string confidence?: number } |
Parameters
| Parameters | Parameter Values | Data Type | Optional/Required | Description |
| interactionId | String | Optional | The voice interaction for which to get the transcript. If the interactionId is omitted, the currently active interaction will be used. |
Example Request
getVoiceTranscriptButton.onclick = async () => {
const interactionId = interactionsList[0]?.interactionId;
const result = await adApi.getVoiceTranscript(interactionId);
if (result.status === "success") {
console.log(result.data.chunks);
}
};
Return Value
| Object | Object Values | Data Type | Optional? (Y/N) | Value Description |
| VoiceTranscript | ||||
| chunks | VoiceTranscriptChunk[] | N | Array of transcription chunks | |
| id | String | N | Unique chunk ID | |
| startTime | Number | N | Chunk start time in milliseconds | |
| endTime | Number | N | Chunk end time in milliseconds | |
| text | String | N | Transcribed text | |
| senderName | String | N | Display name of the speaker | |
| confidence | Number | Y | Transcription confidence score (0-1) |