From 0f35e48ff28048f88a8601d8ff1c71db515fb16d Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Thu, 4 Feb 2021 13:30:36 -0800 Subject: [PATCH] [TA] Implement Pageable actions (#18371) --- .../Azure.AI.TextAnalytics/README.md | 79 +- .../Azure.AI.TextAnalytics.netstandard2.0.cs | 10 +- .../samples/Sample_AnalyzeOperation.md | 79 +- .../src/AnalyzeHealthcareEntitiesOperation.cs | 55 +- .../src/AnalyzeOperation.cs | 138 ++- .../src/PageableOperation.cs | 6 +- .../src/TextAnalyticsClient.cs | 14 +- .../src/TextAnalyticsRestClient.cs | 78 ++ .../tests/AnalyzeOperationTests.cs | 94 +- .../AnalyzeOperationWithPagination.json | 929 ++++++++++++++++++ .../AnalyzeOperationWithPaginationAsync.json | 888 +++++++++++++++++ .../AnalyzeOperationWithSkipParameter.json | 245 ----- ...nalyzeOperationWithSkipParameterAsync.json | 204 ---- .../AnalyzeOperationWithTopParameter.json | 248 ----- ...AnalyzeOperationWithTopParameterAsync.json | 289 ------ .../tests/samples/Sample_AnalyzeOperation.cs | 79 +- .../samples/Sample_AnalyzeOperationAsync.cs | 79 +- ..._AnalyzeOperationAsync_AutomaticPolling.cs | 79 +- ...ple_AnalyzeOperationAsync_ManualPolling.cs | 79 +- ...Sample_AnalyzeOperationBatchConvenience.cs | 79 +- ...e_AnalyzeOperationBatchConvenienceAsync.cs | 79 +- 21 files changed, 2413 insertions(+), 1417 deletions(-) create mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPagination.json create mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPaginationAsync.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameter.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameterAsync.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameter.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameterAsync.json diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md index 6aca7df05997c..7e0cede5f9eae 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md @@ -505,59 +505,60 @@ The Analyze functionality allows to choose which of the supported Text Analytics await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; + foreach (AnalyzeOperationResult documentsInPage in operation.GetValues()) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - Console.WriteLine("Recognized Entities"); + Console.WriteLine("Recognized Entities"); - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); - - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); - } - Console.WriteLine(""); - } + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); - Console.WriteLine("Recognized PII Entities"); + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); + } - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + Console.WriteLine("Recognized PII Entities"); - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); - } - Console.WriteLine(""); - } + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - Console.WriteLine("Key Phrases"); + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); + } - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + Console.WriteLine("Key Phrases"); - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } ``` diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs index 7b27ca05276e8..c886dd3defc5b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs @@ -37,18 +37,20 @@ internal AnalyzeHealthcareEntitiesResultCollection() : base (default(System.Coll public string ModelVersion { get { throw null; } } public Azure.AI.TextAnalytics.TextDocumentBatchStatistics Statistics { get { throw null; } } } - public partial class AnalyzeOperation : Azure.Operation + public partial class AnalyzeOperation : Azure.AI.TextAnalytics.PageableOperation { public AnalyzeOperation(string operationId, Azure.AI.TextAnalytics.TextAnalyticsClient client) { } public override bool HasCompleted { get { throw null; } } public override bool HasValue { get { throw null; } } public override string Id { get { throw null; } } - public override Azure.AI.TextAnalytics.AnalyzeOperationResult Value { get { throw null; } } + public override Azure.AsyncPageable Value { get { throw null; } } public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Pageable GetValues() { throw null; } + public override Azure.AsyncPageable GetValuesAsync() { throw null; } public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class AnalyzeOperationOptions : Azure.AI.TextAnalytics.TextAnalyticsRequestOptions { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_AnalyzeOperation.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_AnalyzeOperation.md index 422bd577174cf..3bafa44cd2ad7 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_AnalyzeOperation.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_AnalyzeOperation.md @@ -41,59 +41,60 @@ To run analyze operation in multiple documents, call `StartAnalyzeOperationBatch await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + foreach (AnalyzeOperationResult documentsInPage in operation.GetValues()) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } ``` diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs index 2019a87be8aeb..490cddc2d0823 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs @@ -42,7 +42,7 @@ public class AnalyzeHealthcareEntitiesOperation : PageableOperation _status; /// - /// Gets the final result of the long-running operation in a synchronous way. + /// Gets the final result of the long-running operation asynchronously. /// /// /// This property can be accessed only after the operation completes successfully (HasValue is true). @@ -59,25 +59,50 @@ public class AnalyzeHealthcareEntitiesOperation : PageableOperation public override bool HasValue => _firstPage != null; - /// Provides communication with the Text Analytics Azure Cognitive Service through its REST API. + /// + /// Provides communication with the Text Analytics Azure Cognitive Service through its REST API. + /// private readonly TextAnalyticsRestClient _serviceClient; - /// Provides tools for exception creation in case of failure. + /// + /// Provides tools for exception creation in case of failure. + /// private readonly ClientDiagnostics _diagnostics; - /// true if the long-running operation has completed. Otherwise, false. + /// + /// true if the long-running operation has completed. Otherwise, false. + /// private bool _hasCompleted; + /// + /// Represents the status of the long-running operation. + /// private TextAnalyticsOperationStatus _status; + /// + /// If the operation has an exception, this property saves its information. + /// private RequestFailedException _requestFailedException; + /// + /// Represents the HTTP response from the service. + /// private Response _response; + /// + /// Provides the results for the first page. + /// private Page _firstPage; + /// + /// Represents the desire of the user to request statistics. + /// This is used in every GET request. + /// private readonly bool? _showStats; + /// + /// Provides the api version to use when doing pagination. + /// private readonly string _apiVersion; /// @@ -294,17 +319,14 @@ public virtual async Task CancelAsync(CancellationToken cancellationToken = defa } /// - /// Gets the final result of the long-running operation in an asynchronous way. + /// Gets the final result of the long-running operation asynchronously. /// /// /// Operation must complete successfully (HasValue is true) for it to provide values. /// public override AsyncPageable GetValuesAsync() { - if (!HasCompleted) - throw new InvalidOperationException("The operation has not completed yet."); - if (HasCompleted && !HasValue) - throw _requestFailedException; + ValidateOperationStatus(); async Task> NextPageFunc(string nextLink, int? pageSizeHint) { @@ -326,17 +348,14 @@ async Task> NextPageFunc(string } /// - /// Gets the final result of the long-running operation in an asynchronous way. + /// Gets the final result of the long-running operation in synchronously. /// /// /// Operation must complete successfully (HasValue is true) for it to provide values. /// public override Pageable GetValues() { - if (!HasCompleted) - throw new InvalidOperationException("The operation has not completed yet."); - if (HasCompleted && !HasValue) - throw _requestFailedException; + ValidateOperationStatus(); Page NextPageFunc(string nextLink, int? pageSizeHint) { @@ -356,5 +375,13 @@ Page NextPageFunc(string nextLink, in return PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc); } + + private void ValidateOperationStatus() + { + if (!HasCompleted) + throw new InvalidOperationException("The operation has not completed yet."); + if (!HasValue) + throw _requestFailedException; + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeOperation.cs index a008cf87716ca..53b6e09c0cda9 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeOperation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeOperation.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics { /// The AnalyzeOperation class for LRO. - public class AnalyzeOperation : Operation + public class AnalyzeOperation : PageableOperation { /// Provides communication with the Form Recognizer Azure Cognitive Service through its REST API. private readonly TextAnalyticsRestClient _serviceClient; @@ -27,11 +27,6 @@ public class AnalyzeOperation : Operation /// public override string Id { get; } - /// - /// next link string for pagination - /// - internal string NextLink { get; set; } - /// /// Provides the input to be part of AnalyzeOperation class /// @@ -43,22 +38,11 @@ public class AnalyzeOperation : Operation /// /// This property can be accessed only after the operation completes successfully (HasValue is true). /// - public override AnalyzeOperationResult Value - { - get - { - if (HasCompleted && !HasValue) -#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations - throw _requestFailedException; -#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations - else - { - return OperationHelpers.GetValue(ref _value); - } - } - } + public override AsyncPageable Value => GetValuesAsync(); - /// true if the long-running operation has completed. Otherwise, false. + /// + /// true if the long-running operation has completed. Otherwise, false. + /// private bool _hasCompleted; /// @@ -66,22 +50,36 @@ public override AnalyzeOperationResult Value /// public override bool HasCompleted => _hasCompleted; + /// + /// If the operation has an exception, this property saves its information. + /// private RequestFailedException _requestFailedException; - /// The last HTTP response received from the server. null until the first response is received. + /// + /// The last HTTP response received from the server. null until the first response is received. + /// private Response _response; - /// The result of the long-running operation. null until result is received on status update. - private AnalyzeOperationResult _value; + /// + /// Provides the results for the first page. + /// + private Page _firstPage; - private int? _top { get; } - private int? _skip { get; } + /// + /// Represents the desire of the user to request statistics. + /// This is used in every GET request. + /// private bool? _showStats { get; } + /// + /// Provides the api version to use when doing pagination. + /// + private readonly string _apiVersion; + /// /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). /// - public override bool HasValue => _value != null; + public override bool HasValue => _firstPage != null; /// /// Initializes a new instance of the class. @@ -102,18 +100,16 @@ public AnalyzeOperation(string operationId, TextAnalyticsClient client) /// /// The client for communicating with the Form Recognizer Azure Cognitive Service through its REST API. /// The client diagnostics for exception creation in case of failure. + /// The specific api version to use. /// The address of the long-running operation. It can be obtained from the response headers upon starting the operation. /// - /// - /// /// - internal AnalyzeOperation(TextAnalyticsRestClient serviceClient, ClientDiagnostics diagnostics, string operationLocation, IDictionary idToIndexMap, int? top = default, int? skip = default, bool? showStats = default) + internal AnalyzeOperation(TextAnalyticsRestClient serviceClient, ClientDiagnostics diagnostics, string apiversion, string operationLocation, IDictionary idToIndexMap, bool? showStats = default) { _serviceClient = serviceClient; _diagnostics = diagnostics; + _apiVersion = apiversion; _idToIndexMap = idToIndexMap; - _top = top; - _skip = skip; _showStats = showStats; // TODO: Add validation here @@ -161,7 +157,7 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + public override ValueTask>> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); /// @@ -177,7 +173,7 @@ public override ValueTask> WaitForCompletionAsy /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => + public override ValueTask>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); /// @@ -203,10 +199,10 @@ private async ValueTask UpdateStatusAsync(bool async, CancellationToke if (update.Value.Status == TextAnalyticsOperationStatus.Succeeded) { - // we need to first assign a vaue and then mark the operation as completed to avoid race conditions - _value = Transforms.ConvertToAnalyzeOperationResult(update.Value, _idToIndexMap); - - NextLink = update.Value.NextLink; + // we need to first assign a value and then mark the operation as completed to avoid race conditions + var nextLink = update.Value.NextLink; + var value = Transforms.ConvertToAnalyzeOperationResult(update.Value, _idToIndexMap); + _firstPage = Page.FromValues(new List() { value }, nextLink, _response); _hasCompleted = true; } else if (update.Value.Status == TextAnalyticsOperationStatus.Failed) @@ -225,5 +221,71 @@ private async ValueTask UpdateStatusAsync(bool async, CancellationToke return GetRawResponse(); } + + /// + /// Gets the final result of the long-running operation asynchronously. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public override AsyncPageable GetValuesAsync() + { + ValidateOperationStatus(); + + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + //diagnostics scope? + try + { + Response jobState = await _serviceClient.AnalyzeStatusNextPageAsync(_apiVersion, nextLink, _showStats).ConfigureAwait(false); + + AnalyzeOperationResult result = Transforms.ConvertToAnalyzeOperationResult(jobState.Value, _idToIndexMap); + return Page.FromValues(new List() { result }, jobState.Value.NextLink, jobState.GetRawResponse()); + } + catch (Exception) + { + throw; + } + } + + return PageableHelpers.CreateAsyncEnumerable(_ => Task.FromResult(_firstPage), NextPageFunc); + } + + /// + /// Gets the final result of the long-running operation synchronously. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public override Pageable GetValues() + { + ValidateOperationStatus(); + + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + //diagnostics scope? + try + { + Response jobState = _serviceClient.AnalyzeStatusNextPage(_apiVersion, nextLink, _showStats); + + AnalyzeOperationResult result = Transforms.ConvertToAnalyzeOperationResult(jobState.Value, _idToIndexMap); + return Page.FromValues(new List() { result }, jobState.Value.NextLink, jobState.GetRawResponse()); + } + catch (Exception) + { + throw; + } + } + + return PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc); + } + + private void ValidateOperationStatus() + { + if (!HasCompleted) + throw new InvalidOperationException("The operation has not completed yet."); + if (!HasValue) + throw _requestFailedException; + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs index 3ad71e40a813f..ad306e2108738 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs @@ -15,7 +15,7 @@ namespace Azure.AI.TextAnalytics public abstract class PageableOperation : Operation> where T : notnull { /// - /// Gets the final result of the long-running operation in a synchronous way. + /// Gets the final result of the long-running operation asynchronously. /// /// /// This property can be accessed only after the operation completes successfully (HasValue is true). @@ -23,7 +23,7 @@ public abstract class PageableOperation : Operation> where T public override AsyncPageable Value => GetValuesAsync(); /// - /// Gets the final result of the long-running operation in an asynchronous way. + /// Gets the final result of the long-running operation asynchronously. /// /// /// Operation must complete successfully (HasValue is true) for it to provide values. @@ -31,7 +31,7 @@ public abstract class PageableOperation : Operation> where T public abstract AsyncPageable GetValuesAsync(); /// - /// Gets the final result of the long-running operation in an asynchronous way. + /// Gets the final result of the long-running operation synchronously. /// /// /// Operation must complete successfully (HasValue is true) for it to provide values. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs index bc4e162e2a11b..d156b213884c0 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs @@ -2408,17 +2408,12 @@ private AnalyzeOperation StartAnalyzeOperationBatch(MultiLanguageBatchInput batc try { - // TODO - Add Top and Skip once pagination is implemented for Analyze operation - // Github issue - https://github.com/Azure/azure-sdk-for-net/issues/16958 - int _top = default; - int _skip = default; - ResponseWithHeaders response = _serviceRestClient.Analyze(analyzeDocumentInputs, cancellationToken); string location = response.Headers.OperationLocation; IDictionary idToIndexMap = CreateIdToIndexMap(batchInput.Documents); - return new AnalyzeOperation(_serviceRestClient, _clientDiagnostics, location, idToIndexMap, _top, _skip, options.IncludeStatistics); + return new AnalyzeOperation(_serviceRestClient, _clientDiagnostics, _options.GetVersionString(), location, idToIndexMap, options.IncludeStatistics); } catch (Exception e) { @@ -2451,17 +2446,12 @@ private async Task StartAnalyzeOperationBatchAsync(MultiLangua try { - // TODO - Add Top and Skip once pagination is implemented for Analyze operation - // Github issue - https://github.com/Azure/azure-sdk-for-net/issues/16958 - int _top = default; - int _skip = default; - ResponseWithHeaders response = await _serviceRestClient.AnalyzeAsync(analyzeDocumentInputs, cancellationToken).ConfigureAwait(false); string location = response.Headers.OperationLocation; IDictionary idToIndexMap = CreateIdToIndexMap(batchInput.Documents); - return new AnalyzeOperation(_serviceRestClient, _clientDiagnostics, location, idToIndexMap, _top, _skip, options.IncludeStatistics); + return new AnalyzeOperation(_serviceRestClient, _clientDiagnostics, _options.GetVersionString(), location, idToIndexMap, options.IncludeStatistics); } catch (Exception e) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs index dec97d7dc0702..eeb9d862a4d89 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs @@ -86,5 +86,83 @@ public Response HealthStatusNextPage(string apiversion, stri throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } + + internal HttpMessage CreateAnalyzeStatusNextPageRequest(string apiversion, string nextLink, bool? showStats) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendRaw("/text/analytics/", false); + uri.AppendRaw(apiversion, false); + uri.AppendPath("/analyze/jobs/", false); + uri.AppendRawNextLink(nextLink, false); + if (showStats != null) + { + uri.AppendQuery("showStats", showStats.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json, text/json"); + return message; + } + + /// Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task. + /// The specific api version to use. + /// The URL to the next page of results. + /// (Optional) if set to true, response will contain request and document level statistics. + /// The cancellation token to use. + /// is null. + public async Task> AnalyzeStatusNextPageAsync(string apiVersion, string nextLink, bool? showStats = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateAnalyzeStatusNextPageRequest(apiVersion, nextLink, showStats); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AnalyzeJobState value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AnalyzeJobState.DeserializeAnalyzeJobState(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task. + /// The specific api version to use. + /// The URL to the next page of results. + /// (Optional) if set to true, response will contain request and document level statistics. + /// The cancellation token to use. + /// is null. + public Response AnalyzeStatusNextPage(string apiVersion, string nextLink, bool? showStats = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateAnalyzeStatusNextPageRequest(apiVersion, nextLink, showStats); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AnalyzeJobState value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AnalyzeJobState.DeserializeAnalyzeJobState(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs index b53dcc8349936..4e42d44c7c67c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Azure.AI.TextAnalytics.Models; +using Azure.Core.TestFramework; using NUnit.Framework; namespace Azure.AI.TextAnalytics.Tests @@ -45,7 +47,8 @@ public async Task AnalyzeOperationWithAADTest() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); IReadOnlyList entityRecognitionTasksItemCollection = resultCollection.Tasks.EntityRecognitionTasks; IReadOnlyList entityRecognitionPiiTasksItemCollection = resultCollection.Tasks.EntityRecognitionPiiTasks; @@ -72,7 +75,8 @@ public async Task AnalyzeOperationTest() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); IReadOnlyList entityRecognitionTasksItemCollection = resultCollection.Tasks.EntityRecognitionTasks; IReadOnlyList entityRecognitionPiiTasksItemCollection = resultCollection.Tasks.EntityRecognitionPiiTasks; @@ -126,7 +130,8 @@ public async Task AnalyzeOperationWithLanguageTest() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; @@ -179,7 +184,8 @@ public async Task AnalyzeOperationWithMultipleTasks() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; @@ -233,69 +239,59 @@ public async Task AnalyzeOperationWithMultipleTasks() } [Test] - [Ignore("Will add this once the pagination is implemented for AnalyzeOperation - https://github.com/Azure/azure-sdk-for-net/issues/16958")] - public async Task AnalyzeOperationWithSkipParameter() + public async Task AnalyzeOperationWithPagination() { TextAnalyticsClient client = GetClient(); - AnalyzeOperationOptions operationOptions = new AnalyzeOperationOptions() - { - KeyPhrasesTaskParameters = new KeyPhrasesTaskParameters(), - DisplayName = "AnalyzeOperationWithSkipParameter", - //Skip = 1 - }; - - AnalyzeOperation operation = await client.StartAnalyzeOperationBatchAsync(batchConvenienceDocuments, operationOptions, "en"); - - await operation.WaitForCompletionAsync(PollingInterval); - - AnalyzeOperationResult resultCollection = operation.Value; - - ExtractKeyPhrasesResultCollection result = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; - - Assert.IsNotNull(result); - - Assert.AreEqual(1, result.Count); - - var keyPhrasesListId2 = new List { "Tesla stock", "year" }; + List documents = new (); - foreach (string keyphrase in result[0].KeyPhrases) + for (int i = 0; i < 23; i++) { - Assert.IsTrue(keyPhrasesListId2.Contains(keyphrase)); + documents.Add("Elon Musk is the CEO of SpaceX and Tesla."); } - } - - [Test] - [Ignore("Will add this once the pagination is implemented for AnalyzeOperation - https://github.com/Azure/azure-sdk-for-net/issues/16958")] - public async Task AnalyzeOperationWithTopParameter() - { - TextAnalyticsClient client = GetClient(); AnalyzeOperationOptions operationOptions = new AnalyzeOperationOptions() { KeyPhrasesTaskParameters = new KeyPhrasesTaskParameters(), DisplayName = "AnalyzeOperationWithSkipParameter", - //Top = 1 }; - AnalyzeOperation operation = await client.StartAnalyzeOperationBatchAsync(batchConvenienceDocuments, operationOptions, "en"); + AnalyzeOperation operation = await client.StartAnalyzeOperationBatchAsync(documents, operationOptions); + + Assert.IsFalse(operation.HasCompleted); + Assert.IsFalse(operation.HasValue); + + Assert.ThrowsAsync(async () => await Task.Run(() => operation.Value)); + Assert.Throws(() => operation.GetValues()); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + Assert.IsTrue(operation.HasCompleted); + Assert.IsTrue(operation.HasValue); - ExtractKeyPhrasesResultCollection result = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + await operation.WaitForCompletionAsync(PollingInterval); - Assert.IsNotNull(result); + // try async + //There most be 2 pages as service limit is 20 documents per page + List asyncPages = operation.Value.ToEnumerableAsync().Result; + Assert.AreEqual(2, asyncPages.Count); - Assert.AreEqual(1, result.Count); + // First page should have 20 results + Assert.AreEqual(20, asyncPages[0].Tasks.KeyPhraseExtractionTasks.FirstOrDefault().Results.Count); - var keyPhrasesListId1 = new List { "CEO of SpaceX", "Elon Musk", "Tesla" }; + // Second page should have remaining 3 results + Assert.AreEqual(3, asyncPages[1].Tasks.KeyPhraseExtractionTasks.FirstOrDefault().Results.Count); - foreach (string keyphrase in result[0].KeyPhrases) - { - Assert.IsTrue(keyPhrasesListId1.Contains(keyphrase)); - } + // try sync + //There most be 2 pages as service limit is 20 documents per page + List pages = operation.GetValues().AsEnumerable().ToList(); + Assert.AreEqual(2, pages.Count); + + // First page should have 20 results + Assert.AreEqual(20, pages[0].Tasks.KeyPhraseExtractionTasks.FirstOrDefault().Results.Count); + + // Second page should have remaining 3 results + Assert.AreEqual(3, pages[1].Tasks.KeyPhraseExtractionTasks.FirstOrDefault().Results.Count); } [Test] @@ -352,7 +348,8 @@ public async Task AnalyzeOperationBatchWithPHIDomain() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); RecognizePiiEntitiesResultCollection result = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results;; @@ -397,7 +394,8 @@ public async Task AnalyzeOperationBatchWithStatisticsTest() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; + //Take the first page + AnalyzeOperationResult resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); ExtractKeyPhrasesResultCollection result = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPagination.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPagination.json new file mode 100644 index 0000000000000..e6b236667330b --- /dev/null +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPagination.json @@ -0,0 +1,929 @@ +{ + "Entries": [ + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Content-Length": "1971", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-f013a7b410b52f4da8f0a896abc7a399-5c6364d17cdb3c42-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "5a3d6c2348d829c15de122829c1d2254", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "1", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "2", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "3", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "4", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "5", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "6", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "7", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "8", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "9", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "10", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "11", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "12", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "13", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "14", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "15", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "16", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "17", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "18", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "19", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "20", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "21", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "22", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + } + ] + }, + "tasks": { + "keyPhraseExtractionTasks": [ + { + "parameters": { + "model-version": "latest" + } + } + ] + }, + "displayName": "AnalyzeOperationWithSkipParameter" + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "ca2f4658-bf38-4335-a7a7-328bf00c801c", + "Date": "Wed, 03 Feb 2021 00:00:22 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "230" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "4d5c3f1f260ea429f32258bc15d3c165", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "3a52fc68-9669-41d1-a5aa-97048d787b08", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:22 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "10" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:22Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:22Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 0, + "total": 0 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "0814b8f9ff4d9a0118a1c7a3b4ca2d52", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "31c1e06c-e104-4b25-9f32-949d74d18db5", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:24 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "10" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:22Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:22Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 0, + "total": 0 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "e5bd681a9611fd57429866b6f0041489", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "6ec14aa6-f474-4931-872c-e06212198726", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:25 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "15" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:22Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:22Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 0, + "total": 0 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "e389bc1f1a0820073dc2346c5e86f029", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "b60e4075-a669-4d0e-b916-44f2eb28727a", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:26 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "11" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:22Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:22Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 0, + "total": 0 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "aca106f5dc1663546016c5b4984baa13", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "84aa57df-1463-4e99-955c-bce1e89d7d19", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:27 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "29" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "f7833e8d4940ff49619da74f61ea9fbc", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2e19f165-1c0c-443e-8c83-eb3ad5862d50", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:28 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "57" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "eac03ca867624373682682f2555287f2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "5e6b951b-ba03-4793-b8f3-6829a95fdf83", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:29 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "38" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "20de2017f802ace8bda24b7834050176", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "9fdfdc25-72fa-4df8-b513-abb5e665ca94", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:30 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "61" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "5b0b0877bf8a26b0ca408f1ac657aa0e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4a63f850-8a85-4bf7-a72c-1a5c0144fdc7", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:31 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "73" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "4037b5167f0cafba54142dc01cfa0e62", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "39f6cd44-0c9b-45c3-b0ef-5eeb663d779f", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:32 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "222" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27.2996144Z", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "1", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "4", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "5", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "6", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "7", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "8", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "9", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "10", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "11", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "12", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "13", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "14", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "15", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "16", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "17", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "18", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "19", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01", + "@nextLink": "http://svc--textanalyticsdispatcher.text-analytics.svc.cluster.local/text/analytics/v3.1-preview.3/jobs/c3ba0e47-ddf1-4ab6-9917-28dd9c1eeae2?$skip=20\u0026$top=3" + } + } + ] + }, + "@nextLink": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?$skip=20\u0026$top=20" + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?$skip=20\u0026$top=20\u0026showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "4c7a0c252b4757676fb855c169cee566", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "53b9d31e-9901-4582-948f-be61355e8dca", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:33 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "72" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27.2996144Z", + "results": { + "documents": [ + { + "id": "20", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "21", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "22", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000?$skip=20\u0026$top=20\u0026showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "7f623cf7c0cef86a4e5b077692f00ad0", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "3143a4b4-4853-4586-8311-df633717ad48", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:33 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "74" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "36a9feb2-b191-476a-9e1a-42278908583e_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:27Z", + "createdDateTime": "2021-02-03T00:00:22Z", + "expirationDateTime": "2021-02-04T00:00:22Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:27.2996144Z", + "results": { + "documents": [ + { + "id": "20", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "21", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "22", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01" + } + } + ] + } + } + } + ], + "Variables": { + "RandomSeed": "275027038", + "TEXT_ANALYTICS_API_KEY": "Sanitized", + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" + } +} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPaginationAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPaginationAsync.json new file mode 100644 index 0000000000000..47113875bb8c0 --- /dev/null +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithPaginationAsync.json @@ -0,0 +1,888 @@ +{ + "Entries": [ + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Content-Length": "1971", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-4297d9b429de034e849cc9c46d79ec0f-6b7f39c482a9f54c-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "21ac64e10f1baa75d580bbe74a8c1d32", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "1", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "2", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "3", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "4", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "5", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "6", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "7", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "8", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "9", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "10", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "11", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "12", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "13", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "14", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "15", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "16", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "17", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "18", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "19", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "20", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "21", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + }, + { + "id": "22", + "text": "Elon Musk is the CEO of SpaceX and Tesla.", + "language": "en" + } + ] + }, + "tasks": { + "keyPhraseExtractionTasks": [ + { + "parameters": { + "model-version": "latest" + } + } + ] + }, + "displayName": "AnalyzeOperationWithSkipParameter" + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "4b576f4f-83ed-4d4d-82f3-2f7c59a9dfc3", + "Date": "Wed, 03 Feb 2021 00:00:33 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "24" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "b6309a59d4cb441b6d3a8ce20237d04a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "ae4d8a5e-660a-4394-a964-d8d9f68c6618", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:34 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "41" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:34Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:34Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 0, + "total": 0 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "e3d0a275ac6660be41af3fd3bf957141", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "77dd3739-00c6-4556-bdd2-27ac2bba71dc", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:35 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "83" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "2d059a9f02910c864867b4e18393a89d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "ae292d8f-92ca-4ad0-929e-cd65d5969ab6", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:36 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "236" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "a87271af3abbaccbdbd0751c954884d8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "5f323635-8ce0-497e-b3d3-2c8982aaa47b", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:37 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "32" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "68424ac8a23173b91bc49bfef8dddcae", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "8c615dc9-47a2-44e3-a21d-54d50c4cb743", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:38 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "32" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "4e23a107c9226585ce5851c08c6a7600", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "8297df43-6124-4dd3-81db-9e876d0c8a37", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:39 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "40" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "3818dce33f500d6cb8ff8cf79eccb4fe", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "d9db4d6d-37c6-4cb5-ad45-38df6918bbe6", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:40 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "55" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "f414c7f33524ffb5c4dc9ad850f8e6b0", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "12fb551c-998b-40fd-93e1-dfb96b6fd66e", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:41 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "37" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "1b1b9a4da3c4c85d341696233c8dc601", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4b7d0dd1-f275-4162-99b5-89fde2893585", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:42 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "196" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35.0857759Z", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "1", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "4", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "5", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "6", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "7", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "8", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "9", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "10", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "11", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "12", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "13", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "14", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "15", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "16", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "17", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "18", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "19", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01", + "@nextLink": "http://svc--textanalyticsdispatcher.text-analytics.svc.cluster.local/text/analytics/v3.1-preview.3/jobs/d17481b7-3ab4-4e3c-9cb1-da2c0e42603b?$skip=20\u0026$top=3" + } + } + ] + }, + "@nextLink": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?$skip=20\u0026$top=20" + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?$skip=20\u0026$top=20\u0026showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "c5cc53a48255addc27197474a593bcbf", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "d6998105-add5-4e2b-93f4-0134baac9202", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:43 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "124" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35.0857759Z", + "results": { + "documents": [ + { + "id": "20", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "21", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "22", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000?$skip=20\u0026$top=20\u0026showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "04aadb1998b14f3a694cbf0d9f91c336", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2bcdc3b4-05a9-40db-a7b9-273c08f5da01", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 03 Feb 2021 00:00:43 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "93" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationWithSkipParameter", + "jobId": "a97db021-ae80-4a6c-ac38-40d99d6c4376_637479072000000000", + "lastUpdateDateTime": "2021-02-03T00:00:35Z", + "createdDateTime": "2021-02-03T00:00:34Z", + "expirationDateTime": "2021-02-04T00:00:34Z", + "status": "succeeded", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35Z" + }, + "completed": 1, + "failed": 0, + "inProgress": 0, + "total": 1, + "keyPhraseExtractionTasks": [ + { + "name": "AnalyzeOperationWithSkipParameter", + "lastUpdateDateTime": "2021-02-03T00:00:35.0857759Z", + "results": { + "documents": [ + { + "id": "20", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "21", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + }, + { + "id": "22", + "keyPhrases": [ + "CEO of SpaceX", + "Elon Musk", + "Tesla" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-07-01" + } + } + ] + } + } + } + ], + "Variables": { + "RandomSeed": "24609339", + "TEXT_ANALYTICS_API_KEY": "Sanitized", + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" + } +} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameter.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameter.json deleted file mode 100644 index ff6e721769c37..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameter.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Content-Length": "315", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-5985db7e3db9af4c93acf6f354db1920-fb2be06893ab184f-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "66213f11f688828028a07f5921c888bb", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Elon Musk is the CEO of SpaceX and Tesla.", - "language": "en" - }, - { - "id": "1", - "text": "Tesla stock is up by 400% this year.", - "language": "en" - } - ] - }, - "tasks": { - "keyPhraseExtractionTasks": [ - { - "parameters": { - "model-version": "latest" - } - } - ] - }, - "displayName": "AnalyzeOperationWithSkipParameter" - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "20c4da02-dfe3-438a-8f16-9d828272beb8", - "Date": "Thu, 12 Nov 2020 19:27:01 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "321" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "7550f4ca3d1aa83453b335a4cb28f918", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "5635158a-0052-4b32-8763-58e913637778", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:01 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "12" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:01Z", - "createdDateTime": "2020-11-12T19:27:01Z", - "expirationDateTime": "2020-11-13T19:27:01Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:01Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "6e334389d8cbd526e03ccbc674f1465c", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "c74ecb78-7ff4-48de-961d-f6fdd38b44c6", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:02 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "39" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:02Z", - "createdDateTime": "2020-11-12T19:27:01Z", - "expirationDateTime": "2020-11-13T19:27:01Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:02Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "de1aa601b91bd3c80b7813d4c0dbb700", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "61576e37-0f26-4062-bfcc-6eae305e99da", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:03 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "39" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:02Z", - "createdDateTime": "2020-11-12T19:27:01Z", - "expirationDateTime": "2020-11-13T19:27:01Z", - "status": "running", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:02Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "decf67a71a95f2f0ce7b95dd726d3461", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "7cb83c03-7b55-4fff-ba77-7c567b27bade", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:06 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "65" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "9de28acd-54d3-47c9-a2c3-a0c67d45e4ca_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:02Z", - "createdDateTime": "2020-11-12T19:27:01Z", - "expirationDateTime": "2020-11-13T19:27:01Z", - "status": "succeeded", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:02Z" - }, - "completed": 1, - "failed": 0, - "inProgress": 0, - "total": 1, - "keyPhraseExtractionTasks": [ - { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:02.6694869Z", - "results": { - "inTerminalState": true, - "documents": [ - { - "id": "1", - "keyPhrases": [ - "Tesla stock", - "year" - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-07-01" - } - } - ] - } - } - } - ], - "Variables": { - "RandomSeed": "1647574859", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameterAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameterAsync.json deleted file mode 100644 index 4059c2e764e8b..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithSkipParameterAsync.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Content-Length": "315", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-ccbf7af53458d345b4866b4fd1137970-3933ec40f9a3ac41-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "bfdf919d73f091624852e0c062e03ad0", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Elon Musk is the CEO of SpaceX and Tesla.", - "language": "en" - }, - { - "id": "1", - "text": "Tesla stock is up by 400% this year.", - "language": "en" - } - ] - }, - "tasks": { - "keyPhraseExtractionTasks": [ - { - "parameters": { - "model-version": "latest" - } - } - ] - }, - "displayName": "AnalyzeOperationWithSkipParameter" - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "38e781b1-5430-4c03-95e6-e1656de57ccd", - "Date": "Thu, 12 Nov 2020 19:31:39 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "198" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "da0b53f68f4297de6ae8139f5a76d096", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "6491be91-21af-4fbe-bde6-adf6ab54bba5", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:39 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "13" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:39Z", - "createdDateTime": "2020-11-12T19:31:39Z", - "expirationDateTime": "2020-11-13T19:31:39Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:39Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "6abf538023fc637f864050eb4fa5f7d2", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "4e569235-8d0c-4f3f-a60f-770b0e0e4688", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:41 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "45" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:40Z", - "createdDateTime": "2020-11-12T19:31:39Z", - "expirationDateTime": "2020-11-13T19:31:39Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:40Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000?showStats=false\u0026$skip=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "dde65bb3fac20d04b347550760c237d1", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "bbbd417e-d4fc-413b-939f-726f8f4a920f", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:42 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "118" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "0d9a2eae-f8b8-4584-aaed-e7917e311708_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:40Z", - "createdDateTime": "2020-11-12T19:31:39Z", - "expirationDateTime": "2020-11-13T19:31:39Z", - "status": "succeeded", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:40Z" - }, - "completed": 1, - "failed": 0, - "inProgress": 0, - "total": 1, - "keyPhraseExtractionTasks": [ - { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:40.4562139Z", - "results": { - "inTerminalState": true, - "documents": [ - { - "id": "1", - "keyPhrases": [ - "Tesla stock", - "year" - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-07-01" - } - } - ] - } - } - } - ], - "Variables": { - "RandomSeed": "418709910", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameter.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameter.json deleted file mode 100644 index cbed2e7b6c692..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameter.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Content-Length": "315", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-54a2ba121639a245a8602ab387070df4-c5645bc5a8f88d4d-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "f5a0428665082c595c1d3b6d579c7b27", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Elon Musk is the CEO of SpaceX and Tesla.", - "language": "en" - }, - { - "id": "1", - "text": "Tesla stock is up by 400% this year.", - "language": "en" - } - ] - }, - "tasks": { - "keyPhraseExtractionTasks": [ - { - "parameters": { - "model-version": "latest" - } - } - ] - }, - "displayName": "AnalyzeOperationWithSkipParameter" - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "2c265da7-e94f-475f-acb9-b014c56cd891", - "Date": "Thu, 12 Nov 2020 19:27:06 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "99" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "553c2e9c301fafa2ce30174e56a7aeb6", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "362dedad-f377-498e-8a59-2156a8bcd391", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:06 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "43" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:06Z", - "createdDateTime": "2020-11-12T19:27:06Z", - "expirationDateTime": "2020-11-13T19:27:06Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:06Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "ef89b7f4fba1a676b9ada33b769d705d", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "3c1cb1ed-74d0-449e-ae07-5d35951723a5", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:07 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "48" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:06Z", - "createdDateTime": "2020-11-12T19:27:06Z", - "expirationDateTime": "2020-11-13T19:27:06Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:06Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "5101bd37175355c39ff126d84e0bd6b5", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "b57acf6e-2aa4-4474-a3b2-483678669b86", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:09 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "41" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:06Z", - "createdDateTime": "2020-11-12T19:27:06Z", - "expirationDateTime": "2020-11-13T19:27:06Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:06Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "a079846f8c12a185b7959b718d673830", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "741b4753-5837-476b-8528-bb29b2067e7c", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:27:10 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "73" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:27:06Z", - "createdDateTime": "2020-11-12T19:27:06Z", - "expirationDateTime": "2020-11-13T19:27:06Z", - "status": "succeeded", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:06Z" - }, - "completed": 1, - "failed": 0, - "inProgress": 0, - "total": 1, - "keyPhraseExtractionTasks": [ - { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:27:06.7592687Z", - "results": { - "inTerminalState": true, - "documents": [ - { - "id": "0", - "keyPhrases": [ - "CEO of SpaceX", - "Elon Musk", - "Tesla" - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-07-01", - "@nextLink": "http://svc--textanalyticsdispatcher.text-analytics.svc.cluster.local/text/analytics/v3.1-preview.3/jobs/e607da11-c6c5-44d5-87f6-5c77282fa4c5?$skip=1\u0026$top=1" - } - } - ] - }, - "nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/105e9e6d-d7a9-4a8c-9bea-2bf73ba3e13a_637407360000000000?$skip=1\u0026$top=1" - } - } - ], - "Variables": { - "RandomSeed": "1969253882", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameterAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameterAsync.json deleted file mode 100644 index bcb09a10c56a6..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationWithTopParameterAsync.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Content-Length": "315", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-b9d14e4c2630404d87ea27dd6e21966b-8079970f4e108e48-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "4363d852e8c119d2a2fa97a42e5f4e70", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Elon Musk is the CEO of SpaceX and Tesla.", - "language": "en" - }, - { - "id": "1", - "text": "Tesla stock is up by 400% this year.", - "language": "en" - } - ] - }, - "tasks": { - "keyPhraseExtractionTasks": [ - { - "parameters": { - "model-version": "latest" - } - } - ] - }, - "displayName": "AnalyzeOperationWithSkipParameter" - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "c4dc4437-de8f-4196-bfd2-44b7c1937691", - "Date": "Thu, 12 Nov 2020 19:31:42 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "170" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "468deb1ccb621dd96694037a6ba13fa6", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "24637190-e440-4225-be31-d1a700e3a2ec", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:42 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "11" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:43Z", - "createdDateTime": "2020-11-12T19:31:43Z", - "expirationDateTime": "2020-11-13T19:31:43Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "2a358e408ae783469392811f1ba768c9", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "063a1155-146b-4285-b665-19239c3ae3fc", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:43 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "44" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:43Z", - "createdDateTime": "2020-11-12T19:31:43Z", - "expirationDateTime": "2020-11-13T19:31:43Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "1a307cd6f55486edff46dd2ce457ae00", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "f6cf7eef-baca-4652-b65a-ad88f2cb3f73", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:45 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "43" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:43Z", - "createdDateTime": "2020-11-12T19:31:43Z", - "expirationDateTime": "2020-11-13T19:31:43Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "a064f1ba23299189a40ab3d04ab902be", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "f63f13df-6af0-4c56-9c96-e23949b8c301", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:46 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "49" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:43Z", - "createdDateTime": "2020-11-12T19:31:43Z", - "expirationDateTime": "2020-11-13T19:31:43Z", - "status": "running", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?showStats=false\u0026$top=1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json, text/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201112.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "efa4392b25714b51a0af2ba1ad199f3b", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "d0764c15-957a-4ead-9b27-30434052e5c4", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 12 Nov 2020 19:31:48 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "105" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationWithSkipParameter", - "jobId": "75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000", - "lastUpdateDateTime": "2020-11-12T19:31:43Z", - "createdDateTime": "2020-11-12T19:31:43Z", - "expirationDateTime": "2020-11-13T19:31:43Z", - "status": "succeeded", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43Z" - }, - "completed": 1, - "failed": 0, - "inProgress": 0, - "total": 1, - "keyPhraseExtractionTasks": [ - { - "name": "AnalyzeOperationWithSkipParameter", - "lastUpdateDateTime": "2020-11-12T19:31:43.5974421Z", - "results": { - "inTerminalState": true, - "documents": [ - { - "id": "0", - "keyPhrases": [ - "CEO of SpaceX", - "Elon Musk", - "Tesla" - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-07-01", - "@nextLink": "http://svc--textanalyticsdispatcher.text-analytics.svc.cluster.local/text/analytics/v3.1-preview.3/jobs/06e9cc28-b861-47d9-95a7-f79077a6c960?$skip=1\u0026$top=1" - } - } - ] - }, - "nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/75647564-5414-4932-8e92-7ec622c0a1a4_637407360000000000?$skip=1\u0026$top=1" - } - } - ], - "Variables": { - "RandomSeed": "865527543", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs index 53908964a6313..eca325c0f90c2 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs @@ -51,59 +51,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + foreach (AnalyzeOperationResult documentsInPage in operation.GetValues()) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs index 0f7f8e3205d91..2a3ea35ff4d6f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs @@ -53,59 +53,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + await foreach (AnalyzeOperationResult documentsInPage in operation.Value) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs index da5006a77b671..5955159da54d8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs @@ -55,59 +55,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await operation.WaitForCompletionAsync(pollingInterval); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + await foreach (AnalyzeOperationResult documentsInPage in operation.Value) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs index 14d88527512e0..f29267e95a53d 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs @@ -64,59 +64,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await Task.Delay(pollingInterval); } - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + await foreach (AnalyzeOperationResult documentsInPage in operation.Value) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenience.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenience.cs index 0a4cbe813dc14..cf6231d6935d6 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenience.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenience.cs @@ -47,59 +47,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + foreach (AnalyzeOperationResult documentsInPage in operation.GetValues()) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenienceAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenienceAsync.cs index 4ed4bee849877..c7854b9822f5f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenienceAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenienceAsync.cs @@ -47,59 +47,60 @@ call 312-555-0176 or send email to order@contososteakhouse.com! The only complai await operation.WaitForCompletionAsync(); - AnalyzeOperationResult resultCollection = operation.Value; - - RecognizeEntitiesResultCollection entitiesResult = resultCollection.Tasks.EntityRecognitionTasks[0].Results; - - ExtractKeyPhrasesResultCollection keyPhrasesResult = resultCollection.Tasks.KeyPhraseExtractionTasks[0].Results; + await foreach (AnalyzeOperationResult documentsInPage in operation.Value) + { + RecognizeEntitiesResultCollection entitiesResult = documentsInPage.Tasks.EntityRecognitionTasks[0].Results; - RecognizePiiEntitiesResultCollection piiResult = resultCollection.Tasks.EntityRecognitionPiiTasks[0].Results; + ExtractKeyPhrasesResultCollection keyPhrasesResult = documentsInPage.Tasks.KeyPhraseExtractionTasks[0].Results; - Console.WriteLine("Recognized Entities"); + RecognizePiiEntitiesResultCollection piiResult = documentsInPage.Tasks.EntityRecognitionPiiTasks[0].Results; - foreach (RecognizeEntitiesResult result in entitiesResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + Console.WriteLine("Recognized Entities"); - foreach (CategorizedEntity entity in result.Entities) + foreach (RecognizeEntitiesResult result in entitiesResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} entities:"); + + foreach (CategorizedEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Recognized PII Entities"); + Console.WriteLine("Recognized PII Entities"); - foreach (RecognizePiiEntitiesResult result in piiResult) - { - Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); - - foreach (PiiEntity entity in result.Entities) + foreach (RecognizePiiEntitiesResult result in piiResult) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); - Console.WriteLine($" SubCategory: {entity.SubCategory}"); + Console.WriteLine($" Recognized the following {result.Entities.Count} PII entities:"); + + foreach (PiiEntity entity in result.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" ConfidenceScore: {entity.ConfidenceScore}"); + Console.WriteLine($" SubCategory: {entity.SubCategory}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); - } - Console.WriteLine("Key Phrases"); + Console.WriteLine("Key Phrases"); - foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) - { - Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); - - foreach (string keyphrase in result.KeyPhrases) + foreach (ExtractKeyPhrasesResult result in keyPhrasesResult) { - Console.WriteLine($" {keyphrase}"); + Console.WriteLine($" Recognized the following {result.KeyPhrases.Count} Keyphrases:"); + + foreach (string keyphrase in result.KeyPhrases) + { + Console.WriteLine($" {keyphrase}"); + } + Console.WriteLine(""); } - Console.WriteLine(""); } }