Skip to content

Commit c7e5251

Browse files
Add Post-Call Transcription and Summarization Features (Azure#49543)
* added transcription and summarization * fixed lambda test * fixed lambda test * update api spec * remove abstract keyword * made properties internal * set to alpha4 swagger * update test * update test * updated changelog
1 parent c836f73 commit c7e5251

File tree

50 files changed

+1086
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1086
-59
lines changed

sdk/communication/Azure.Communication.CallAutomation/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Features Added
66

7+
- Added support for post-call processing options, including summarization and transcription.
8+
79
### Breaking Changes
810

911
### Bugs Fixed

sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.net8.0.cs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public static partial class CallAutomationModelFactory
257257
public static Azure.Communication.CallAutomation.SendDtmfTonesCompleted SendDtmfTonesCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
258258
public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
259259
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
260-
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
260+
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null, double? confidence = default(double?)) { throw null; }
261261
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
262262
public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
263263
public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
@@ -446,7 +446,7 @@ protected CallMedia() { }
446446
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
447447
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
448448
public virtual Azure.Response UpdateTranscription(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
449-
public virtual Azure.Response UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
449+
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
450450
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
451451
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
452452
}
@@ -1402,6 +1402,14 @@ public PlayToAllOptions(System.Collections.Generic.IEnumerable<Azure.Communicati
14021402
public string OperationContext { get { throw null; } set { } }
14031403
public System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.PlaySource> PlaySources { get { throw null; } }
14041404
}
1405+
public partial class PostProcessingOptions
1406+
{
1407+
public PostProcessingOptions(Azure.Communication.CallAutomation.TranscriptionSettings transcription) { }
1408+
public PostProcessingOptions(string cognitiveServicesEndpoint, Azure.Communication.CallAutomation.SummarizationSettings summarization = null, Azure.Communication.CallAutomation.TranscriptionSettings transcription = null) { }
1409+
public string CognitiveServicesEndpoint { get { throw null; } set { } }
1410+
public void setSummarizationSettings(bool enableSummarization) { }
1411+
public void setTranscriptionSettings(bool enableTranscription) { }
1412+
}
14051413
public partial class PowerVirtualAgentsDialog : Azure.Communication.CallAutomation.BaseDialog
14061414
{
14071415
public PowerVirtualAgentsDialog(string botAppId, System.Collections.Generic.IDictionary<string, object> context, string language = null) : base (default(System.Collections.Generic.IDictionary<string, object>)) { }
@@ -1741,6 +1749,7 @@ public ServerCallLocator(string id) { }
17411749
public partial class SpeechResult : Azure.Communication.CallAutomation.RecognizeResult
17421750
{
17431751
internal SpeechResult() { }
1752+
public double? Confidence { get { throw null; } }
17441753
public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } }
17451754
public string Speech { get { throw null; } }
17461755
}
@@ -1799,6 +1808,7 @@ public StartRecordingOptions(string callConnectionId) { }
17991808
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
18001809
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
18011810
public bool PauseOnStart { get { throw null; } set { } }
1811+
public Azure.Communication.CallAutomation.PostProcessingOptions PostProcessingOptions { get { throw null; } set { } }
18021812
public Azure.Communication.CallAutomation.RecordingChannel RecordingChannel { get { throw null; } set { } }
18031813
public Azure.Communication.CallAutomation.RecordingContent RecordingContent { get { throw null; } set { } }
18041814
public Azure.Communication.CallAutomation.RecordingFormat RecordingFormat { get { throw null; } set { } }
@@ -1851,6 +1861,18 @@ public enum StreamingDataKind
18511861
TranscriptionData = 2,
18521862
TranscriptionMetadata = 3,
18531863
}
1864+
public partial class SummarizationSettings
1865+
{
1866+
public SummarizationSettings(bool enableSummarization) { }
1867+
public bool EnableSummarization { get { throw null; } }
1868+
}
1869+
public partial class TeamsExtensionUserIdentifierModel
1870+
{
1871+
public TeamsExtensionUserIdentifierModel(string userId, string tenantId, string resourceId) { }
1872+
public string ResourceId { get { throw null; } set { } }
1873+
public string TenantId { get { throw null; } set { } }
1874+
public string UserId { get { throw null; } set { } }
1875+
}
18541876
public enum TextFormat
18551877
{
18561878
Display = 0,
@@ -1925,6 +1947,11 @@ public partial class TranscriptionOptions
19251947
public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; }
19261948
public override string ToString() { throw null; }
19271949
}
1950+
public partial class TranscriptionSettings
1951+
{
1952+
public TranscriptionSettings(bool enableTranscription) { }
1953+
public bool EnableTranscription { get { throw null; } }
1954+
}
19281955
public partial class TranscriptionStarted : Azure.Communication.CallAutomation.CallAutomationEventBase
19291956
{
19301957
internal TranscriptionStarted() { }

sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public static partial class CallAutomationModelFactory
257257
public static Azure.Communication.CallAutomation.SendDtmfTonesCompleted SendDtmfTonesCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
258258
public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
259259
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
260-
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
260+
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null, double? confidence = default(double?)) { throw null; }
261261
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
262262
public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
263263
public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
@@ -446,7 +446,7 @@ protected CallMedia() { }
446446
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
447447
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
448448
public virtual Azure.Response UpdateTranscription(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
449-
public virtual Azure.Response UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
449+
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
450450
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
451451
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
452452
}
@@ -1401,6 +1401,14 @@ public PlayToAllOptions(System.Collections.Generic.IEnumerable<Azure.Communicati
14011401
public string OperationContext { get { throw null; } set { } }
14021402
public System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.PlaySource> PlaySources { get { throw null; } }
14031403
}
1404+
public partial class PostProcessingOptions
1405+
{
1406+
public PostProcessingOptions(Azure.Communication.CallAutomation.TranscriptionSettings transcription) { }
1407+
public PostProcessingOptions(string cognitiveServicesEndpoint, Azure.Communication.CallAutomation.SummarizationSettings summarization = null, Azure.Communication.CallAutomation.TranscriptionSettings transcription = null) { }
1408+
public string CognitiveServicesEndpoint { get { throw null; } set { } }
1409+
public void setSummarizationSettings(bool enableSummarization) { }
1410+
public void setTranscriptionSettings(bool enableTranscription) { }
1411+
}
14041412
public partial class PowerVirtualAgentsDialog : Azure.Communication.CallAutomation.BaseDialog
14051413
{
14061414
public PowerVirtualAgentsDialog(string botAppId, System.Collections.Generic.IDictionary<string, object> context, string language = null) : base (default(System.Collections.Generic.IDictionary<string, object>)) { }
@@ -1740,6 +1748,7 @@ public ServerCallLocator(string id) { }
17401748
public partial class SpeechResult : Azure.Communication.CallAutomation.RecognizeResult
17411749
{
17421750
internal SpeechResult() { }
1751+
public double? Confidence { get { throw null; } }
17431752
public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } }
17441753
public string Speech { get { throw null; } }
17451754
}
@@ -1798,6 +1807,7 @@ public StartRecordingOptions(string callConnectionId) { }
17981807
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
17991808
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
18001809
public bool PauseOnStart { get { throw null; } set { } }
1810+
public Azure.Communication.CallAutomation.PostProcessingOptions PostProcessingOptions { get { throw null; } set { } }
18011811
public Azure.Communication.CallAutomation.RecordingChannel RecordingChannel { get { throw null; } set { } }
18021812
public Azure.Communication.CallAutomation.RecordingContent RecordingContent { get { throw null; } set { } }
18031813
public Azure.Communication.CallAutomation.RecordingFormat RecordingFormat { get { throw null; } set { } }
@@ -1850,6 +1860,18 @@ public enum StreamingDataKind
18501860
TranscriptionData = 2,
18511861
TranscriptionMetadata = 3,
18521862
}
1863+
public partial class SummarizationSettings
1864+
{
1865+
public SummarizationSettings(bool enableSummarization) { }
1866+
public bool EnableSummarization { get { throw null; } }
1867+
}
1868+
public partial class TeamsExtensionUserIdentifierModel
1869+
{
1870+
public TeamsExtensionUserIdentifierModel(string userId, string tenantId, string resourceId) { }
1871+
public string ResourceId { get { throw null; } set { } }
1872+
public string TenantId { get { throw null; } set { } }
1873+
public string UserId { get { throw null; } set { } }
1874+
}
18531875
public enum TextFormat
18541876
{
18551877
Display = 0,
@@ -1924,6 +1946,11 @@ public partial class TranscriptionOptions
19241946
public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; }
19251947
public override string ToString() { throw null; }
19261948
}
1949+
public partial class TranscriptionSettings
1950+
{
1951+
public TranscriptionSettings(bool enableTranscription) { }
1952+
public bool EnableTranscription { get { throw null; } }
1953+
}
19271954
public partial class TranscriptionStarted : Azure.Communication.CallAutomation.CallAutomationEventBase
19281955
{
19291956
internal TranscriptionStarted() { }

sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,14 +1361,18 @@ public virtual async Task<Response> StopTranscriptionAsync(StopTranscriptionOpti
13611361
/// <param name="locale">Defines new locale for transcription.</param>
13621362
/// <param name="cancellationToken">An optional CancellationToken to cancel the request.</param>
13631363
/// <returns>Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error.</returns>
1364-
public virtual Response UpdateTranscription(string locale, CancellationToken cancellationToken = default)
1364+
public virtual async Task<Response> UpdateTranscription(string locale, CancellationToken cancellationToken = default)
13651365
{
13661366
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UpdateTranscription)}");
13671367
scope.Start();
13681368
try
13691369
{
1370-
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(locale);
1371-
return CallMediaRestClient.UpdateTranscription(CallConnectionId, request, cancellationToken);
1370+
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(
1371+
locale: locale,
1372+
speechModelEndpointId: null,
1373+
operationContext: null,
1374+
operationCallbackUri: null);
1375+
return await CallMediaRestClient.UpdateTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false);
13721376
}
13731377
catch (Exception ex)
13741378
{
@@ -1412,7 +1416,11 @@ public virtual async Task<Response> UpdateTranscriptionAsync(string locale, Canc
14121416
scope.Start();
14131417
try
14141418
{
1415-
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(locale);
1419+
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(
1420+
locale: locale,
1421+
speechModelEndpointId: null,
1422+
operationContext: null,
1423+
operationCallbackUri: null);
14161424
return await CallMediaRestClient.UpdateTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false);
14171425
}
14181426
catch (Exception ex)

sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public virtual Response<RecordingStateResult> Start(StartRecordingOptions option
6161
RecordingChannelType = options.RecordingChannel,
6262
RecordingContentType = options.RecordingContent,
6363
RecordingFormatType = options.RecordingFormat,
64-
PauseOnStart = options.PauseOnStart
64+
PauseOnStart = options.PauseOnStart,
65+
PostProcessingOptions = options.PostProcessingOptions,
6566
};
6667

6768
if (options.CallLocator != null)
@@ -132,7 +133,8 @@ public virtual async Task<Response<RecordingStateResult>> StartAsync(StartRecord
132133
RecordingChannelType = options.RecordingChannel,
133134
RecordingContentType = options.RecordingContent,
134135
RecordingFormatType = options.RecordingFormat,
135-
PauseOnStart = options.PauseOnStart
136+
PauseOnStart = options.PauseOnStart,
137+
PostProcessingOptions = options.PostProcessingOptions,
136138
};
137139

138140
if (options.CallLocator != null)

sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallAutomationModelFactory.cs

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)