Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: a3be8a03d669e5738cbd181d8e8e34f7c1598c5f
  • Loading branch information
AssemblyAI authored and Swimburger committed Jul 17, 2024
1 parent ed72e4f commit 0448413
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 38 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [4.6.1]

- Remove `conformer-2` from `SpeechModel` union type.
- Remove conformer-2 deprecation warning

## [4.6.0]

- Add more TSDoc comments for `RealtimeService` documentation
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assemblyai",
"version": "4.6.0",
"version": "4.6.1",
"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.",
"engines": {
"node": ">=18"
Expand Down
13 changes: 0 additions & 13 deletions src/services/transcripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
TranscribeParams,
TranscribeOptions,
SubmitParams,
SpeechModel,
RedactedAudioFile,
} from "../..";
import { FileService } from "../files";
Expand All @@ -39,7 +38,6 @@ export class TranscriptService extends BaseService {
params: TranscribeParams,
options?: TranscribeOptions,
): Promise<Transcript> {
deprecateConformer2(params);
const transcript = await this.submit(params);
return await this.waitUntilReady(transcript.id, options);
}
Expand All @@ -50,7 +48,6 @@ export class TranscriptService extends BaseService {
* @returns A promise that resolves to the queued transcript.
*/
async submit(params: SubmitParams): Promise<Transcript> {
deprecateConformer2(params);
let audioUrl;
let transcriptParams: TranscriptParams | undefined = undefined;
if ("audio" in params) {
Expand Down Expand Up @@ -95,7 +92,6 @@ export class TranscriptService extends BaseService {
params: TranscriptParams,
options?: CreateTranscriptOptions,
): Promise<Transcript> {
deprecateConformer2(params);
const path = getPath(params.audio_url);
if (path !== null) {
const uploadUrl = await this.files.upload(path);
Expand Down Expand Up @@ -287,12 +283,3 @@ export class TranscriptService extends BaseService {
};
}
}

function deprecateConformer2(params: { speech_model?: SpeechModel | null }) {
if (!params) return;
if (params.speech_model === "conformer-2") {
console.warn(
"The speech_model conformer-2 option is deprecated and will stop working in the near future. Use best or nano instead.",
);
}
}
49 changes: 25 additions & 24 deletions src/types/openapi.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,7 @@ export type LemurActionItemsParams = LemurBaseParams & {
* }
* ```
*/
export type LemurActionItemsResponse = LemurBaseResponse & {
/**
* The response generated by LeMUR
*/
response: string;
};
export type LemurActionItemsResponse = LemurStringResponse;

/**
* @example
Expand Down Expand Up @@ -820,11 +815,27 @@ export type LemurQuestionAnswerResponse = LemurBaseResponse & {
response: LemurQuestionAnswer[];
};

export type LemurResponse =
| LemurTaskResponse
| LemurSummaryResponse
| LemurQuestionAnswerResponse
| LemurActionItemsResponse;
export type LemurResponse = LemurStringResponse | LemurQuestionAnswerResponse;

/**
* @example
* ```js
* {
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e",
* "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",
* "usage": {
* "input_tokens": 27,
* "output_tokens": 3
* }
* }
* ```
*/
export type LemurStringResponse = {
/**
* The response generated by LeMUR.
*/
response: string;
} & LemurBaseResponse;

/**
* @example
Expand Down Expand Up @@ -860,12 +871,7 @@ export type LemurSummaryParams = LemurBaseParams & {
* }
* ```
*/
export type LemurSummaryResponse = LemurBaseResponse & {
/**
* The response generated by LeMUR
*/
response: string;
};
export type LemurSummaryResponse = LemurStringResponse;

/**
* @example
Expand Down Expand Up @@ -902,12 +908,7 @@ export type LemurTaskParams = {
* }
* ```
*/
export type LemurTaskResponse = {
/**
* The response generated by LeMUR.
*/
response: string;
} & LemurBaseResponse;
export type LemurTaskResponse = LemurStringResponse;

/**
* The usage numbers for the LeMUR request
Expand Down Expand Up @@ -1379,7 +1380,7 @@ export type SeverityScoreSummary = {
/**
* The speech model to use for the transcription.
*/
export type SpeechModel = "best" | "nano" | "conformer-2";
export type SpeechModel = "best" | "nano";

/**
* 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.
Expand Down

0 comments on commit 0448413

Please sign in to comment.