Skip to content

Commit e8444b1

Browse files
committed
add custom endpoint override to the SDKs pre-recorded transcription method
1 parent 43d8d03 commit e8444b1

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/transcription/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export class Transcriber {
1717
*/
1818
async preRecorded(
1919
source: TranscriptionSource,
20-
options?: PrerecordedTranscriptionOptions
20+
options?: PrerecordedTranscriptionOptions,
21+
endpoint?: string = "v1/listen"
2122
): Promise<PrerecordedTranscriptionResponse> {
2223
return await preRecordedTranscription(
2324
this._credentials,
2425
this._apiUrl || "",
2526
source,
26-
options
27+
options,
28+
endpoint
2729
);
2830
}
2931

src/transcription/preRecordedTranscription.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const preRecordedTranscription = async (
4040
apiKey: string,
4141
apiUrl: string,
4242
source: TranscriptionSource,
43-
options?: PrerecordedTranscriptionOptions
43+
options?: PrerecordedTranscriptionOptions,
44+
endpoint?: string
4445
): Promise<PrerecordedTranscriptionResponse> => {
4546
const transcriptionOptions = { ...{}, ...options };
4647

@@ -75,7 +76,7 @@ export const preRecordedTranscription = async (
7576
"POST",
7677
apiKey,
7778
apiUrl,
78-
`/v1/listen?${querystring.stringify(transcriptionOptions)}`,
79+
`/${endpoint}?${querystring.stringify(transcriptionOptions)}`,
7980
body,
8081
requestOptions
8182
);

0 commit comments

Comments
 (0)