Skip to content

Commit

Permalink
feat(client-transcribe-streaming): This release adds support for AWS …
Browse files Browse the repository at this point in the history
…HealthScribe Streaming APIs within Amazon Transcribe.
  • Loading branch information
awstools committed Jan 29, 2025
1 parent ba2cc5d commit 28bc36d
Show file tree
Hide file tree
Showing 9 changed files with 3,145 additions and 230 deletions.
59 changes: 56 additions & 3 deletions clients/client-transcribe-streaming/src/TranscribeStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
GetMedicalScribeStreamCommand,
GetMedicalScribeStreamCommandInput,
GetMedicalScribeStreamCommandOutput,
} from "./commands/GetMedicalScribeStreamCommand";
import {
StartCallAnalyticsStreamTranscriptionCommand,
StartCallAnalyticsStreamTranscriptionCommandInput,
StartCallAnalyticsStreamTranscriptionCommandOutput,
} from "./commands/StartCallAnalyticsStreamTranscriptionCommand";
import {
StartMedicalScribeStreamCommand,
StartMedicalScribeStreamCommandInput,
StartMedicalScribeStreamCommandOutput,
} from "./commands/StartMedicalScribeStreamCommand";
import {
StartMedicalStreamTranscriptionCommand,
StartMedicalStreamTranscriptionCommandInput,
Expand All @@ -20,12 +30,31 @@ import {
import { TranscribeStreamingClient, TranscribeStreamingClientConfig } from "./TranscribeStreamingClient";

const commands = {
GetMedicalScribeStreamCommand,
StartCallAnalyticsStreamTranscriptionCommand,
StartMedicalScribeStreamCommand,
StartMedicalStreamTranscriptionCommand,
StartStreamTranscriptionCommand,
};

export interface TranscribeStreaming {
/**
* @see {@link GetMedicalScribeStreamCommand}
*/
getMedicalScribeStream(
args: GetMedicalScribeStreamCommandInput,
options?: __HttpHandlerOptions
): Promise<GetMedicalScribeStreamCommandOutput>;
getMedicalScribeStream(
args: GetMedicalScribeStreamCommandInput,
cb: (err: any, data?: GetMedicalScribeStreamCommandOutput) => void
): void;
getMedicalScribeStream(
args: GetMedicalScribeStreamCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetMedicalScribeStreamCommandOutput) => void
): void;

/**
* @see {@link StartCallAnalyticsStreamTranscriptionCommand}
*/
Expand All @@ -43,6 +72,23 @@ export interface TranscribeStreaming {
cb: (err: any, data?: StartCallAnalyticsStreamTranscriptionCommandOutput) => void
): void;

/**
* @see {@link StartMedicalScribeStreamCommand}
*/
startMedicalScribeStream(
args: StartMedicalScribeStreamCommandInput,
options?: __HttpHandlerOptions
): Promise<StartMedicalScribeStreamCommandOutput>;
startMedicalScribeStream(
args: StartMedicalScribeStreamCommandInput,
cb: (err: any, data?: StartMedicalScribeStreamCommandOutput) => void
): void;
startMedicalScribeStream(
args: StartMedicalScribeStreamCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: StartMedicalScribeStreamCommandOutput) => void
): void;

/**
* @see {@link StartMedicalStreamTranscriptionCommand}
*/
Expand Down Expand Up @@ -79,9 +125,10 @@ export interface TranscribeStreaming {
}

/**
* <p>Amazon Transcribe streaming offers three main types of real-time transcription:
* <b>Standard</b>, <b>Medical</b>, and
* <b>Call Analytics</b>.</p>
* <p>Amazon Transcribe streaming offers four main types of real-time transcription:
* <b>Standard</b>, <b>Medical</b>,
* <b>Call Analytics</b>,
* and <b>Health Scribe</b>.</p>
* <ul>
* <li>
* <p>
Expand All @@ -101,6 +148,12 @@ export interface TranscribeStreaming {
* center audio on two different channels; if you're looking for insight into customer service calls, use this
* option. Refer to for details.</p>
* </li>
* <li>
* <p>
* <b>HealthScribe transcriptions</b> are designed to
* automatically create clinical notes from patient-clinician conversations using generative AI.
* Refer to [here] for details.</p>
* </li>
* </ul>
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import {
GetMedicalScribeStreamCommandInput,
GetMedicalScribeStreamCommandOutput,
} from "./commands/GetMedicalScribeStreamCommand";
import {
StartCallAnalyticsStreamTranscriptionCommandInput,
StartCallAnalyticsStreamTranscriptionCommandOutput,
} from "./commands/StartCallAnalyticsStreamTranscriptionCommand";
import {
StartMedicalScribeStreamCommandInput,
StartMedicalScribeStreamCommandOutput,
} from "./commands/StartMedicalScribeStreamCommand";
import {
StartMedicalStreamTranscriptionCommandInput,
StartMedicalStreamTranscriptionCommandOutput,
Expand All @@ -93,15 +101,19 @@ export { __Client };
* @public
*/
export type ServiceInputTypes =
| GetMedicalScribeStreamCommandInput
| StartCallAnalyticsStreamTranscriptionCommandInput
| StartMedicalScribeStreamCommandInput
| StartMedicalStreamTranscriptionCommandInput
| StartStreamTranscriptionCommandInput;

/**
* @public
*/
export type ServiceOutputTypes =
| GetMedicalScribeStreamCommandOutput
| StartCallAnalyticsStreamTranscriptionCommandOutput
| StartMedicalScribeStreamCommandOutput
| StartMedicalStreamTranscriptionCommandOutput
| StartStreamTranscriptionCommandOutput;

Expand Down Expand Up @@ -313,9 +325,10 @@ export type TranscribeStreamingClientResolvedConfigType = __SmithyResolvedConfig
export interface TranscribeStreamingClientResolvedConfig extends TranscribeStreamingClientResolvedConfigType {}

/**
* <p>Amazon Transcribe streaming offers three main types of real-time transcription:
* <b>Standard</b>, <b>Medical</b>, and
* <b>Call Analytics</b>.</p>
* <p>Amazon Transcribe streaming offers four main types of real-time transcription:
* <b>Standard</b>, <b>Medical</b>,
* <b>Call Analytics</b>,
* and <b>Health Scribe</b>.</p>
* <ul>
* <li>
* <p>
Expand All @@ -335,6 +348,12 @@ export interface TranscribeStreamingClientResolvedConfig extends TranscribeStrea
* center audio on two different channels; if you're looking for insight into customer service calls, use this
* option. Refer to for details.</p>
* </li>
* <li>
* <p>
* <b>HealthScribe transcriptions</b> are designed to
* automatically create clinical notes from patient-clinician conversations using generative AI.
* Refer to [here] for details.</p>
* </li>
* </ul>
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { GetMedicalScribeStreamRequest, GetMedicalScribeStreamResponse } from "../models/models_0";
import { de_GetMedicalScribeStreamCommand, se_GetMedicalScribeStreamCommand } from "../protocols/Aws_restJson1";
import {
ServiceInputTypes,
ServiceOutputTypes,
TranscribeStreamingClientResolvedConfig,
} from "../TranscribeStreamingClient";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link GetMedicalScribeStreamCommand}.
*/
export interface GetMedicalScribeStreamCommandInput extends GetMedicalScribeStreamRequest {}
/**
* @public
*
* The output of {@link GetMedicalScribeStreamCommand}.
*/
export interface GetMedicalScribeStreamCommandOutput extends GetMedicalScribeStreamResponse, __MetadataBearer {}

/**
* <p>Provides details about the specified Amazon Web Services HealthScribe streaming session.
* To view the status of the streaming session, check the <code>StreamStatus</code> field in the response. To get the
* details of post-stream analytics, including its status, check the <code>PostStreamAnalyticsResult</code> field in the response.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { TranscribeStreamingClient, GetMedicalScribeStreamCommand } from "@aws-sdk/client-transcribe-streaming"; // ES Modules import
* // const { TranscribeStreamingClient, GetMedicalScribeStreamCommand } = require("@aws-sdk/client-transcribe-streaming"); // CommonJS import
* const client = new TranscribeStreamingClient(config);
* const input = { // GetMedicalScribeStreamRequest
* SessionId: "STRING_VALUE", // required
* };
* const command = new GetMedicalScribeStreamCommand(input);
* const response = await client.send(command);
* // { // GetMedicalScribeStreamResponse
* // MedicalScribeStreamDetails: { // MedicalScribeStreamDetails
* // SessionId: "STRING_VALUE",
* // StreamCreatedAt: new Date("TIMESTAMP"),
* // StreamEndedAt: new Date("TIMESTAMP"),
* // LanguageCode: "en-US",
* // MediaSampleRateHertz: Number("int"),
* // MediaEncoding: "pcm" || "ogg-opus" || "flac",
* // VocabularyName: "STRING_VALUE",
* // VocabularyFilterName: "STRING_VALUE",
* // VocabularyFilterMethod: "remove" || "mask" || "tag",
* // ResourceAccessRoleArn: "STRING_VALUE",
* // ChannelDefinitions: [ // MedicalScribeChannelDefinitions
* // { // MedicalScribeChannelDefinition
* // ChannelId: Number("int"), // required
* // ParticipantRole: "PATIENT" || "CLINICIAN", // required
* // },
* // ],
* // EncryptionSettings: { // MedicalScribeEncryptionSettings
* // KmsEncryptionContext: { // KMSEncryptionContextMap
* // "<keys>": "STRING_VALUE",
* // },
* // KmsKeyId: "STRING_VALUE", // required
* // },
* // StreamStatus: "IN_PROGRESS" || "PAUSED" || "FAILED" || "COMPLETED",
* // PostStreamAnalyticsSettings: { // MedicalScribePostStreamAnalyticsSettings
* // ClinicalNoteGenerationSettings: { // ClinicalNoteGenerationSettings
* // OutputBucketName: "STRING_VALUE", // required
* // },
* // },
* // PostStreamAnalyticsResult: { // MedicalScribePostStreamAnalyticsResult
* // ClinicalNoteGenerationResult: { // ClinicalNoteGenerationResult
* // ClinicalNoteOutputLocation: "STRING_VALUE",
* // TranscriptOutputLocation: "STRING_VALUE",
* // Status: "IN_PROGRESS" || "FAILED" || "COMPLETED",
* // FailureReason: "STRING_VALUE",
* // },
* // },
* // },
* // };
*
* ```
*
* @param GetMedicalScribeStreamCommandInput - {@link GetMedicalScribeStreamCommandInput}
* @returns {@link GetMedicalScribeStreamCommandOutput}
* @see {@link GetMedicalScribeStreamCommandInput} for command's `input` shape.
* @see {@link GetMedicalScribeStreamCommandOutput} for command's `response` shape.
* @see {@link TranscribeStreamingClientResolvedConfig | config} for TranscribeStreamingClient's `config` shape.
*
* @throws {@link BadRequestException} (client fault)
* <p>One or more arguments to the <code>StartStreamTranscription</code>,
* <code>StartMedicalStreamTranscription</code>, or <code>StartCallAnalyticsStreamTranscription</code>
* operation was not valid. For example, <code>MediaEncoding</code> or <code>LanguageCode</code>
* used unsupported values. Check the specified parameters and try your request again.</p>
*
* @throws {@link InternalFailureException} (server fault)
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*
* @throws {@link LimitExceededException} (client fault)
* <p>Your client has exceeded one of the Amazon Transcribe limits. This is typically the audio length
* limit. Break your audio stream into smaller chunks and try your request again.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The request references a resource which doesn't exist.</p>
*
* @throws {@link TranscribeStreamingServiceException}
* <p>Base exception class for all service exceptions from TranscribeStreaming service.</p>
*
* @public
*/
export class GetMedicalScribeStreamCommand extends $Command
.classBuilder<
GetMedicalScribeStreamCommandInput,
GetMedicalScribeStreamCommandOutput,
TranscribeStreamingClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: TranscribeStreamingClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("Transcribe", "GetMedicalScribeStream", {})
.n("TranscribeStreamingClient", "GetMedicalScribeStreamCommand")
.f(void 0, void 0)
.ser(se_GetMedicalScribeStreamCommand)
.de(de_GetMedicalScribeStreamCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: GetMedicalScribeStreamRequest;
output: GetMedicalScribeStreamResponse;
};
sdk: {
input: GetMedicalScribeStreamCommandInput;
output: GetMedicalScribeStreamCommandOutput;
};
};
}
Loading

0 comments on commit 28bc36d

Please sign in to comment.