Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ docs/RbmWebViewEnum.md
docs/RecordingAvailableCallback.md
docs/RecordingCompleteCallback.md
docs/RecordingStateEnum.md
docs/RecordingTranscriptionClip.md
docs/RecordingTranscriptionMetadata.md
docs/RecordingTranscriptions.md
docs/RecordingsApi.md
Expand Down Expand Up @@ -381,6 +382,7 @@ models/rbm-web-view-enum.ts
models/recording-available-callback.ts
models/recording-complete-callback.ts
models/recording-state-enum.ts
models/recording-transcription-clip.ts
models/recording-transcription-metadata.ts
models/recording-transcriptions.ts
models/redirect-callback.ts
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ Class | Method | HTTP request | Description
- [RecordingAvailableCallback](docs/RecordingAvailableCallback.md)
- [RecordingCompleteCallback](docs/RecordingCompleteCallback.md)
- [RecordingStateEnum](docs/RecordingStateEnum.md)
- [RecordingTranscriptionClip](docs/RecordingTranscriptionClip.md)
- [RecordingTranscriptionMetadata](docs/RecordingTranscriptionMetadata.md)
- [RecordingTranscriptions](docs/RecordingTranscriptions.md)
- [RedirectCallback](docs/RedirectCallback.md)
Expand Down
70 changes: 70 additions & 0 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4354,6 +4354,72 @@ components:
type: array
items:
$ref: '#/components/schemas/transcription'
clips:
type: array
description: >-
A list of individual speech clips with speaker, timing, and
confidence information.
items:
$ref: '#/components/schemas/recordingTranscriptionClip'
example:
transcripts:
- speaker: 0
text: Hi, is Thursday at two still good for you? Perfect, talk soon.
confidence: 0.96
- speaker: 1
text: Yes, that works great. See you then! Sounds good, bye!
confidence: 0.97
clips:
- speaker: 0
text: Hi, is Thursday at two still good for you?
confidence: 0.97
startTimeSeconds: 0.4
endTimeSeconds: 3.1
- speaker: 1
text: Yes, that works great. See you then!
confidence: 0.95
startTimeSeconds: 3.8
endTimeSeconds: 6.2
- speaker: 0
text: Perfect, talk soon.
confidence: 0.94
startTimeSeconds: 6.9
endTimeSeconds: 8.1
- speaker: 1
text: Sounds good, bye!
confidence: 0.98
startTimeSeconds: 8.5
endTimeSeconds: 9.7
recordingTranscriptionClip:
type: object
properties:
speaker:
type: integer
description: Zero-based index identifying the speaker.
example: 0
text:
type: string
description: The transcribed text of this clip.
example: Hi there, thanks for calling!
confidence:
type: number
format: double
minimum: 0
maximum: 1
description: >-
How confident the transcription engine was in transcribing this clip
(from `0.0` to `1.0`).
example: 0.85
startTimeSeconds:
type: number
format: double
description: The start time of this clip within the recording, in seconds.
example: 2.3
endTimeSeconds:
type: number
format: double
description: The end time of this clip within the recording, in seconds.
example: 3.1
callTranscriptionMetadataList:
type: array
items:
Expand Down Expand Up @@ -5480,6 +5546,10 @@ components:
transcription:
type: object
properties:
speaker:
type: integer
description: Zero-based index identifying the speaker.
example: 0
text:
type: string
description: The transcribed text
Expand Down
28 changes: 28 additions & 0 deletions docs/RecordingTranscriptionClip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# RecordingTranscriptionClip


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**speaker** | **number** | Zero-based index identifying the speaker. | [optional] [default to undefined]
**text** | **string** | The transcribed text of this clip. | [optional] [default to undefined]
**confidence** | **number** | How confident the transcription engine was in transcribing this clip (from `0.0` to `1.0`). | [optional] [default to undefined]
**startTimeSeconds** | **number** | The start time of this clip within the recording, in seconds. | [optional] [default to undefined]
**endTimeSeconds** | **number** | The end time of this clip within the recording, in seconds. | [optional] [default to undefined]

## Example

```typescript
import { RecordingTranscriptionClip } from 'bandwidth-sdk';

const instance: RecordingTranscriptionClip = {
speaker,
text,
confidence,
startTimeSeconds,
endTimeSeconds,
};
```

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2 changes: 2 additions & 0 deletions docs/RecordingTranscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**transcripts** | [**Array<Transcription>**](Transcription.md) | | [optional] [default to undefined]
**clips** | [**Array<RecordingTranscriptionClip>**](RecordingTranscriptionClip.md) | A list of individual speech clips with speaker, timing, and confidence information. | [optional] [default to undefined]

## Example

Expand All @@ -14,6 +15,7 @@ import { RecordingTranscriptions } from 'bandwidth-sdk';

const instance: RecordingTranscriptions = {
transcripts,
clips,
};
```

Expand Down
2 changes: 2 additions & 0 deletions docs/Transcription.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**speaker** | **number** | Zero-based index identifying the speaker. | [optional] [default to undefined]
**text** | **string** | The transcribed text | [optional] [default to undefined]
**confidence** | **number** | The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. | [optional] [default to undefined]

Expand All @@ -14,6 +15,7 @@ Name | Type | Description | Notes
import { Transcription } from 'bandwidth-sdk';

const instance: Transcription = {
speaker,
text,
confidence,
};
Expand Down
1 change: 1 addition & 0 deletions models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export * from './rbm-web-view-enum';
export * from './recording-available-callback';
export * from './recording-complete-callback';
export * from './recording-state-enum';
export * from './recording-transcription-clip';
export * from './recording-transcription-metadata';
export * from './recording-transcriptions';
export * from './redirect-callback';
Expand Down
39 changes: 39 additions & 0 deletions models/recording-transcription-clip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* tslint:disable */
/* eslint-disable */
/**
* Bandwidth
* Bandwidth\'s Communication APIs
*
* The version of the OpenAPI document: 1.0.0
* Contact: letstalk@bandwidth.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



export interface RecordingTranscriptionClip {
/**
* Zero-based index identifying the speaker.
*/
'speaker'?: number;
/**
* The transcribed text of this clip.
*/
'text'?: string;
/**
* How confident the transcription engine was in transcribing this clip (from `0.0` to `1.0`).
*/
'confidence'?: number;
/**
* The start time of this clip within the recording, in seconds.
*/
'startTimeSeconds'?: number;
/**
* The end time of this clip within the recording, in seconds.
*/
'endTimeSeconds'?: number;
}

7 changes: 7 additions & 0 deletions models/recording-transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
*/


// May contain unused imports in some cases
// @ts-ignore
import type { RecordingTranscriptionClip } from './recording-transcription-clip';
// May contain unused imports in some cases
// @ts-ignore
import type { Transcription } from './transcription';

export interface RecordingTranscriptions {
'transcripts'?: Array<Transcription>;
/**
* A list of individual speech clips with speaker, timing, and confidence information.
*/
'clips'?: Array<RecordingTranscriptionClip>;
}

4 changes: 4 additions & 0 deletions models/transcription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@


export interface Transcription {
/**
* Zero-based index identifying the speaker.
*/
'speaker'?: number;
/**
* The transcribed text
*/
Expand Down
1 change: 1 addition & 0 deletions tests/unit/api/recordings-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ describe('RecordingsApi', () => {

expect(status).toEqual(200);
expect(data.transcripts).toBeInstanceOf(Array);
expect(data.transcripts![0].speaker).toBeNumber();
expect(data.transcripts![0].text).toBeString();
expect(data.transcripts![0].confidence).toBeNumber();
});
Expand Down
19 changes: 19 additions & 0 deletions tests/unit/models/recording-transcription-clip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { RecordingTranscriptionClip } from '../../../models/recording-transcription-clip';

describe('RecordingTranscriptionClip', () => {
test('should accept the expected shape', () => {
const fixture: RecordingTranscriptionClip = {
speaker: 1,
text: 'test-text',
confidence: 1.5,
startTimeSeconds: 0.0,
endTimeSeconds: 1.0,
};

expect(fixture.speaker).toBe(1);
expect(fixture.text).toBe('test-text');
expect(fixture.confidence).toBe(1.5);
expect(fixture.startTimeSeconds).toBe(0.0);
expect(fixture.endTimeSeconds).toBe(1.0);
});
});
2 changes: 2 additions & 0 deletions tests/unit/models/recording-transcriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ describe('RecordingTranscriptions', () => {
test('should accept the expected shape', () => {
const fixture: RecordingTranscriptions = {
transcripts: [],
clips: [],
};

expect(fixture.transcripts).toEqual([]);
expect(fixture.clips).toEqual([]);
});
});
2 changes: 2 additions & 0 deletions tests/unit/models/transcription.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { Transcription } from '../../../models/transcription';
describe('Transcription', () => {
test('should accept the expected shape', () => {
const fixture: Transcription = {
speaker: 1,
text: 'test-text',
confidence: 1.5,
};

expect(fixture.speaker).toBe(1);
expect(fixture.text).toBe('test-text');
expect(fixture.confidence).toBe(1.5);
});
Expand Down