From 0e308ac3db7405059077ef13dd142d57be90ebdf Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 23 Jun 2026 15:05:11 +0000 Subject: [PATCH 1/2] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 2 + README.md | 1 + bandwidth.yml | 70 ++++++++++++++++++++++++++ docs/RecordingTranscriptionClip.md | 28 +++++++++++ docs/RecordingTranscriptions.md | 2 + docs/Transcription.md | 2 + models/index.ts | 1 + models/recording-transcription-clip.ts | 39 ++++++++++++++ models/recording-transcriptions.ts | 7 +++ models/transcription.ts | 4 ++ 10 files changed, 156 insertions(+) create mode 100644 docs/RecordingTranscriptionClip.md create mode 100644 models/recording-transcription-clip.ts diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7fd34a1..3573294 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -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 @@ -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 diff --git a/README.md b/README.md index 4eb50e1..9f024b8 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/bandwidth.yml b/bandwidth.yml index a380e26..fd39c5c 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -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: @@ -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 diff --git a/docs/RecordingTranscriptionClip.md b/docs/RecordingTranscriptionClip.md new file mode 100644 index 0000000..f772ea7 --- /dev/null +++ b/docs/RecordingTranscriptionClip.md @@ -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) diff --git a/docs/RecordingTranscriptions.md b/docs/RecordingTranscriptions.md index 78b1d25..a6cad32 100644 --- a/docs/RecordingTranscriptions.md +++ b/docs/RecordingTranscriptions.md @@ -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 @@ -14,6 +15,7 @@ import { RecordingTranscriptions } from 'bandwidth-sdk'; const instance: RecordingTranscriptions = { transcripts, + clips, }; ``` diff --git a/docs/Transcription.md b/docs/Transcription.md index 5588e23..8a3faa5 100644 --- a/docs/Transcription.md +++ b/docs/Transcription.md @@ -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] @@ -14,6 +15,7 @@ Name | Type | Description | Notes import { Transcription } from 'bandwidth-sdk'; const instance: Transcription = { + speaker, text, confidence, }; diff --git a/models/index.ts b/models/index.ts index bb6e465..2c25029 100644 --- a/models/index.ts +++ b/models/index.ts @@ -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'; diff --git a/models/recording-transcription-clip.ts b/models/recording-transcription-clip.ts new file mode 100644 index 0000000..192dd52 --- /dev/null +++ b/models/recording-transcription-clip.ts @@ -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; +} + diff --git a/models/recording-transcriptions.ts b/models/recording-transcriptions.ts index 8f74add..d41af5f 100644 --- a/models/recording-transcriptions.ts +++ b/models/recording-transcriptions.ts @@ -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; + /** + * A list of individual speech clips with speaker, timing, and confidence information. + */ + 'clips'?: Array; } diff --git a/models/transcription.ts b/models/transcription.ts index 45648da..369962b 100644 --- a/models/transcription.ts +++ b/models/transcription.ts @@ -15,6 +15,10 @@ export interface Transcription { + /** + * Zero-based index identifying the speaker. + */ + 'speaker'?: number; /** * The transcribed text */ From b18abd693bebed5397946778aceee98a6b501206 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 23 Jun 2026 15:13:52 -0400 Subject: [PATCH 2/2] unit tests --- tests/unit/api/recordings-api.test.ts | 1 + .../recording-transcription-clip.test.ts | 19 +++++++++++++++++++ .../models/recording-transcriptions.test.ts | 2 ++ tests/unit/models/transcription.test.ts | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 tests/unit/models/recording-transcription-clip.test.ts diff --git a/tests/unit/api/recordings-api.test.ts b/tests/unit/api/recordings-api.test.ts index a7b9a51..d819f88 100644 --- a/tests/unit/api/recordings-api.test.ts +++ b/tests/unit/api/recordings-api.test.ts @@ -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(); }); diff --git a/tests/unit/models/recording-transcription-clip.test.ts b/tests/unit/models/recording-transcription-clip.test.ts new file mode 100644 index 0000000..1577533 --- /dev/null +++ b/tests/unit/models/recording-transcription-clip.test.ts @@ -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); + }); +}); diff --git a/tests/unit/models/recording-transcriptions.test.ts b/tests/unit/models/recording-transcriptions.test.ts index f128f04..717ff0e 100644 --- a/tests/unit/models/recording-transcriptions.test.ts +++ b/tests/unit/models/recording-transcriptions.test.ts @@ -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([]); }); }); diff --git a/tests/unit/models/transcription.test.ts b/tests/unit/models/transcription.test.ts index f1ea3e1..63bf42c 100644 --- a/tests/unit/models/transcription.test.ts +++ b/tests/unit/models/transcription.test.ts @@ -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); });