From 671315c8bbd766ea7797a338abe42e27ef9b9d5b Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 29 Apr 2024 18:15:10 +0000 Subject: [PATCH] feat(client-transcribe): This update provides error messaging for generative call summarization in Transcribe Call Analytics --- .../commands/GetCallAnalyticsJobCommand.ts | 9 ++ .../commands/ListCallAnalyticsJobsCommand.ts | 9 ++ .../commands/StartCallAnalyticsJobCommand.ts | 9 ++ .../client-transcribe/src/models/models_0.ts | 80 +++++++++++++++++ .../src/protocols/Aws_json1_1.ts | 8 ++ .../sdk-codegen/aws-models/transcribe.json | 88 ++++++++++++++++++- 6 files changed, 202 insertions(+), 1 deletion(-) diff --git a/clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts b/clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts index 5f8d40a38517f..c4e26f1cfdefc 100644 --- a/clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts +++ b/clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts @@ -54,6 +54,15 @@ export interface GetCallAnalyticsJobCommandOutput extends GetCallAnalyticsJobRes * // CallAnalyticsJob: { // CallAnalyticsJob * // CallAnalyticsJobName: "STRING_VALUE", * // CallAnalyticsJobStatus: "QUEUED" || "IN_PROGRESS" || "FAILED" || "COMPLETED", + * // CallAnalyticsJobDetails: { // CallAnalyticsJobDetails + * // Skipped: [ // CallAnalyticsSkippedFeatureList + * // { // CallAnalyticsSkippedFeature + * // Feature: "GENERATIVE_SUMMARIZATION", + * // ReasonCode: "INSUFFICIENT_CONVERSATION_CONTENT" || "FAILED_SAFETY_GUIDELINES", + * // Message: "STRING_VALUE", + * // }, + * // ], + * // }, * // LanguageCode: "af-ZA" || "ar-AE" || "ar-SA" || "da-DK" || "de-CH" || "de-DE" || "en-AB" || "en-AU" || "en-GB" || "en-IE" || "en-IN" || "en-US" || "en-WL" || "es-ES" || "es-US" || "fa-IR" || "fr-CA" || "fr-FR" || "he-IL" || "hi-IN" || "id-ID" || "it-IT" || "ja-JP" || "ko-KR" || "ms-MY" || "nl-NL" || "pt-BR" || "pt-PT" || "ru-RU" || "ta-IN" || "te-IN" || "tr-TR" || "zh-CN" || "zh-TW" || "th-TH" || "en-ZA" || "en-NZ" || "vi-VN" || "sv-SE" || "ab-GE" || "ast-ES" || "az-AZ" || "ba-RU" || "be-BY" || "bg-BG" || "bn-IN" || "bs-BA" || "ca-ES" || "ckb-IQ" || "ckb-IR" || "cs-CZ" || "cy-WL" || "el-GR" || "et-ET" || "eu-ES" || "fi-FI" || "gl-ES" || "gu-IN" || "ha-NG" || "hr-HR" || "hu-HU" || "hy-AM" || "is-IS" || "ka-GE" || "kab-DZ" || "kk-KZ" || "kn-IN" || "ky-KG" || "lg-IN" || "lt-LT" || "lv-LV" || "mhr-RU" || "mi-NZ" || "mk-MK" || "ml-IN" || "mn-MN" || "mr-IN" || "mt-MT" || "no-NO" || "or-IN" || "pa-IN" || "pl-PL" || "ps-AF" || "ro-RO" || "rw-RW" || "si-LK" || "sk-SK" || "sl-SI" || "so-SO" || "sr-RS" || "su-ID" || "sw-BI" || "sw-KE" || "sw-RW" || "sw-TZ" || "sw-UG" || "tl-PH" || "tt-RU" || "ug-CN" || "uk-UA" || "uz-UZ" || "wo-SN" || "zu-ZA", * // MediaSampleRateHertz: Number("int"), * // MediaFormat: "mp3" || "mp4" || "wav" || "flac" || "ogg" || "amr" || "webm" || "m4a", diff --git a/clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts b/clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts index 64877468f268f..5d167990eac33 100644 --- a/clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts +++ b/clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts @@ -55,6 +55,15 @@ export interface ListCallAnalyticsJobsCommandOutput extends ListCallAnalyticsJob * // CompletionTime: new Date("TIMESTAMP"), * // LanguageCode: "af-ZA" || "ar-AE" || "ar-SA" || "da-DK" || "de-CH" || "de-DE" || "en-AB" || "en-AU" || "en-GB" || "en-IE" || "en-IN" || "en-US" || "en-WL" || "es-ES" || "es-US" || "fa-IR" || "fr-CA" || "fr-FR" || "he-IL" || "hi-IN" || "id-ID" || "it-IT" || "ja-JP" || "ko-KR" || "ms-MY" || "nl-NL" || "pt-BR" || "pt-PT" || "ru-RU" || "ta-IN" || "te-IN" || "tr-TR" || "zh-CN" || "zh-TW" || "th-TH" || "en-ZA" || "en-NZ" || "vi-VN" || "sv-SE" || "ab-GE" || "ast-ES" || "az-AZ" || "ba-RU" || "be-BY" || "bg-BG" || "bn-IN" || "bs-BA" || "ca-ES" || "ckb-IQ" || "ckb-IR" || "cs-CZ" || "cy-WL" || "el-GR" || "et-ET" || "eu-ES" || "fi-FI" || "gl-ES" || "gu-IN" || "ha-NG" || "hr-HR" || "hu-HU" || "hy-AM" || "is-IS" || "ka-GE" || "kab-DZ" || "kk-KZ" || "kn-IN" || "ky-KG" || "lg-IN" || "lt-LT" || "lv-LV" || "mhr-RU" || "mi-NZ" || "mk-MK" || "ml-IN" || "mn-MN" || "mr-IN" || "mt-MT" || "no-NO" || "or-IN" || "pa-IN" || "pl-PL" || "ps-AF" || "ro-RO" || "rw-RW" || "si-LK" || "sk-SK" || "sl-SI" || "so-SO" || "sr-RS" || "su-ID" || "sw-BI" || "sw-KE" || "sw-RW" || "sw-TZ" || "sw-UG" || "tl-PH" || "tt-RU" || "ug-CN" || "uk-UA" || "uz-UZ" || "wo-SN" || "zu-ZA", * // CallAnalyticsJobStatus: "QUEUED" || "IN_PROGRESS" || "FAILED" || "COMPLETED", + * // CallAnalyticsJobDetails: { // CallAnalyticsJobDetails + * // Skipped: [ // CallAnalyticsSkippedFeatureList + * // { // CallAnalyticsSkippedFeature + * // Feature: "GENERATIVE_SUMMARIZATION", + * // ReasonCode: "INSUFFICIENT_CONVERSATION_CONTENT" || "FAILED_SAFETY_GUIDELINES", + * // Message: "STRING_VALUE", + * // }, + * // ], + * // }, * // FailureReason: "STRING_VALUE", * // }, * // ], diff --git a/clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts b/clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts index a787d4a44851b..4ac9d831e304c 100644 --- a/clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts +++ b/clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts @@ -132,6 +132,15 @@ export interface StartCallAnalyticsJobCommandOutput extends StartCallAnalyticsJo * // CallAnalyticsJob: { // CallAnalyticsJob * // CallAnalyticsJobName: "STRING_VALUE", * // CallAnalyticsJobStatus: "QUEUED" || "IN_PROGRESS" || "FAILED" || "COMPLETED", + * // CallAnalyticsJobDetails: { // CallAnalyticsJobDetails + * // Skipped: [ // CallAnalyticsSkippedFeatureList + * // { // CallAnalyticsSkippedFeature + * // Feature: "GENERATIVE_SUMMARIZATION", + * // ReasonCode: "INSUFFICIENT_CONVERSATION_CONTENT" || "FAILED_SAFETY_GUIDELINES", + * // Message: "STRING_VALUE", + * // }, + * // ], + * // }, * // LanguageCode: "af-ZA" || "ar-AE" || "ar-SA" || "da-DK" || "de-CH" || "de-DE" || "en-AB" || "en-AU" || "en-GB" || "en-IE" || "en-IN" || "en-US" || "en-WL" || "es-ES" || "es-US" || "fa-IR" || "fr-CA" || "fr-FR" || "he-IL" || "hi-IN" || "id-ID" || "it-IT" || "ja-JP" || "ko-KR" || "ms-MY" || "nl-NL" || "pt-BR" || "pt-PT" || "ru-RU" || "ta-IN" || "te-IN" || "tr-TR" || "zh-CN" || "zh-TW" || "th-TH" || "en-ZA" || "en-NZ" || "vi-VN" || "sv-SE" || "ab-GE" || "ast-ES" || "az-AZ" || "ba-RU" || "be-BY" || "bg-BG" || "bn-IN" || "bs-BA" || "ca-ES" || "ckb-IQ" || "ckb-IR" || "cs-CZ" || "cy-WL" || "el-GR" || "et-ET" || "eu-ES" || "fi-FI" || "gl-ES" || "gu-IN" || "ha-NG" || "hr-HR" || "hu-HU" || "hy-AM" || "is-IS" || "ka-GE" || "kab-DZ" || "kk-KZ" || "kn-IN" || "ky-KG" || "lg-IN" || "lt-LT" || "lv-LV" || "mhr-RU" || "mi-NZ" || "mk-MK" || "ml-IN" || "mn-MN" || "mr-IN" || "mt-MT" || "no-NO" || "or-IN" || "pa-IN" || "pl-PL" || "ps-AF" || "ro-RO" || "rw-RW" || "si-LK" || "sk-SK" || "sl-SI" || "so-SO" || "sr-RS" || "su-ID" || "sw-BI" || "sw-KE" || "sw-RW" || "sw-TZ" || "sw-UG" || "tl-PH" || "tt-RU" || "ug-CN" || "uk-UA" || "uz-UZ" || "wo-SN" || "zu-ZA", * // MediaSampleRateHertz: Number("int"), * // MediaFormat: "mp3" || "mp4" || "wav" || "flac" || "ogg" || "amr" || "webm" || "m4a", diff --git a/clients/client-transcribe/src/models/models_0.ts b/clients/client-transcribe/src/models/models_0.ts index b47978f57175e..69a0405112bb8 100644 --- a/clients/client-transcribe/src/models/models_0.ts +++ b/clients/client-transcribe/src/models/models_0.ts @@ -91,6 +91,74 @@ export const BaseModelName = { */ export type BaseModelName = (typeof BaseModelName)[keyof typeof BaseModelName]; +/** + * @public + * @enum + */ +export const CallAnalyticsFeature = { + GENERATIVE_SUMMARIZATION: "GENERATIVE_SUMMARIZATION", +} as const; + +/** + * @public + */ +export type CallAnalyticsFeature = (typeof CallAnalyticsFeature)[keyof typeof CallAnalyticsFeature]; + +/** + * @public + * @enum + */ +export const CallAnalyticsSkippedReasonCode = { + FAILED_SAFETY_GUIDELINES: "FAILED_SAFETY_GUIDELINES", + INSUFFICIENT_CONVERSATION_CONTENT: "INSUFFICIENT_CONVERSATION_CONTENT", +} as const; + +/** + * @public + */ +export type CallAnalyticsSkippedReasonCode = + (typeof CallAnalyticsSkippedReasonCode)[keyof typeof CallAnalyticsSkippedReasonCode]; + +/** + *

Represents a skipped analytics feature during the analysis of a call analytics job.

+ *

The Feature field indicates the type of analytics feature that was skipped.

+ *

The Message field contains additional information or a message explaining why the analytics feature was skipped.

+ *

The ReasonCode field provides a code indicating the reason why the analytics feature was skipped.

+ * @public + */ +export interface CallAnalyticsSkippedFeature { + /** + *

Indicates the type of analytics feature that was skipped during the analysis of a call analytics job.

+ * @public + */ + Feature?: CallAnalyticsFeature; + + /** + *

Provides a code indicating the reason why a specific analytics feature was skipped during the analysis of a call analytics job.

+ * @public + */ + ReasonCode?: CallAnalyticsSkippedReasonCode; + + /** + *

Contains additional information or a message explaining why a specific analytics feature was skipped during the analysis of a call analytics job.

+ * @public + */ + Message?: string; +} + +/** + *

Contains details about a call analytics job, including information about skipped analytics features.

+ * @public + */ +export interface CallAnalyticsJobDetails { + /** + *

Contains information about any skipped analytics features during the analysis of a call analytics job.

+ *

This array lists all the analytics features that were skipped, along with their corresponding reason code and message.

+ * @public + */ + Skipped?: CallAnalyticsSkippedFeature[]; +} + /** * @public * @enum @@ -715,6 +783,12 @@ export interface CallAnalyticsJob { */ CallAnalyticsJobStatus?: CallAnalyticsJobStatus; + /** + *

Provides detailed information about a call analytics job, including information about skipped analytics features.

+ * @public + */ + CallAnalyticsJobDetails?: CallAnalyticsJobDetails; + /** *

The language code used to create your Call Analytics job. For a list of supported * languages and their associated language codes, refer to the Supported languages @@ -920,6 +994,12 @@ export interface CallAnalyticsJobSummary { */ CallAnalyticsJobStatus?: CallAnalyticsJobStatus; + /** + *

Provides detailed information about a call analytics job, including information about skipped analytics features.

+ * @public + */ + CallAnalyticsJobDetails?: CallAnalyticsJobDetails; + /** *

If CallAnalyticsJobStatus is FAILED, * FailureReason contains information about why the Call Analytics job diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index 5a4428be7e7d6..522dc90cf9b05 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -1970,6 +1970,7 @@ const de_NotFoundExceptionRes = async (parsedOutput: any, context: __SerdeContex */ const de_CallAnalyticsJob = (output: any, context: __SerdeContext): CallAnalyticsJob => { return take(output, { + CallAnalyticsJobDetails: _json, CallAnalyticsJobName: __expectString, CallAnalyticsJobStatus: __expectString, ChannelDefinitions: _json, @@ -1988,6 +1989,8 @@ const de_CallAnalyticsJob = (output: any, context: __SerdeContext): CallAnalytic }) as any; }; +// de_CallAnalyticsJobDetails omitted. + // de_CallAnalyticsJobSettings omitted. /** @@ -2007,6 +2010,7 @@ const de_CallAnalyticsJobSummaries = (output: any, context: __SerdeContext): Cal */ const de_CallAnalyticsJobSummary = (output: any, context: __SerdeContext): CallAnalyticsJobSummary => { return take(output, { + CallAnalyticsJobDetails: _json, CallAnalyticsJobName: __expectString, CallAnalyticsJobStatus: __expectString, CompletionTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), @@ -2017,6 +2021,10 @@ const de_CallAnalyticsJobSummary = (output: any, context: __SerdeContext): CallA }) as any; }; +// de_CallAnalyticsSkippedFeature omitted. + +// de_CallAnalyticsSkippedFeatureList omitted. + /** * deserializeAws_json1_1CategoryProperties */ diff --git a/codegen/sdk-codegen/aws-models/transcribe.json b/codegen/sdk-codegen/aws-models/transcribe.json index 7f7bdbdb142c5..770ea985ec819 100644 --- a/codegen/sdk-codegen/aws-models/transcribe.json +++ b/codegen/sdk-codegen/aws-models/transcribe.json @@ -141,6 +141,17 @@ } } }, + "com.amazonaws.transcribe#CallAnalyticsFeature": { + "type": "enum", + "members": { + "GENERATIVE_SUMMARIZATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GENERATIVE_SUMMARIZATION" + } + } + } + }, "com.amazonaws.transcribe#CallAnalyticsJob": { "type": "structure", "members": { @@ -156,6 +167,12 @@ "smithy.api#documentation": "

Provides the status of the specified Call Analytics job.

\n

If the status is COMPLETED, the job is finished and you can find the\n results at the location specified in TranscriptFileUri (or\n RedactedTranscriptFileUri, if you requested transcript redaction). If\n the status is FAILED, FailureReason provides details on why\n your transcription job failed.

" } }, + "CallAnalyticsJobDetails": { + "target": "com.amazonaws.transcribe#CallAnalyticsJobDetails", + "traits": { + "smithy.api#documentation": "

Provides detailed information about a call analytics job, including information about skipped analytics features.

" + } + }, "LanguageCode": { "target": "com.amazonaws.transcribe#LanguageCode", "traits": { @@ -236,6 +253,20 @@ "smithy.api#documentation": "

Provides detailed information about a Call Analytics job.

\n

To view the job's status, refer to CallAnalyticsJobStatus. If the status\n is COMPLETED, the job is finished. You can find your completed transcript\n at the URI specified in TranscriptFileUri. If the status is\n FAILED, FailureReason provides details on why your\n transcription job failed.

\n

If you enabled personally identifiable information (PII) redaction, the redacted\n transcript appears at the location specified in\n RedactedTranscriptFileUri.

\n

If you chose to redact the audio in your media file, you can find your redacted media\n file at the location specified in the RedactedMediaFileUri field of your\n response.

" } }, + "com.amazonaws.transcribe#CallAnalyticsJobDetails": { + "type": "structure", + "members": { + "Skipped": { + "target": "com.amazonaws.transcribe#CallAnalyticsSkippedFeatureList", + "traits": { + "smithy.api#documentation": "

Contains information about any skipped analytics features during the analysis of a call analytics job.

\n

This array lists all the analytics features that were skipped, along with their corresponding reason code and message.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains details about a call analytics job, including information about skipped analytics features.

" + } + }, "com.amazonaws.transcribe#CallAnalyticsJobName": { "type": "string", "traits": { @@ -373,6 +404,12 @@ "smithy.api#documentation": "

Provides the status of your Call Analytics job.

\n

If the status is COMPLETED, the job is finished and you can find the\n results at the location specified in TranscriptFileUri (or\n RedactedTranscriptFileUri, if you requested transcript redaction). If\n the status is FAILED, FailureReason provides details on why\n your transcription job failed.

" } }, + "CallAnalyticsJobDetails": { + "target": "com.amazonaws.transcribe#CallAnalyticsJobDetails", + "traits": { + "smithy.api#documentation": "

Provides detailed information about a call analytics job, including information about skipped analytics features.

" + } + }, "FailureReason": { "target": "com.amazonaws.transcribe#FailureReason", "traits": { @@ -384,6 +421,55 @@ "smithy.api#documentation": "

Provides detailed information about a specific Call Analytics job.

" } }, + "com.amazonaws.transcribe#CallAnalyticsSkippedFeature": { + "type": "structure", + "members": { + "Feature": { + "target": "com.amazonaws.transcribe#CallAnalyticsFeature", + "traits": { + "smithy.api#documentation": "

Indicates the type of analytics feature that was skipped during the analysis of a call analytics job.

" + } + }, + "ReasonCode": { + "target": "com.amazonaws.transcribe#CallAnalyticsSkippedReasonCode", + "traits": { + "smithy.api#documentation": "

Provides a code indicating the reason why a specific analytics feature was skipped during the analysis of a call analytics job.

" + } + }, + "Message": { + "target": "com.amazonaws.transcribe#String", + "traits": { + "smithy.api#documentation": "

Contains additional information or a message explaining why a specific analytics feature was skipped during the analysis of a call analytics job.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a skipped analytics feature during the analysis of a call analytics job.

\n

The Feature field indicates the type of analytics feature that was skipped.

\n

The Message field contains additional information or a message explaining why the analytics feature was skipped.

\n

The ReasonCode field provides a code indicating the reason why the analytics feature was skipped.

" + } + }, + "com.amazonaws.transcribe#CallAnalyticsSkippedFeatureList": { + "type": "list", + "member": { + "target": "com.amazonaws.transcribe#CallAnalyticsSkippedFeature" + } + }, + "com.amazonaws.transcribe#CallAnalyticsSkippedReasonCode": { + "type": "enum", + "members": { + "INSUFFICIENT_CONVERSATION_CONTENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INSUFFICIENT_CONVERSATION_CONTENT" + } + }, + "FAILED_SAFETY_GUIDELINES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED_SAFETY_GUIDELINES" + } + } + } + }, "com.amazonaws.transcribe#CategoryName": { "type": "string", "traits": { @@ -3927,7 +4013,7 @@ "traits": { "smithy.api#range": { "min": 2, - "max": 10 + "max": 30 } } },