Skip to content

Commit 18a2b66

Browse files
authored
Merge pull request #64 from AssemblyAI/E07417BDFEA3614F5967B1520F8B2F61
Sync from internal repo (2024/07/17)
2 parents ed72e4f + 0448413 commit 18a2b66

File tree

4 files changed

+31
-38
lines changed

4 files changed

+31
-38
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [4.6.1]
4+
5+
- Remove `conformer-2` from `SpeechModel` union type.
6+
- Remove conformer-2 deprecation warning
7+
38
## [4.6.0]
49

510
- Add more TSDoc comments for `RealtimeService` documentation

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assemblyai",
3-
"version": "4.6.0",
3+
"version": "4.6.1",
44
"description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.",
55
"engines": {
66
"node": ">=18"

src/services/transcripts/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
TranscribeParams,
1616
TranscribeOptions,
1717
SubmitParams,
18-
SpeechModel,
1918
RedactedAudioFile,
2019
} from "../..";
2120
import { FileService } from "../files";
@@ -39,7 +38,6 @@ export class TranscriptService extends BaseService {
3938
params: TranscribeParams,
4039
options?: TranscribeOptions,
4140
): Promise<Transcript> {
42-
deprecateConformer2(params);
4341
const transcript = await this.submit(params);
4442
return await this.waitUntilReady(transcript.id, options);
4543
}
@@ -50,7 +48,6 @@ export class TranscriptService extends BaseService {
5048
* @returns A promise that resolves to the queued transcript.
5149
*/
5250
async submit(params: SubmitParams): Promise<Transcript> {
53-
deprecateConformer2(params);
5451
let audioUrl;
5552
let transcriptParams: TranscriptParams | undefined = undefined;
5653
if ("audio" in params) {
@@ -95,7 +92,6 @@ export class TranscriptService extends BaseService {
9592
params: TranscriptParams,
9693
options?: CreateTranscriptOptions,
9794
): Promise<Transcript> {
98-
deprecateConformer2(params);
9995
const path = getPath(params.audio_url);
10096
if (path !== null) {
10197
const uploadUrl = await this.files.upload(path);
@@ -287,12 +283,3 @@ export class TranscriptService extends BaseService {
287283
};
288284
}
289285
}
290-
291-
function deprecateConformer2(params: { speech_model?: SpeechModel | null }) {
292-
if (!params) return;
293-
if (params.speech_model === "conformer-2") {
294-
console.warn(
295-
"The speech_model conformer-2 option is deprecated and will stop working in the near future. Use best or nano instead.",
296-
);
297-
}
298-
}

src/types/openapi.generated.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,7 @@ export type LemurActionItemsParams = LemurBaseParams & {
596596
* }
597597
* ```
598598
*/
599-
export type LemurActionItemsResponse = LemurBaseResponse & {
600-
/**
601-
* The response generated by LeMUR
602-
*/
603-
response: string;
604-
};
599+
export type LemurActionItemsResponse = LemurStringResponse;
605600

606601
/**
607602
* @example
@@ -820,11 +815,27 @@ export type LemurQuestionAnswerResponse = LemurBaseResponse & {
820815
response: LemurQuestionAnswer[];
821816
};
822817

823-
export type LemurResponse =
824-
| LemurTaskResponse
825-
| LemurSummaryResponse
826-
| LemurQuestionAnswerResponse
827-
| LemurActionItemsResponse;
818+
export type LemurResponse = LemurStringResponse | LemurQuestionAnswerResponse;
819+
820+
/**
821+
* @example
822+
* ```js
823+
* {
824+
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e",
825+
* "response": "Based on the transcript, the following locations were mentioned as being affected by wildfire smoke from Canada:\n\n- Maine\n- Maryland\n- Minnesota\n- Mid Atlantic region\n- Northeast region\n- New York City\n- Baltimore\n",
826+
* "usage": {
827+
* "input_tokens": 27,
828+
* "output_tokens": 3
829+
* }
830+
* }
831+
* ```
832+
*/
833+
export type LemurStringResponse = {
834+
/**
835+
* The response generated by LeMUR.
836+
*/
837+
response: string;
838+
} & LemurBaseResponse;
828839

829840
/**
830841
* @example
@@ -860,12 +871,7 @@ export type LemurSummaryParams = LemurBaseParams & {
860871
* }
861872
* ```
862873
*/
863-
export type LemurSummaryResponse = LemurBaseResponse & {
864-
/**
865-
* The response generated by LeMUR
866-
*/
867-
response: string;
868-
};
874+
export type LemurSummaryResponse = LemurStringResponse;
869875

870876
/**
871877
* @example
@@ -902,12 +908,7 @@ export type LemurTaskParams = {
902908
* }
903909
* ```
904910
*/
905-
export type LemurTaskResponse = {
906-
/**
907-
* The response generated by LeMUR.
908-
*/
909-
response: string;
910-
} & LemurBaseResponse;
911+
export type LemurTaskResponse = LemurStringResponse;
911912

912913
/**
913914
* The usage numbers for the LeMUR request
@@ -1379,7 +1380,7 @@ export type SeverityScoreSummary = {
13791380
/**
13801381
* The speech model to use for the transcription.
13811382
*/
1382-
export type SpeechModel = "best" | "nano" | "conformer-2";
1383+
export type SpeechModel = "best" | "nano";
13831384

13841385
/**
13851386
* The replacement logic for detected PII, can be "entity_name" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.

0 commit comments

Comments
 (0)