diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md index 69bfb89642d47..b00ccc2d9a2b5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md @@ -22,6 +22,8 @@ dotnet add package Azure.AI.Language.Conversations --prerelease - An [Azure subscription][azure_subscription] - An existing Azure Language Service Resource +Though you can use this SDK to create and import conversation projects, [Language Studio][language_studio] is the preferred method for creating projects. + ### Authenticate the client In order to interact with the Conversations service, you'll need to create an instance of the [`ConversationAnalysisClient`][conversationanalysis_client_class] class. You will need an **endpoint**, and an **API key** to instantiate a client object. For more information regarding authenticating with Cognitive Services, see [Authenticate requests to Azure Cognitive Services][cognitive_auth]. @@ -36,6 +38,15 @@ Alternatively, use the [Azure CLI][azure_cli] command shown below to get the API az cognitiveservices account keys list --resource-group --name ``` +#### Namespaces + +Start by importing the namespace for the [`ConversationAnalysisClient`][conversationanalysis_client_class] and related class: + +```C# Snippet:ConversationAnalysisClient_Namespaces +using Azure.Core; +using Azure.AI.Language.Conversations; +``` + #### Create a ConversationAnalysisClient Once you've determined your **endpoint** and **API key** you can instantiate a `ConversationAnalysisClient`: @@ -131,19 +142,17 @@ foreach (JsonElement entity in conversationPrediction.GetProperty("entities").En Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -389,6 +398,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md [core_logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md +[language_studio]: https://language.cognitive.azure.com/ [nuget]: https://www.nuget.org/ [conversationanalysis_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClient.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs index 4ef0aec402d26..3654e6bf78fc4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs @@ -18,11 +18,14 @@ public enum ServiceVersion V2022_05_01 = 1, } } - public partial class ConversationAnalysisProjectsClient +} +namespace Azure.AI.Language.Conversations.Authoring +{ + public partial class ConversationAuthoringClient { - protected ConversationAnalysisProjectsClient() { } - public ConversationAnalysisProjectsClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } - public ConversationAnalysisProjectsClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Conversations.ConversationAnalysisClientOptions options) { } + protected ConversationAuthoringClient() { } + public ConversationAuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ConversationAuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Conversations.ConversationAnalysisClientOptions options) { } public virtual System.Uri Endpoint { get { throw null; } } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context = null) { throw null; } @@ -43,36 +46,36 @@ public ConversationAnalysisProjectsClient(System.Uri endpoint, Azure.AzureKeyCre public virtual System.Threading.Tasks.Task GetDeploymentAsync(string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetDeploymentJobStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetDeploymentJobStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetDeployments(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetExportProjectJobStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetExportProjectJobStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetImportProjectJobStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetImportProjectJobStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetProject(string projectName, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetProjectAsync(string projectName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetProjectDeletionJobStatus(string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetProjectDeletionJobStatusAsync(string jobId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetProjects(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetProjectsAsync(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetSupportedLanguages(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetSupportedPrebuiltEntities(string language = null, bool? multilingual = default(bool?), int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(string language = null, bool? multilingual = default(bool?), int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetProjects(Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetSupportedLanguages(string projectKind, Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(string projectKind, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetSupportedPrebuiltEntities(string language = null, bool? multilingual = default(bool?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(string language = null, bool? multilingual = default(bool?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetSwapDeploymentsJobStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetSwapDeploymentsJobStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetTrainedModels(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetTrainingConfigVersions(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetTrainingJobs(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetTrainingConfigVersions(string projectKind, Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetTrainingJobStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetTrainingJobStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation ImportProject(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string exportedProjectFormat = null, Azure.RequestContext context = null) { throw null; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md index 1544b4261a55e..bb151dc11c81c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md @@ -67,19 +67,17 @@ foreach (JsonElement entity in conversationPrediction.GetProperty("entities").En Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -87,31 +85,8 @@ foreach (JsonElement entity in conversationPrediction.GetProperty("entities").En ## Asynchronous -```C# Snippet:ConversationAnalysis_AnalyzeConversationAsync -string projectName = "Menu"; -string deploymentName = "production"; - -var data = new -{ - analysisInput = new - { - conversationItem = new - { - text = "Send an email to Carol about tomorrow's demo", - id = "1", - participantId = "1", - } - }, - parameters = new - { - projectName, - deploymentName, - - // Use Utf16CodeUnit for strings in .NET. - stringIndexType = "Utf16CodeUnit", - }, - kind = "Conversation", -}; +Using the same `data` definition above, you can make an asynchronous request by calling `AnalyzeConversationAsync`: +```C# Snippet:ConversationAnalysis_AnalyzeConversationAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md index e405f4803e7ba..c93b2ff0ea104 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md @@ -50,32 +50,9 @@ JsonElement orchestrationPrediction = conversationalTaskResult.GetProperty("resu ## Asynchronous -```C# Snippet:ConversationAnalysis_AnalyzeConversationOrchestrationPredictionAsync -string projectName = "DomainOrchestrator"; -string deploymentName = "production"; - -var data = new -{ - analysisInput = new - { - conversationItem = new - { - text = "How are you?", - id = "1", - participantId = "1", - } - }, - parameters = new - { - projectName, - deploymentName, - - // Use Utf16CodeUnit for strings in .NET. - stringIndexType = "Utf16CodeUnit", - }, - kind = "Conversation", -}; +Using the same `data` definition above, you can make an asynchronous request by calling `AnalyzeConversationAsync`: +```C# Snippet:ConversationAnalysis_AnalyzeConversationOrchestrationPredictionAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); using JsonDocument result = await JsonDocument.ParseAsync(response.ContentStream); @@ -136,19 +113,17 @@ if (targetIntentResult.GetProperty("targetProjectKind").GetString() == "Conversa Console.WriteLine($"Length: {entity.GetProperty("length").GetInt32()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) - { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md index 574a9e58976a2..ab929af081cd8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md @@ -48,33 +48,8 @@ Response response = client.AnalyzeConversation(RequestContent.Create(data)); ## Asynchronous -```C# Snippet:ConversationAnalysis_AnalyzeConversationWithLanguageAsync -string projectName = "Menu"; -string deploymentName = "production"; - -var data = new -{ - analysisInput = new - { - conversationItem = new - { - text = "Enviar un email a Carol acerca de la presentaciĆ³n de maƱana", - language = "es", - id = "1", - participantId = "1", - } - }, - parameters = new - { - projectName, - deploymentName, - verbose = true, - - // Use Utf16CodeUnit for strings in .NET. - stringIndexType = "Utf16CodeUnit", - }, - kind = "Conversation", -}; +Using the same `data` definition above, you can make an asynchronous request by calling `AnalyzeConversationAsync`: +```C# Snippet:ConversationAnalysis_AnalyzeConversationWithLanguageAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md index 06d24bd849754..0efb135d4d41f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md @@ -47,32 +47,8 @@ Response response = client.AnalyzeConversation(RequestContent.Create(data)); ## Asynchronous -```C# Snippet:ConversationAnalysis_AnalyzeConversationWithOptionsAsync -string projectName = "Menu"; -string deploymentName = "production"; - -var data = new -{ - analysisInput = new - { - conversationItem = new - { - text = "Send an email to Carol about tomorrow's demo", - id = "1", - participantId = "1", - } - }, - parameters = new - { - projectName, - deploymentName, - verbose = true, - - // Use Utf16CodeUnit for strings in .NET. - stringIndexType = "Utf16CodeUnit", - }, - kind = "Conversation", -}; +Using the same `data` definition above, you can make an asynchronous request by calling `AnalyzeConversationAsync`: +```C# Snippet:ConversationAnalysis_AnalyzeConversationWithOptionsAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md index e70331e107835..ba41b86aee2dd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md @@ -2,23 +2,31 @@ This sample demonstrates how to import a project. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. -To import a project, you'll need to first create a `ConversationAnalysisProjectsClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. -```C# Snippet:ConversationAnalysisProjectsClient_Create +Start by importing the namespace for the `ConversationAuthoringClient` and related classes: + +```C# Snippet:ConversationAuthoringClient_Namespaces +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +``` + +To import a project, you'll need to first create a `ConversationAuthoringClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# Snippet:ConversationAuthoringClient_Create Uri endpoint = new Uri("https://myaccount.cognitive.microsoft.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -ConversationAnalysisProjectsClient client = new ConversationAnalysisProjectsClient(endpoint, credential); +ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); ``` Once you have created a client, you can call synchronous or asynchronous methods. Typically, the content would come from a file but a small sample is shown here for demonstration purposes. ## Synchronous -```C# Snippet:ConversationAnalysisProjectsClient_ImportProject +```C# Snippet:ConversationAuthoringClient_ImportProject string projectName = "Menu"; -// Define our project assets and import. +// Define our project assets and import. In practice this would most often be read from a file. var importData = new { projectFileVersion = "2022-05-01", @@ -102,7 +110,6 @@ var importData = new }; Operation importOperation = client.ImportProject(WaitUntil.Started, projectName, RequestContent.Create(importData)); -importOperation.WaitForCompletion(); // Train the model. var trainData = new @@ -111,8 +118,11 @@ var trainData = new trainingMode = "standard", }; -Operation trainOperation = client.Train(WaitUntil.Started, projectName, RequestContent.Create(trainData)); -trainOperation.WaitForCompletion(); +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = client.Train( + WaitUntil.Completed, + projectName, + RequestContent.Create(trainData)); // Deploy the model. var deployData = new @@ -120,101 +130,22 @@ var deployData = new trainedModelLabel = "Sample5", }; -Operation deployOperation = client.DeployProject(WaitUntil.Started, projectName, "production", RequestContent.Create(deployData)); -deployOperation.WaitForCompletion(); -``` - -# Asynchronous +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = client.DeployProject( + WaitUntil.Completed, + projectName, + "production", + RequestContent.Create(deployData)); -```C# Snippet:ConversationAnalysisProjectsClient_ImportProjectAsync -string projectName = "Menu"; - -// Define our project assets and import. -var importData = new -{ - projectFileVersion = "2022-05-01", - metadata = new - { - projectName, - projectKind = "Conversation", - multilingual = true, - language = "en", - }, - - assets = new - { - projectKind = "Conversation", - entities = new[] // ConversationalAnalysisAuthoringConversationExportedEntity - { - new - { - category = "Contact", - compositionSetting = "combineComponents", - prebuilts = new[] - { - new - { - category = "Person.Name", - }, - }, - - // ... more entities. - } - }, - - intents = new[] // ConversationalAnalysisAuthoringConversationExportedIntent - { - new - { - category = "Send", - }, - - // ... more intents. - }, - - utterances = new[] // ConversationalAnalysisAuthoringConversationExportedUtterance - { - new - { - text = "Send an email to Johnson", - language = "en", - intent = "Send", - entities = new[] - { - new - { - category = "Contact", - offset = 17, - length = 7, - }, - }, - }, - new - { - text = "Send Kathy a calendar invite", - language = "en", - intent = "Send", - entities = new[] - { - new - { - category = "Contact", - offset = 5, - length = 5, - }, - }, - }, +Console.WriteLine("Import complete"); +``` - // ... more utterances. - }, - }, +## Asynchronous - // Use Utf16CodeUnit for strings in .NET. - stringIndexType = "Utf16CodeUnit", -}; +Using the same `importData` definition above, you can make an asynchronous request by calling `ImportProjectAsync`: +```C# Snippet:ConversationAuthoringClient_ImportProjectAsync Operation importOperation = await client.ImportProjectAsync(WaitUntil.Started, projectName, RequestContent.Create(importData)); -await importOperation.WaitForCompletionAsync(); // Train the model. var trainData = new @@ -223,8 +154,11 @@ var trainData = new trainingMode = "standard", }; -Operation trainOperation = await client.TrainAsync(WaitUntil.Started, projectName, RequestContent.Create(trainData)); -await trainOperation.WaitForCompletionAsync(); +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = await client.TrainAsync( + WaitUntil.Completed, + projectName, + RequestContent.Create(trainData)); // Deploy the model. var deployData = new @@ -232,6 +166,12 @@ var deployData = new trainedModelLabel = "Sample5", }; -Operation deployOperation = await client.DeployProjectAsync(WaitUntil.Started, projectName, "production", RequestContent.Create(deployData)); -await deployOperation.WaitForCompletionAsync(); +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = await client.DeployProjectAsync( + WaitUntil.Completed, + projectName, + "production", + RequestContent.Create(deployData)); + +Console.WriteLine("Import complete"); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisProjectsClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Authoring/ConversationAuthoringClient.cs similarity index 75% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisProjectsClient.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Authoring/ConversationAuthoringClient.cs index 4d3fcd597c790..8dc6bd92dba46 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisProjectsClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Authoring/ConversationAuthoringClient.cs @@ -5,31 +5,31 @@ using Azure.Core; using Azure.Core.Pipeline; -[assembly: CodeGenSuppressType("ConversationAnalysisProjectsClientOptions")] +[assembly: CodeGenSuppressType("ConversationAuthoringClientOptions")] -namespace Azure.AI.Language.Conversations +namespace Azure.AI.Language.Conversations.Authoring { [CodeGenClient("ConversationalAnalysisAuthoringClient")] - public partial class ConversationAnalysisProjectsClient + public partial class ConversationAuthoringClient { /// - /// Initializes a new instance of ConversationAnalysisProjectsClient. + /// Initializes a new instance of ConversationAuthoringClient. /// /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.cognitiveservices.azure.com). /// A credential used to authenticate to an Azure Service. /// or is null. - public ConversationAnalysisProjectsClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new ConversationAnalysisClientOptions()) + public ConversationAuthoringClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new ConversationAnalysisClientOptions()) { } /// - /// Initializes a new instance of ConversationAnalysisProjectsClient. + /// Initializes a new instance of ConversationAuthoringClient. /// /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.cognitiveservices.azure.com). /// A credential used to authenticate to an Azure Service. /// The options for configuring the client. /// or is null. - public ConversationAnalysisProjectsClient(Uri endpoint, AzureKeyCredential credential, ConversationAnalysisClientOptions options) + public ConversationAuthoringClient(Uri endpoint, AzureKeyCredential credential, ConversationAnalysisClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(credential, nameof(credential)); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClientOptions.cs index 59a8012fd340c..6068885eca860 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClientOptions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClientOptions.cs @@ -9,7 +9,7 @@ namespace Azure.AI.Language.Conversations /// /// Client options for . /// - [CodeGenModel("ConversationAnalysisProjectsClientOptions")] + [CodeGenModel("ConversationAuthoringClientOptions")] public partial class ConversationAnalysisClientOptions : ClientOptions { internal string Version { get; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs index 3ac0a5fb8ae11..a6cd705c8e972 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Language.Conversations { - /// Client options for ConversationAnalysisProjectsClient. + /// Client options for ConversationAuthoringClient. public partial class ConversationAnalysisClientOptions : ClientOptions { private const ServiceVersion LatestVersion = ServiceVersion.V2022_05_01; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisProjectsClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAuthoringClient.cs similarity index 93% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisProjectsClient.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAuthoringClient.cs index 266a38e0e27fa..010250511327e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisProjectsClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAuthoringClient.cs @@ -11,13 +11,14 @@ using System.Threading; using System.Threading.Tasks; using Azure; +using Azure.AI.Language.Conversations; using Azure.Core; using Azure.Core.Pipeline; -namespace Azure.AI.Language.Conversations +namespace Azure.AI.Language.Conversations.Authoring { - /// The ConversationAnalysisProjects service client. - public partial class ConversationAnalysisProjectsClient + /// The ConversationAuthoring service client. + public partial class ConversationAuthoringClient { private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; private readonly AzureKeyCredential _keyCredential; @@ -31,8 +32,8 @@ public partial class ConversationAnalysisProjectsClient /// The HTTP pipeline for sending and receiving REST requests and responses. public virtual HttpPipeline Pipeline => _pipeline; - /// Initializes a new instance of ConversationAnalysisProjectsClient for mocking. - protected ConversationAnalysisProjectsClient() + /// Initializes a new instance of ConversationAuthoringClient for mocking. + protected ConversationAuthoringClient() { } @@ -95,7 +96,7 @@ public virtual async Task CreateProjectAsync(string projectName, Reque Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.CreateProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.CreateProject"); scope.Start(); try { @@ -168,7 +169,7 @@ public virtual Response CreateProject(string projectName, RequestContent content Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.CreateProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.CreateProject"); scope.Start(); try { @@ -227,7 +228,7 @@ public virtual async Task GetProjectAsync(string projectName, RequestC { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetProject"); scope.Start(); try { @@ -286,7 +287,7 @@ public virtual Response GetProject(string projectName, RequestContext context = { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetProject"); scope.Start(); try { @@ -341,7 +342,7 @@ public virtual async Task GetDeploymentAsync(string projectName, strin Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetDeployment"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetDeployment"); scope.Start(); try { @@ -396,7 +397,7 @@ public virtual Response GetDeployment(string projectName, string deploymentName, Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetDeployment"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetDeployment"); scope.Start(); try { @@ -473,7 +474,7 @@ public virtual async Task GetDeploymentJobStatusAsync(string projectNa Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetDeploymentJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetDeploymentJobStatus"); scope.Start(); try { @@ -550,7 +551,7 @@ public virtual Response GetDeploymentJobStatus(string projectName, string deploy Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetDeploymentJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetDeploymentJobStatus"); scope.Start(); try { @@ -625,7 +626,7 @@ public virtual async Task GetSwapDeploymentsJobStatusAsync(string proj Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetSwapDeploymentsJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetSwapDeploymentsJobStatus"); scope.Start(); try { @@ -700,7 +701,7 @@ public virtual Response GetSwapDeploymentsJobStatus(string projectName, string j Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetSwapDeploymentsJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetSwapDeploymentsJobStatus"); scope.Start(); try { @@ -776,7 +777,7 @@ public virtual async Task GetExportProjectJobStatusAsync(string projec Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetExportProjectJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetExportProjectJobStatus"); scope.Start(); try { @@ -852,7 +853,7 @@ public virtual Response GetExportProjectJobStatus(string projectName, string job Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetExportProjectJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetExportProjectJobStatus"); scope.Start(); try { @@ -927,7 +928,7 @@ public virtual async Task GetImportProjectJobStatusAsync(string projec Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetImportProjectJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetImportProjectJobStatus"); scope.Start(); try { @@ -1002,7 +1003,7 @@ public virtual Response GetImportProjectJobStatus(string projectName, string job Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetImportProjectJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetImportProjectJobStatus"); scope.Start(); try { @@ -1057,7 +1058,7 @@ public virtual async Task GetTrainedModelAsync(string projectName, str Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetTrainedModel"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetTrainedModel"); scope.Start(); try { @@ -1112,7 +1113,7 @@ public virtual Response GetTrainedModel(string projectName, string trainedModelL Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetTrainedModel"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetTrainedModel"); scope.Start(); try { @@ -1157,7 +1158,7 @@ public virtual async Task DeleteTrainedModelAsync(string projectName, Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteTrainedModel"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteTrainedModel"); scope.Start(); try { @@ -1202,7 +1203,7 @@ public virtual Response DeleteTrainedModel(string projectName, string trainedMod Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteTrainedModel"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteTrainedModel"); scope.Start(); try { @@ -1276,7 +1277,7 @@ public virtual async Task GetModelEvaluationSummaryAsync(string projec Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetModelEvaluationSummary"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetModelEvaluationSummary"); scope.Start(); try { @@ -1350,7 +1351,7 @@ public virtual Response GetModelEvaluationSummary(string projectName, string tra Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetModelEvaluationSummary"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetModelEvaluationSummary"); scope.Start(); try { @@ -1438,7 +1439,7 @@ public virtual async Task GetTrainingJobStatusAsync(string projectName Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetTrainingJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetTrainingJobStatus"); scope.Start(); try { @@ -1526,7 +1527,7 @@ public virtual Response GetTrainingJobStatus(string projectName, string jobId, R Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetTrainingJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetTrainingJobStatus"); scope.Start(); try { @@ -1599,7 +1600,7 @@ public virtual async Task GetProjectDeletionJobStatusAsync(string jobI { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetProjectDeletionJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetProjectDeletionJobStatus"); scope.Start(); try { @@ -1672,7 +1673,7 @@ public virtual Response GetProjectDeletionJobStatus(string jobId, RequestContext { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.GetProjectDeletionJobStatus"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.GetProjectDeletionJobStatus"); scope.Start(); try { @@ -1687,9 +1688,6 @@ public virtual Response GetProjectDeletionJobStatus(string jobId, RequestContext } /// Lists the existing projects. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// /// Schema for Response Body: @@ -1732,12 +1730,12 @@ public virtual Response GetProjectDeletionJobStatus(string jobId, RequestContext /// /// /// - public virtual AsyncPageable GetProjectsAsync(int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetProjectsAsync(RequestContext context = null) { - return GetProjectsImplementationAsync("ConversationAnalysisProjectsClient.GetProjects", top, skip, maxpagesize, context); + return GetProjectsImplementationAsync("ConversationAuthoringClient.GetProjects", context); } - private AsyncPageable GetProjectsImplementationAsync(string diagnosticsScopeName, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetProjectsImplementationAsync(string diagnosticsScopeName, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -1745,8 +1743,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetProjectsRequest(top, skip, maxpagesize, context) - : CreateGetProjectsNextPageRequest(nextLink, top, skip, maxpagesize, context); + ? CreateGetProjectsRequest(context) + : CreateGetProjectsNextPageRequest(nextLink, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -1755,9 +1753,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, } /// Lists the existing projects. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// /// Schema for Response Body: @@ -1800,12 +1795,12 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetProjects(int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetProjects(RequestContext context = null) { - return GetProjectsImplementation("ConversationAnalysisProjectsClient.GetProjects", top, skip, maxpagesize, context); + return GetProjectsImplementation("ConversationAuthoringClient.GetProjects", context); } - private Pageable GetProjectsImplementation(string diagnosticsScopeName, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetProjectsImplementation(string diagnosticsScopeName, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -1813,8 +1808,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetProjectsRequest(top, skip, maxpagesize, context) - : CreateGetProjectsNextPageRequest(nextLink, top, skip, maxpagesize, context); + ? CreateGetProjectsRequest(context) + : CreateGetProjectsNextPageRequest(nextLink, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -1824,9 +1819,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the deployments belonging to a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -1865,14 +1857,14 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetDeploymentsAsync(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetDeploymentsImplementationAsync("ConversationAnalysisProjectsClient.GetDeployments", projectName, top, skip, maxpagesize, context); + return GetDeploymentsImplementationAsync("ConversationAuthoringClient.GetDeployments", projectName, context); } - private AsyncPageable GetDeploymentsImplementationAsync(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetDeploymentsImplementationAsync(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -1880,8 +1872,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetDeploymentsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetDeploymentsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetDeploymentsRequest(projectName, context) + : CreateGetDeploymentsNextPageRequest(nextLink, projectName, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -1891,9 +1883,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the deployments belonging to a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -1932,14 +1921,14 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetDeployments(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetDeployments(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetDeploymentsImplementation("ConversationAnalysisProjectsClient.GetDeployments", projectName, top, skip, maxpagesize, context); + return GetDeploymentsImplementation("ConversationAuthoringClient.GetDeployments", projectName, context); } - private Pageable GetDeploymentsImplementation(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetDeploymentsImplementation(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -1947,8 +1936,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetDeploymentsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetDeploymentsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetDeploymentsRequest(projectName, context) + : CreateGetDeploymentsNextPageRequest(nextLink, projectName, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -1958,9 +1947,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the trained models belonging to a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -1999,14 +1985,14 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetTrainedModelsImplementationAsync("ConversationAnalysisProjectsClient.GetTrainedModels", projectName, top, skip, maxpagesize, context); + return GetTrainedModelsImplementationAsync("ConversationAuthoringClient.GetTrainedModels", projectName, context); } - private AsyncPageable GetTrainedModelsImplementationAsync(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetTrainedModelsImplementationAsync(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2014,8 +2000,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainedModelsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetTrainedModelsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetTrainedModelsRequest(projectName, context) + : CreateGetTrainedModelsNextPageRequest(nextLink, projectName, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2025,9 +2011,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the trained models belonging to a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -2066,14 +2049,14 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetTrainedModels(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetTrainedModels(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetTrainedModelsImplementation("ConversationAnalysisProjectsClient.GetTrainedModels", projectName, top, skip, maxpagesize, context); + return GetTrainedModelsImplementation("ConversationAuthoringClient.GetTrainedModels", projectName, context); } - private Pageable GetTrainedModelsImplementation(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetTrainedModelsImplementation(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2081,8 +2064,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainedModelsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetTrainedModelsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetTrainedModelsRequest(projectName, context) + : CreateGetTrainedModelsNextPageRequest(nextLink, projectName, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2094,9 +2077,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// The name of the project to use. /// The trained model label. /// Specifies the method used to interpret string offsets. Set this to "Utf16CodeUnit" for .NET strings, which are encoded as UTF-16. Allowed values: "Utf16CodeUnit". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -2145,16 +2125,16 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - return GetModelEvaluationResultsImplementationAsync("ConversationAnalysisProjectsClient.GetModelEvaluationResults", projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context); + return GetModelEvaluationResultsImplementationAsync("ConversationAuthoringClient.GetModelEvaluationResults", projectName, trainedModelLabel, stringIndexType, context); } - private AsyncPageable GetModelEvaluationResultsImplementationAsync(string diagnosticsScopeName, string projectName, string trainedModelLabel, string stringIndexType, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetModelEvaluationResultsImplementationAsync(string diagnosticsScopeName, string projectName, string trainedModelLabel, string stringIndexType, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2162,8 +2142,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context) - : CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context); + ? CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, context) + : CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2175,9 +2155,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// The name of the project to use. /// The trained model label. /// Specifies the method used to interpret string offsets. Set this to "Utf16CodeUnit" for .NET strings, which are encoded as UTF-16. Allowed values: "Utf16CodeUnit". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -2226,16 +2203,16 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType = "Utf16CodeUnit", RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - return GetModelEvaluationResultsImplementation("ConversationAnalysisProjectsClient.GetModelEvaluationResults", projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context); + return GetModelEvaluationResultsImplementation("ConversationAuthoringClient.GetModelEvaluationResults", projectName, trainedModelLabel, stringIndexType, context); } - private Pageable GetModelEvaluationResultsImplementation(string diagnosticsScopeName, string projectName, string trainedModelLabel, string stringIndexType, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetModelEvaluationResultsImplementation(string diagnosticsScopeName, string projectName, string trainedModelLabel, string stringIndexType, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2243,8 +2220,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context) - : CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, top, skip, maxpagesize, context); + ? CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, context) + : CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2254,9 +2231,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the non-expired training jobs created for a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -2328,14 +2302,14 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetTrainingJobsImplementationAsync("ConversationAnalysisProjectsClient.GetTrainingJobs", projectName, top, skip, maxpagesize, context); + return GetTrainingJobsImplementationAsync("ConversationAuthoringClient.GetTrainingJobs", projectName, context); } - private AsyncPageable GetTrainingJobsImplementationAsync(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetTrainingJobsImplementationAsync(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2343,8 +2317,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainingJobsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetTrainingJobsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetTrainingJobsRequest(projectName, context) + : CreateGetTrainingJobsNextPageRequest(nextLink, projectName, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2354,9 +2328,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the non-expired training jobs created for a project. /// The name of the project to use. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -2428,14 +2399,14 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetTrainingJobs(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetTrainingJobs(string projectName, RequestContext context = null) { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return GetTrainingJobsImplementation("ConversationAnalysisProjectsClient.GetTrainingJobs", projectName, top, skip, maxpagesize, context); + return GetTrainingJobsImplementation("ConversationAuthoringClient.GetTrainingJobs", projectName, context); } - private Pageable GetTrainingJobsImplementation(string diagnosticsScopeName, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetTrainingJobsImplementation(string diagnosticsScopeName, string projectName, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2443,8 +2414,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainingJobsRequest(projectName, top, skip, maxpagesize, context) - : CreateGetTrainingJobsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + ? CreateGetTrainingJobsRequest(projectName, context) + : CreateGetTrainingJobsNextPageRequest(nextLink, projectName, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2454,9 +2425,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the supported languages for the given project type. /// The project kind. Allowed values: "Conversation" | "Orchestration". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// @@ -2490,14 +2458,14 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, RequestContext context = null) { Argument.AssertNotNull(projectKind, nameof(projectKind)); - return GetSupportedLanguagesImplementationAsync("ConversationAnalysisProjectsClient.GetSupportedLanguages", projectKind, top, skip, maxpagesize, context); + return GetSupportedLanguagesImplementationAsync("ConversationAuthoringClient.GetSupportedLanguages", projectKind, context); } - private AsyncPageable GetSupportedLanguagesImplementationAsync(string diagnosticsScopeName, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetSupportedLanguagesImplementationAsync(string diagnosticsScopeName, string projectKind, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2505,8 +2473,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context) - : CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, top, skip, maxpagesize, context); + ? CreateGetSupportedLanguagesRequest(projectKind, context) + : CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2516,9 +2484,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the supported languages for the given project type. /// The project kind. Allowed values: "Conversation" | "Orchestration". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// @@ -2552,14 +2517,14 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetSupportedLanguages(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetSupportedLanguages(string projectKind, RequestContext context = null) { Argument.AssertNotNull(projectKind, nameof(projectKind)); - return GetSupportedLanguagesImplementation("ConversationAnalysisProjectsClient.GetSupportedLanguages", projectKind, top, skip, maxpagesize, context); + return GetSupportedLanguagesImplementation("ConversationAuthoringClient.GetSupportedLanguages", projectKind, context); } - private Pageable GetSupportedLanguagesImplementation(string diagnosticsScopeName, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetSupportedLanguagesImplementation(string diagnosticsScopeName, string projectKind, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2567,8 +2532,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context) - : CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, top, skip, maxpagesize, context); + ? CreateGetSupportedLanguagesRequest(projectKind, context) + : CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2579,9 +2544,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the supported prebuilt entities that can be used while creating composed entities. /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// /// Schema for Response Body: @@ -2615,12 +2577,12 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(string language = null, bool? multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(string language = null, bool? multilingual = null, RequestContext context = null) { - return GetSupportedPrebuiltEntitiesImplementationAsync("ConversationAnalysisProjectsClient.GetSupportedPrebuiltEntities", language, multilingual, top, skip, maxpagesize, context); + return GetSupportedPrebuiltEntitiesImplementationAsync("ConversationAuthoringClient.GetSupportedPrebuiltEntities", language, multilingual, context); } - private AsyncPageable GetSupportedPrebuiltEntitiesImplementationAsync(string diagnosticsScopeName, string language, bool? multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetSupportedPrebuiltEntitiesImplementationAsync(string diagnosticsScopeName, string language, bool? multilingual, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2628,8 +2590,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context) - : CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, language, multilingual, top, skip, maxpagesize, context); + ? CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, context) + : CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, language, multilingual, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2640,9 +2602,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the supported prebuilt entities that can be used while creating composed entities. /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// /// Schema for Response Body: @@ -2676,12 +2635,12 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetSupportedPrebuiltEntities(string language = null, bool? multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetSupportedPrebuiltEntities(string language = null, bool? multilingual = null, RequestContext context = null) { - return GetSupportedPrebuiltEntitiesImplementation("ConversationAnalysisProjectsClient.GetSupportedPrebuiltEntities", language, multilingual, top, skip, maxpagesize, context); + return GetSupportedPrebuiltEntitiesImplementation("ConversationAuthoringClient.GetSupportedPrebuiltEntities", language, multilingual, context); } - private Pageable GetSupportedPrebuiltEntitiesImplementation(string diagnosticsScopeName, string language, bool? multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetSupportedPrebuiltEntitiesImplementation(string diagnosticsScopeName, string language, bool? multilingual, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2689,8 +2648,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context) - : CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, language, multilingual, top, skip, maxpagesize, context); + ? CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, context) + : CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, language, multilingual, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2700,9 +2659,6 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// Lists the support training config version for a given project type. /// The project kind. Allowed values: "Conversation" | "Orchestration". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// @@ -2736,14 +2692,14 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin /// /// /// - public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, RequestContext context = null) { Argument.AssertNotNull(projectKind, nameof(projectKind)); - return GetTrainingConfigVersionsImplementationAsync("ConversationAnalysisProjectsClient.GetTrainingConfigVersions", projectKind, top, skip, maxpagesize, context); + return GetTrainingConfigVersionsImplementationAsync("ConversationAuthoringClient.GetTrainingConfigVersions", projectKind, context); } - private AsyncPageable GetTrainingConfigVersionsImplementationAsync(string diagnosticsScopeName, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + private AsyncPageable GetTrainingConfigVersionsImplementationAsync(string diagnosticsScopeName, string projectKind, RequestContext context) { return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, ClientDiagnostics, diagnosticsScopeName); async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) @@ -2751,8 +2707,8 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context) - : CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, top, skip, maxpagesize, context); + ? CreateGetTrainingConfigVersionsRequest(projectKind, context) + : CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, context); var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); nextLink = page.ContinuationToken; yield return page; @@ -2762,9 +2718,6 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// Lists the support training config version for a given project type. /// The project kind. Allowed values: "Conversation" | "Orchestration". - /// The maximum number of resources to return from the collection. - /// An offset into the collection of the first resource to be returned. - /// The maximum number of resources to include in a single response. /// The request context, which can override default behaviors on the request on a per-call basis. /// is null. /// @@ -2798,14 +2751,14 @@ async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, /// /// /// - public virtual Pageable GetTrainingConfigVersions(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + public virtual Pageable GetTrainingConfigVersions(string projectKind, RequestContext context = null) { Argument.AssertNotNull(projectKind, nameof(projectKind)); - return GetTrainingConfigVersionsImplementation("ConversationAnalysisProjectsClient.GetTrainingConfigVersions", projectKind, top, skip, maxpagesize, context); + return GetTrainingConfigVersionsImplementation("ConversationAuthoringClient.GetTrainingConfigVersions", projectKind, context); } - private Pageable GetTrainingConfigVersionsImplementation(string diagnosticsScopeName, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + private Pageable GetTrainingConfigVersionsImplementation(string diagnosticsScopeName, string projectKind, RequestContext context) { return PageableHelpers.CreatePageable(CreateEnumerable, ClientDiagnostics, diagnosticsScopeName); IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) @@ -2813,8 +2766,8 @@ IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHin do { var message = string.IsNullOrEmpty(nextLink) - ? CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context) - : CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, top, skip, maxpagesize, context); + ? CreateGetTrainingConfigVersionsRequest(projectKind, context) + : CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, context); var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, context, "value", "nextLink"); nextLink = page.ContinuationToken; yield return page; @@ -2882,12 +2835,12 @@ public virtual async Task> DeleteProjectAsync(WaitUntil wa { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteProject"); scope.Start(); try { using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeleteProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeleteProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -2956,12 +2909,12 @@ public virtual Operation DeleteProject(WaitUntil waitUntil, string p { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteProject"); scope.Start(); try { using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeleteProject", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeleteProject", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3035,12 +2988,12 @@ public virtual async Task> ExportProjectAsync(WaitUntil wa Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.ExportProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.ExportProject"); scope.Start(); try { using HttpMessage message = CreateExportProjectRequest(projectName, exportedProjectFormat, assetKind, stringIndexType, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.ExportProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.ExportProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3114,12 +3067,12 @@ public virtual Operation ExportProject(WaitUntil waitUntil, string p Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.ExportProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.ExportProject"); scope.Start(); try { using HttpMessage message = CreateExportProjectRequest(projectName, exportedProjectFormat, assetKind, stringIndexType, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.ExportProject", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.ExportProject", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3210,12 +3163,12 @@ public virtual async Task> ImportProjectAsync(WaitUntil wa Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.ImportProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.ImportProject"); scope.Start(); try { using HttpMessage message = CreateImportProjectRequest(projectName, content, exportedProjectFormat, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.ImportProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.ImportProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3306,12 +3259,12 @@ public virtual Operation ImportProject(WaitUntil waitUntil, string p Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.ImportProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.ImportProject"); scope.Start(); try { using HttpMessage message = CreateImportProjectRequest(projectName, content, exportedProjectFormat, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.ImportProject", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.ImportProject", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3407,12 +3360,12 @@ public virtual async Task> TrainAsync(WaitUntil waitUntil, Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.Train"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.Train"); scope.Start(); try { using HttpMessage message = CreateTrainRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.Train", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.Train", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3508,12 +3461,12 @@ public virtual Operation Train(WaitUntil waitUntil, string projectNa Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.Train"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.Train"); scope.Start(); try { using HttpMessage message = CreateTrainRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.Train", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.Train", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3590,12 +3543,12 @@ public virtual async Task> SwapDeploymentsAsync(WaitUntil Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.SwapDeployments"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.SwapDeployments"); scope.Start(); try { using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.SwapDeployments", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.SwapDeployments", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3672,12 +3625,12 @@ public virtual Operation SwapDeployments(WaitUntil waitUntil, string Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.SwapDeployments"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.SwapDeployments"); scope.Start(); try { using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.SwapDeployments", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.SwapDeployments", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3735,12 +3688,12 @@ public virtual async Task> DeployProjectAsync(WaitUntil wa Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeployProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeployProject"); scope.Start(); try { using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeployProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeployProject", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3798,12 +3751,12 @@ public virtual Operation DeployProject(WaitUntil waitUntil, string p Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeployProject"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeployProject"); scope.Start(); try { using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeployProject", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeployProject", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -3874,12 +3827,12 @@ public virtual async Task> DeleteDeploymentAsync(WaitUntil Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteDeployment"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteDeployment"); scope.Start(); try { using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeleteDeployment", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeleteDeployment", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -3950,12 +3903,12 @@ public virtual Operation DeleteDeployment(WaitUntil waitUntil, strin Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.DeleteDeployment"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.DeleteDeployment"); scope.Start(); try { using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.DeleteDeployment", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.DeleteDeployment", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -4039,12 +3992,12 @@ public virtual async Task> CancelTrainingJobAsync(WaitUnti Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.CancelTrainingJob"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.CancelTrainingJob"); scope.Start(); try { using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.CancelTrainingJob", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.CancelTrainingJob", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -4128,12 +4081,12 @@ public virtual Operation CancelTrainingJob(WaitUntil waitUntil, stri Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - using var scope = ClientDiagnostics.CreateScope("ConversationAnalysisProjectsClient.CancelTrainingJob"); + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringClient.CancelTrainingJob"); scope.Start(); try { using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAnalysisProjectsClient.CancelTrainingJob", OperationFinalStateVia.Location, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringClient.CancelTrainingJob", OperationFinalStateVia.Location, context, waitUntil); } catch (Exception e) { @@ -4142,7 +4095,7 @@ public virtual Operation CancelTrainingJob(WaitUntil waitUntil, stri } } - internal HttpMessage CreateGetProjectsRequest(int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetProjectsRequest(RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4151,18 +4104,6 @@ internal HttpMessage CreateGetProjectsRequest(int? top, int? skip, int? maxpages uri.Reset(_endpoint); uri.AppendRaw("/language", false); uri.AppendPath("/authoring/analyze-conversations/projects", false); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4287,7 +4228,7 @@ internal HttpMessage CreateTrainRequest(string projectName, RequestContent conte return message; } - internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetDeploymentsRequest(string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4298,18 +4239,6 @@ internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? top, i uri.AppendPath("/authoring/analyze-conversations/projects/", false); uri.AppendPath(projectName, true); uri.AppendPath("/deployments", false); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4465,7 +4394,7 @@ internal HttpMessage CreateGetImportProjectJobStatusRequest(string projectName, return message; } - internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4476,18 +4405,6 @@ internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? top, uri.AppendPath("/authoring/analyze-conversations/projects/", false); uri.AppendPath(projectName, true); uri.AppendPath("/models", false); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4530,7 +4447,7 @@ internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string return message; } - internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4544,18 +4461,6 @@ internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, uri.AppendPath(trainedModelLabel, true); uri.AppendPath("/evaluation/result", false); uri.AppendQuery("stringIndexType", stringIndexType, true); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4581,7 +4486,7 @@ internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, return message; } - internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4592,18 +4497,6 @@ internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? top, uri.AppendPath("/authoring/analyze-conversations/projects/", false); uri.AppendPath(projectName, true); uri.AppendPath("/train/jobs", false); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4663,7 +4556,7 @@ internal HttpMessage CreateGetProjectDeletionJobStatusRequest(string jobId, Requ return message; } - internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4673,25 +4566,13 @@ internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? uri.AppendRaw("/language", false); uri.AppendPath("/authoring/analyze-conversations/projects/global/languages", false); uri.AppendQuery("projectKind", projectKind, true); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(string language, bool? multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(string language, bool? multilingual, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4708,25 +4589,13 @@ internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(string language, { uri.AppendQuery("multilingual", multilingual.Value, true); } - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4736,25 +4605,13 @@ internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, uri.AppendRaw("/language", false); uri.AppendPath("/authoring/analyze-conversations/projects/global/training-config-versions", false); uri.AppendQuery("projectKind", projectKind, true); - if (top != null) - { - uri.AppendQuery("top", top.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4768,7 +4625,7 @@ internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? top, return message; } - internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4782,7 +4639,7 @@ internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string return message; } - internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4796,7 +4653,7 @@ internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, stri return message; } - internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4810,7 +4667,7 @@ internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextL return message; } - internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4824,7 +4681,7 @@ internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, strin return message; } - internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4838,7 +4695,7 @@ internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, return message; } - internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, string language, bool? multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, string language, bool? multilingual, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4852,7 +4709,7 @@ internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string ne return message; } - internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md index b4faf52332738..5780ba6b20b34 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md @@ -12,6 +12,7 @@ batch: clear-output-folder: true - input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/725f4ca360426a32d20e81eb945065e62c285d6a/specification/cognitiveservices/data-plane/Language/stable/2022-05-01/analyzeconversations-authoring.json + namespace: Azure.AI.Language.Conversations.Authoring data-plane: true model-namespace: false @@ -201,4 +202,18 @@ directive: transform: | $["description"] = "Specifies the method used to interpret string offsets. Set this to \"Utf16CodeUnit\" for .NET strings, which are encoded as UTF-16."; $["x-ms-client-default"] = "Utf16CodeUnit"; + +# Remove explicit paging parameters until Azure/azure-sdk-for-net#29342 is resolved. +# where-operation-match (Azure/autorest#4565) and remove-parameter (Azure/autorest#4566) do not work correctly. +- from: swagger-document + where: $.paths.*.* + transform: | + var paramRefs = [ + "common.json#/parameters/TopParameter", + "common.json#/parameters/SkipParameter", + "common.json#/parameters/MaxPageSizeParameter" + ]; + if (/ConversationalAnalysisAuthoring_((List(Projects|Deployments|TrainedModels|TrainingJobs|TrainingConfigVersions))|Get(ModelEvaluationResults|SupportedLanguages|SupportedPrebuiltEntities))/.test($.operationId)) { + $.parameters = $.parameters.filter(param => !paramRefs.includes(param["$ref"])); + } ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAnalysisClientTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAnalysisClientTests.cs index b57d996e7fdc5..d4f40070d172c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAnalysisClientTests.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAnalysisClientTests.cs @@ -8,10 +8,6 @@ namespace Azure.AI.Language.Conversations.Tests { public class ConversationAnalysisClientTests { - public Uri Endpoint => new("https://test.api.cognitive.microsoft.com", UriKind.Absolute); - - public ConversationAnalysisClient Client => new(Endpoint, new AzureKeyCredential("test")); - [Test] public void ConversationAnalysisClientEndpointNull() { @@ -23,7 +19,7 @@ public void ConversationAnalysisClientEndpointNull() [Test] public void ConversationAnalysisClientCredentialNull() { - Uri endpoint = new("https://test.api.cognitive.microsoft.com", UriKind.Absolute); + Uri endpoint = new("https://test.cognitive.microsoft.com", UriKind.Absolute); ArgumentNullException ex = Assert.Throws( () => new ConversationAnalysisClient(endpoint, null)); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientLiveTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientLiveTests.cs new file mode 100644 index 0000000000000..3eb27ee0d4caa --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientLiveTests.cs @@ -0,0 +1,51 @@ +ļ»æ// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Authoring; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Tests +{ + public class ConversationAuthoringClientLiveTests : ConversationAnalysisTestBase + { + public ConversationAuthoringClientLiveTests(bool isAsync, ConversationAnalysisClientOptions.ServiceVersion serviceVersion) + : base(isAsync, serviceVersion, null /* RecordedTestMode.Record /* to record */) + { + } + + [RecordedTest] + public async Task GetSupportedMultilingualPrebuiltEntities() + { + // Make sure our redefinition of the multilingual parameter as a boolean works correctly. + AsyncPageable response = Client.GetSupportedPrebuiltEntitiesAsync(multilingual: true); + Assert.That(await response.ToEnumerableAsync(), Has.Count.AtLeast(1)); + } + + [RecordedTest] + public async Task GetSupportedLanguageSpecificPrebuiltEntities() + { + // Make sure our redefinition of the multilingual parameter as a boolean works correctly. + AsyncPageable response = Client.GetSupportedPrebuiltEntitiesAsync(language: "es", multilingual: false); + Assert.That(await response.ToEnumerableAsync(), Has.Count.AtLeast(1)); + } + + [RecordedTest] + public async Task GetProjects() + { + // Make sure pageables still work after removing explicit parameters (Azure/azure-sdk-for-net#29331). + AsyncPageable response = Client.GetProjectsAsync(); + Assert.That(await response.ToEnumerableAsync(), Has.Count.AtLeast(1)); + } + + [RecordedTest] + public async Task GetTrainedModels() + { + // Make sure pageables still work after removing explicit parameters (Azure/azure-sdk-for-net#29331). + AsyncPageable response = Client.GetTrainedModelsAsync(TestEnvironment.ProjectName); + Assert.That(await response.ToEnumerableAsync(), Has.Count.AtLeast(1)); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientTests.cs new file mode 100644 index 0000000000000..57628e27c6347 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationAuthoringClientTests.cs @@ -0,0 +1,30 @@ +ļ»æ// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.AI.Language.Conversations.Authoring; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Tests +{ + public class ConversationAuthoringClientTests + { + [Test] + public void ConversationAuthoringClientEndpointNull() + { + ArgumentNullException ex = Assert.Throws( + () => new ConversationAuthoringClient(null, null)); + Assert.AreEqual("endpoint", ex.ParamName); + } + + [Test] + public void ConversationAuthoringClientCredentialNull() + { + Uri endpoint = new("https://test.cognitive.microsoft.com", UriKind.Absolute); + + ArgumentNullException ex = Assert.Throws( + () => new ConversationAuthoringClient(endpoint, null)); + Assert.AreEqual("credential", ex.ParamName); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/ConversationAnalysisRestClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/ConversationAnalysisRestClient.cs index 3133713c169f9..001899e5474d0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/ConversationAnalysisRestClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/ConversationAnalysisRestClient.cs @@ -18,7 +18,7 @@ namespace Azure.AI.Language.Conversations internal partial class ConversationAnalysisRestClient { private readonly HttpPipeline _pipeline; - private readonly string _endpoint; + private readonly Uri _endpoint; private readonly string _apiVersion; /// The ClientDiagnostics is used to provide tracing support for the client library. @@ -30,7 +30,7 @@ internal partial class ConversationAnalysisRestClient /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.cognitiveservices.azure.com). /// Api Version. /// , , or is null. - public ConversationAnalysisRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2022-05-01") + public ConversationAnalysisRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2022-05-01") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -44,7 +44,7 @@ internal HttpMessage CreateAnalyzeConversationRequest(AnalyzeConversationTask bo var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendRaw("/language", false); uri.AppendPath("/:analyze-conversations", false); uri.AppendQuery("api-version", _apiVersion, true); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisClientSamples.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisClientSamples.cs index ada1adb12d9a4..54a37785f178d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisClientSamples.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisClientSamples.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Authoring; using Azure.Core.TestFramework; namespace Azure.AI.Language.Conversations.Tests.Samples @@ -13,13 +14,13 @@ public ConversationAnalysisClientSamples(bool isAsync, ConversationAnalysisClien { } - protected ConversationAnalysisProjectsClient ProjectsClient { get; private set; } + protected ConversationAuthoringClient ProjectsClient { get; private set; } public async override Task StartTestRecordingAsync() { await base.StartTestRecordingAsync(); - ProjectsClient = CreateClient( + ProjectsClient = CreateClient( TestEnvironment.Endpoint, new AzureKeyCredential(TestEnvironment.ApiKey), InstrumentClientOptions( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs index bcf1bea2f0966..87591437526e7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs @@ -2,9 +2,13 @@ // Licensed under the MIT License. using System; -using Azure.Core; using Azure.Core.TestFramework; +#region Snippet:ConversationAnalysisClient_Namespaces +using Azure.Core; +using Azure.AI.Language.Conversations; +#endregion + namespace Azure.AI.Language.Conversations.Tests.Samples { public partial class ConversationAnalysisClientSamples : ConversationAnalysisTestBase diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample1_AnalyzeConversation_ConversationPrediction.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample1_AnalyzeConversation_ConversationPrediction.cs index 7c166d859a9f3..9f2c5a0d12f9d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample1_AnalyzeConversation_ConversationPrediction.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample1_AnalyzeConversation_ConversationPrediction.cs @@ -74,19 +74,17 @@ public void AnalyzeConversation() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -102,13 +100,8 @@ public async Task AnalyzeConversationAsync() { ConversationAnalysisClient client = Client; - #region Snippet:ConversationAnalysis_AnalyzeConversationAsync - string projectName = "Menu"; - string deploymentName = "production"; -#if !SNIPPET - projectName = TestEnvironment.ProjectName; - deploymentName = TestEnvironment.DeploymentName; -#endif + string projectName = TestEnvironment.ProjectName; + string deploymentName = TestEnvironment.DeploymentName; var data = new { @@ -132,6 +125,7 @@ public async Task AnalyzeConversationAsync() kind = "Conversation", }; + #region Snippet:ConversationAnalysis_AnalyzeConversationAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); #endregion @@ -159,19 +153,17 @@ public async Task AnalyzeConversationAsync() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) - { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample2_AnalyzeConversation_OrchestrationPrediction.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample2_AnalyzeConversation_OrchestrationPrediction.cs index 75f85b309bf52..603f0418a57bb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample2_AnalyzeConversation_OrchestrationPrediction.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample2_AnalyzeConversation_OrchestrationPrediction.cs @@ -137,19 +137,17 @@ public void AnalyzeConversationOrchestrationPredictionConversation() Console.WriteLine($"Length: {entity.GetProperty("length").GetInt32()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -215,13 +213,8 @@ public async Task AnalyzeConversationOrchestrationPredictionQuestionAnsweringAsy { ConversationAnalysisClient client = Client; - #region Snippet:ConversationAnalysis_AnalyzeConversationOrchestrationPredictionAsync - string projectName = "DomainOrchestrator"; - string deploymentName = "production"; -#if !SNIPPET - projectName = TestEnvironment.OrchestrationProjectName; - deploymentName = TestEnvironment.OrchestrationDeploymentName; -#endif + string projectName = TestEnvironment.OrchestrationProjectName; + string deploymentName = TestEnvironment.OrchestrationDeploymentName; var data = new { @@ -245,6 +238,7 @@ public async Task AnalyzeConversationOrchestrationPredictionQuestionAnsweringAsy kind = "Conversation", }; + #region Snippet:ConversationAnalysis_AnalyzeConversationOrchestrationPredictionAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); using JsonDocument result = await JsonDocument.ParseAsync(response.ContentStream); @@ -331,19 +325,17 @@ public async Task AnalyzeConversationOrchestrationPredictionConversationAsync() Console.WriteLine($"Length: {entity.GetProperty("length").GetInt32()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) - { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample3_AnalyzeConversationWithOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample3_AnalyzeConversationWithOptions.cs index e331ae89378de..b067eb640ca94 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample3_AnalyzeConversationWithOptions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample3_AnalyzeConversationWithOptions.cs @@ -77,19 +77,17 @@ public void AnalyzeConversationWithOptions() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -104,13 +102,8 @@ public async Task AnalyzeConversationWithOptionsAsync() { ConversationAnalysisClient client = Client; - #region Snippet:ConversationAnalysis_AnalyzeConversationWithOptionsAsync - string projectName = "Menu"; - string deploymentName = "production"; -#if !SNIPPET - projectName = TestEnvironment.ProjectName; - deploymentName = TestEnvironment.DeploymentName; -#endif + string projectName = TestEnvironment.ProjectName; + string deploymentName = TestEnvironment.DeploymentName; var data = new { @@ -135,6 +128,7 @@ public async Task AnalyzeConversationWithOptionsAsync() kind = "Conversation", }; + #region Snippet:ConversationAnalysis_AnalyzeConversationWithOptionsAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); #endregion @@ -163,19 +157,17 @@ public async Task AnalyzeConversationWithOptionsAsync() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) - { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample4_AnalyzeConversationWithLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample4_AnalyzeConversationWithLanguage.cs index ca26e80aca21c..1a7cf88697482 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample4_AnalyzeConversationWithLanguage.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample4_AnalyzeConversationWithLanguage.cs @@ -78,19 +78,17 @@ public void AnalyzeConversationWithLanguage() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) - { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } @@ -105,13 +103,8 @@ public async Task AnalyzeConversationWithLanguageAsync() { ConversationAnalysisClient client = Client; - #region Snippet:ConversationAnalysis_AnalyzeConversationWithLanguageAsync - string projectName = "Menu"; - string deploymentName = "production"; -#if !SNIPPET - projectName = TestEnvironment.ProjectName; - deploymentName = TestEnvironment.DeploymentName; -#endif + string projectName = TestEnvironment.ProjectName; + string deploymentName = TestEnvironment.DeploymentName; var data = new { @@ -137,6 +130,7 @@ public async Task AnalyzeConversationWithLanguageAsync() kind = "Conversation", }; + #region Snippet:ConversationAnalysis_AnalyzeConversationWithLanguageAsync Response response = await client.AnalyzeConversationAsync(RequestContent.Create(data)); #endregion @@ -165,19 +159,17 @@ public async Task AnalyzeConversationWithLanguageAsync() Console.WriteLine($"Confidence: {entity.GetProperty("confidenceScore").GetSingle()}"); Console.WriteLine(); - if (!entity.TryGetProperty("resolutions", out JsonElement resolutions)) - { - continue; - } - - foreach (JsonElement resolution in resolutions.EnumerateArray()) + if (entity.TryGetProperty("resolutions", out JsonElement resolutions)) { - if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + foreach (JsonElement resolution in resolutions.EnumerateArray()) { - Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); - Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); - Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); - Console.WriteLine(); + if (resolution.GetProperty("resolutionKind").GetString() == "DateTimeResolution") + { + Console.WriteLine($"Datetime Sub Kind: {resolution.GetProperty("dateTimeSubKind").GetString()}"); + Console.WriteLine($"Timex: {resolution.GetProperty("timex").GetString()}"); + Console.WriteLine($"Value: {resolution.GetProperty("value").GetString()}"); + Console.WriteLine(); + } } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample5_ImportProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample5_ImportProject.cs index cb5395392b417..fd4f300512e39 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample5_ImportProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample5_ImportProject.cs @@ -5,23 +5,27 @@ using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; -using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +#region Snippet:ConversationAuthoringClient_Namespaces +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +#endregion + namespace Azure.AI.Language.Conversations.Tests.Samples { public partial class ConversationAnalysisClientSamples { private readonly List _projects = new(); - public void CreateConversationAnalysisProjectsClient() + public void CreateConversationAuthoringClient() { - #region Snippet:ConversationAnalysisProjectsClient_Create + #region Snippet:ConversationAuthoringClient_Create Uri endpoint = new Uri("https://myaccount.cognitive.microsoft.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); - ConversationAnalysisProjectsClient client = new ConversationAnalysisProjectsClient(endpoint, credential); + ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); #endregion } @@ -30,15 +34,15 @@ public void CreateConversationAnalysisProjectsClient() [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/29140")] public void ImportProject() { - ConversationAnalysisProjectsClient client = ProjectsClient; + ConversationAuthoringClient client = ProjectsClient; - #region Snippet:ConversationAnalysisProjectsClient_ImportProject + #region Snippet:ConversationAuthoringClient_ImportProject string projectName = "Menu"; #if !SNIPPET projectName = Recording.GenerateId("net-conv-", 100); #endif - // Define our project assets and import. + // Define our project assets and import. In practice this would most often be read from a file. var importData = new { projectFileVersion = "2022-05-01", @@ -124,9 +128,10 @@ public void ImportProject() Operation importOperation = client.ImportProject(WaitUntil.Started, projectName, RequestContent.Create(importData)); #if !SNIPPET _projects.Add(projectName); + importOperation = InstrumentOperation(importOperation); -#endif importOperation.WaitForCompletion(); +#endif // Train the model. var trainData = new @@ -135,11 +140,18 @@ public void ImportProject() trainingMode = "standard", }; + Console.WriteLine($"Training project {projectName}..."); +#if SNIPPET + Operation trainOperation = client.Train( + WaitUntil.Completed, + projectName, + RequestContent.Create(trainData)); +#else Operation trainOperation = client.Train(WaitUntil.Started, projectName, RequestContent.Create(trainData)); -#if !SNIPPET + trainOperation = InstrumentOperation(trainOperation); -#endif trainOperation.WaitForCompletion(); +#endif // Deploy the model. var deployData = new @@ -147,11 +159,21 @@ public void ImportProject() trainedModelLabel = "Sample5", }; + Console.WriteLine($"Deploying project {projectName} to production..."); +#if SNIPPET + Operation deployOperation = client.DeployProject( + WaitUntil.Completed, + projectName, + "production", + RequestContent.Create(deployData)); +#else Operation deployOperation = client.DeployProject(WaitUntil.Started, projectName, "production", RequestContent.Create(deployData)); -#if !SNIPPET + deployOperation = InstrumentOperation(deployOperation); -#endif deployOperation.WaitForCompletion(); +#endif + + Console.WriteLine("Import complete"); #endregion using JsonDocument doc = JsonDocument.Parse(deployOperation.Value); @@ -162,13 +184,9 @@ public void ImportProject() [RecordedTest] public async Task ImportProjectAsync() { - ConversationAnalysisProjectsClient client = ProjectsClient; + ConversationAuthoringClient client = ProjectsClient; - #region Snippet:ConversationAnalysisProjectsClient_ImportProjectAsync - string projectName = "Menu"; -#if !SNIPPET - projectName = Recording.GenerateId("net-conv-", 100); -#endif + string projectName = Recording.GenerateId("net-conv-", 100); // Define our project assets and import. var importData = new @@ -254,12 +272,14 @@ public async Task ImportProjectAsync() stringIndexType = "Utf16CodeUnit", }; + #region Snippet:ConversationAuthoringClient_ImportProjectAsync Operation importOperation = await client.ImportProjectAsync(WaitUntil.Started, projectName, RequestContent.Create(importData)); #if !SNIPPET _projects.Add(projectName); - //importOperation = InstrumentOperation(importOperation); -#endif + + importOperation = InstrumentOperation(importOperation); await importOperation.WaitForCompletionAsync(); +#endif // Train the model. var trainData = new @@ -268,11 +288,18 @@ public async Task ImportProjectAsync() trainingMode = "standard", }; + Console.WriteLine($"Training project {projectName}..."); +#if SNIPPET + Operation trainOperation = await client.TrainAsync( + WaitUntil.Completed, + projectName, + RequestContent.Create(trainData)); +#else Operation trainOperation = await client.TrainAsync(WaitUntil.Started, projectName, RequestContent.Create(trainData)); -#if !SNIPPET - //trainOperation = InstrumentOperation(trainOperation); -#endif + + trainOperation = InstrumentOperation(trainOperation); await trainOperation.WaitForCompletionAsync(); +#endif // Deploy the model. var deployData = new @@ -280,11 +307,21 @@ public async Task ImportProjectAsync() trainedModelLabel = "Sample5", }; + Console.WriteLine($"Deploying project {projectName} to production..."); +#if SNIPPET + Operation deployOperation = await client.DeployProjectAsync( + WaitUntil.Completed, + projectName, + "production", + RequestContent.Create(deployData)); +#else Operation deployOperation = await client.DeployProjectAsync(WaitUntil.Started, projectName, "production", RequestContent.Create(deployData)); -#if !SNIPPET - //deployOperation = InstrumentOperation(deployOperation); -#endif + + deployOperation = InstrumentOperation(deployOperation); await deployOperation.WaitForCompletionAsync(); +#endif + + Console.WriteLine("Import complete"); #endregion using JsonDocument doc = JsonDocument.Parse(deployOperation.Value); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjects.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjects.json new file mode 100644 index 0000000000000..c7e713e1808c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjects.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects?api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-3740914a44a242ccd7c8e15c878248d9-6b5ed7c5f2c342fc-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220617.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "a014077dcc6e40fedda8522309eaa047", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "61f9baa8-848c-4056-90dc-89fa7ea0a4e3", + "Content-Length": "455", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 18 Jun 2022 00:44:13 GMT", + "request-id": "61f9baa8-848c-4056-90dc-89fa7ea0a4e3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "337" + }, + "ResponseBody": { + "value": [ + { + "createdDateTime": "2022-06-05T12:36:31Z", + "lastModifiedDateTime": "2022-06-05T12:40:18Z", + "projectKind": "Orchestration", + "projectName": "OrchestrationScriptDeployed", + "multilingual": false, + "description": "", + "language": "en-us" + }, + { + "createdDateTime": "2022-06-05T11:05:30Z", + "lastModifiedDateTime": "2022-06-05T12:30:03Z", + "projectKind": "Conversation", + "projectName": "CLUScriptDeployed", + "multilingual": true, + "description": "", + "language": "en-us" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "72039817" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjectsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjectsAsync.json new file mode 100644 index 0000000000000..d624aed1bedb1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetProjectsAsync.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects?api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-7d1eec4e8b3393e73f7543fe319b46f1-a0b0e61195853939-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220617.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "e93f70188d591bdbc45d63f57536d9f4", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "55c53765-64a5-4f61-9b10-aec698d24c99", + "Content-Length": "455", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 18 Jun 2022 00:44:14 GMT", + "request-id": "55c53765-64a5-4f61-9b10-aec698d24c99", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "351" + }, + "ResponseBody": { + "value": [ + { + "createdDateTime": "2022-06-05T12:36:31Z", + "lastModifiedDateTime": "2022-06-05T12:40:18Z", + "projectKind": "Orchestration", + "projectName": "OrchestrationScriptDeployed", + "multilingual": false, + "description": "", + "language": "en-us" + }, + { + "createdDateTime": "2022-06-05T11:05:30Z", + "lastModifiedDateTime": "2022-06-05T12:30:03Z", + "projectKind": "Conversation", + "projectName": "CLUScriptDeployed", + "multilingual": true, + "description": "", + "language": "en-us" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "497800017" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntities.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntities.json new file mode 100644 index 0000000000000..6b3ef04b3ba1b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntities.json @@ -0,0 +1,104 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=es\u0026multilingual=false\u0026api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-d5020e1d13b15823af2d57b01fffa9f7-df31158ef328fe97-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220616.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "9fa7279161b88a7fab40bc73a7de0c28", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ab3dd034-879c-4626-808f-cd8d4b6e12e8", + "Content-Length": "1656", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 17 Jun 2022 00:30:34 GMT", + "request-id": "ab3dd034-879c-4626-808f-cd8d4b6e12e8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "19" + }, + "ResponseBody": { + "value": [ + { + "category": "Choice.Boolean", + "description": "boolean choice", + "examples": "yes, no, agreed" + }, + { + "category": "Quantity.Age", + "description": "Age of a person or thing", + "examples": "10-month-old, 19 years old, 58 year-old" + }, + { + "category": "Quantity.NumberRange", + "description": "a numeric interval", + "examples": "between 25 and 35, 25-35" + }, + { + "category": "Quantity.Number", + "description": "A cardinal number in numeric or text form", + "examples": "ten, forty two, 3.141, 10K" + }, + { + "category": "Quantity.Percentage", + "description": "A percentage, using the symbol % or the word \u0022percent\u0022", + "examples": "10%, 5.6 percent" + }, + { + "category": "Quantity.Ordinal", + "description": "An ordinal number in numeric or text form", + "examples": "first, second, tenth, 1st, 2nd, 10th" + }, + { + "category": "Quantity.Dimension", + "description": "Spacial dimensions, including length, distance, area, and volume", + "examples": "2 miles, 650 square kilometres, 9,350 feet" + }, + { + "category": "Quantity.Temperature", + "description": "A temperature in celsius or fahrenheit", + "examples": "32F, 34 degrees celsius, 2 deg C" + }, + { + "category": "Quantity.Currency", + "description": "Monetary amounts, including currency", + "examples": "1000.00 US dollars, \u00A320.00, $ 67.5 B" + }, + { + "category": "DateTime", + "description": "exact date values", + "examples": "May 11th" + }, + { + "category": "Email", + "description": "Email addresses", + "examples": "user@example.net, user_name@example.com, user.Name12@example.net" + }, + { + "category": "Phone Number", + "description": "US phone numbers", + "examples": "123-456-7890, \u002B1 123 456 789, (123)456-789" + }, + { + "category": "URL", + "description": "Websites URLs and links", + "examples": "www.example.com, http://example.net?name=my_name\u0026age=10" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "46712923" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntitiesAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntitiesAsync.json new file mode 100644 index 0000000000000..41fdf341e6f78 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedLanguageSpecificPrebuiltEntitiesAsync.json @@ -0,0 +1,104 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?language=es\u0026multilingual=false\u0026api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-c9a4cfa135f71eb4203514dbb6002262-230e57cbb5817982-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220616.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "04648486c45cc8e33856dc0faac8ddef", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3b0e3323-a78a-4aca-81e3-0e9ec9b91741", + "Content-Length": "1656", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 17 Jun 2022 00:30:34 GMT", + "request-id": "3b0e3323-a78a-4aca-81e3-0e9ec9b91741", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "179" + }, + "ResponseBody": { + "value": [ + { + "category": "Choice.Boolean", + "description": "boolean choice", + "examples": "yes, no, agreed" + }, + { + "category": "Quantity.Age", + "description": "Age of a person or thing", + "examples": "10-month-old, 19 years old, 58 year-old" + }, + { + "category": "Quantity.NumberRange", + "description": "a numeric interval", + "examples": "between 25 and 35, 25-35" + }, + { + "category": "Quantity.Number", + "description": "A cardinal number in numeric or text form", + "examples": "ten, forty two, 3.141, 10K" + }, + { + "category": "Quantity.Percentage", + "description": "A percentage, using the symbol % or the word \u0022percent\u0022", + "examples": "10%, 5.6 percent" + }, + { + "category": "Quantity.Ordinal", + "description": "An ordinal number in numeric or text form", + "examples": "first, second, tenth, 1st, 2nd, 10th" + }, + { + "category": "Quantity.Dimension", + "description": "Spacial dimensions, including length, distance, area, and volume", + "examples": "2 miles, 650 square kilometres, 9,350 feet" + }, + { + "category": "Quantity.Temperature", + "description": "A temperature in celsius or fahrenheit", + "examples": "32F, 34 degrees celsius, 2 deg C" + }, + { + "category": "Quantity.Currency", + "description": "Monetary amounts, including currency", + "examples": "1000.00 US dollars, \u00A320.00, $ 67.5 B" + }, + { + "category": "DateTime", + "description": "exact date values", + "examples": "May 11th" + }, + { + "category": "Email", + "description": "Email addresses", + "examples": "user@example.net, user_name@example.com, user.Name12@example.net" + }, + { + "category": "Phone Number", + "description": "US phone numbers", + "examples": "123-456-7890, \u002B1 123 456 789, (123)456-789" + }, + { + "category": "URL", + "description": "Websites URLs and links", + "examples": "www.example.com, http://example.net?name=my_name\u0026age=10" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "898833194" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntities.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntities.json new file mode 100644 index 0000000000000..3e7ee366aa0ec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntities.json @@ -0,0 +1,119 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?multilingual=true\u0026api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-7d57f30746b2b75e13a9a6b741b755ca-2ecc6375ea66d66d-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220616.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "56ac1822720322196472c18218e2696b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0e5d5969-dd01-48d0-9b9f-b36a049a2dae", + "Content-Length": "1959", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 17 Jun 2022 00:17:26 GMT", + "request-id": "0e5d5969-dd01-48d0-9b9f-b36a049a2dae", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36" + }, + "ResponseBody": { + "value": [ + { + "category": "Person.Name", + "description": "Name of an individual", + "examples": "john, Sam, Lisa" + }, + { + "category": "General.Event", + "description": "Important events", + "examples": "World War two, Covid 19" + }, + { + "category": "General.Organization", + "description": "Companies and corporations", + "examples": "Microsoft, Amazon" + }, + { + "category": "Choice.Boolean", + "description": "boolean choice", + "examples": "yes, no, agreed" + }, + { + "category": "Quantity.Age", + "description": "Age of a person or thing", + "examples": "10-month-old, 19 years old, 58 year-old" + }, + { + "category": "Quantity.NumberRange", + "description": "a numeric interval", + "examples": "between 25 and 35, 25-35" + }, + { + "category": "Quantity.Number", + "description": "A cardinal number in numeric or text form", + "examples": "ten, forty two, 3.141, 10K" + }, + { + "category": "Quantity.Percentage", + "description": "A percentage, using the symbol % or the word \u0022percent\u0022", + "examples": "10%, 5.6 percent" + }, + { + "category": "Quantity.Ordinal", + "description": "An ordinal number in numeric or text form", + "examples": "first, second, tenth, 1st, 2nd, 10th" + }, + { + "category": "Quantity.Dimension", + "description": "Spacial dimensions, including length, distance, area, and volume", + "examples": "2 miles, 650 square kilometres, 9,350 feet" + }, + { + "category": "Quantity.Temperature", + "description": "A temperature in celsius or fahrenheit", + "examples": "32F, 34 degrees celsius, 2 deg C" + }, + { + "category": "Quantity.Currency", + "description": "Monetary amounts, including currency", + "examples": "1000.00 US dollars, \u00A320.00, $ 67.5 B" + }, + { + "category": "DateTime", + "description": "exact date values", + "examples": "May 11th" + }, + { + "category": "Email", + "description": "Email addresses", + "examples": "user@example.net, user_name@example.com, user.Name12@example.net" + }, + { + "category": "Phone Number", + "description": "US phone numbers", + "examples": "123-456-7890, \u002B1 123 456 789, (123)456-789" + }, + { + "category": "URL", + "description": "Websites URLs and links", + "examples": "www.example.com, http://example.net?name=my_name\u0026age=10" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "879092633" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntitiesAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntitiesAsync.json new file mode 100644 index 0000000000000..967068520b617 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetSupportedMultilingualPrebuiltEntitiesAsync.json @@ -0,0 +1,119 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/prebuilt-entities?multilingual=true\u0026api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b7ee98bdeabd6bc6b15239648386deca-62e78131ae159511-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220616.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "30d21f01ab3bcb2fba618a98d7eda574", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a0e17537-5cbe-46c5-9e8c-b3c20db5f6be", + "Content-Length": "1959", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 17 Jun 2022 00:17:26 GMT", + "request-id": "a0e17537-5cbe-46c5-9e8c-b3c20db5f6be", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50" + }, + "ResponseBody": { + "value": [ + { + "category": "Person.Name", + "description": "Name of an individual", + "examples": "john, Sam, Lisa" + }, + { + "category": "General.Event", + "description": "Important events", + "examples": "World War two, Covid 19" + }, + { + "category": "General.Organization", + "description": "Companies and corporations", + "examples": "Microsoft, Amazon" + }, + { + "category": "Choice.Boolean", + "description": "boolean choice", + "examples": "yes, no, agreed" + }, + { + "category": "Quantity.Age", + "description": "Age of a person or thing", + "examples": "10-month-old, 19 years old, 58 year-old" + }, + { + "category": "Quantity.NumberRange", + "description": "a numeric interval", + "examples": "between 25 and 35, 25-35" + }, + { + "category": "Quantity.Number", + "description": "A cardinal number in numeric or text form", + "examples": "ten, forty two, 3.141, 10K" + }, + { + "category": "Quantity.Percentage", + "description": "A percentage, using the symbol % or the word \u0022percent\u0022", + "examples": "10%, 5.6 percent" + }, + { + "category": "Quantity.Ordinal", + "description": "An ordinal number in numeric or text form", + "examples": "first, second, tenth, 1st, 2nd, 10th" + }, + { + "category": "Quantity.Dimension", + "description": "Spacial dimensions, including length, distance, area, and volume", + "examples": "2 miles, 650 square kilometres, 9,350 feet" + }, + { + "category": "Quantity.Temperature", + "description": "A temperature in celsius or fahrenheit", + "examples": "32F, 34 degrees celsius, 2 deg C" + }, + { + "category": "Quantity.Currency", + "description": "Monetary amounts, including currency", + "examples": "1000.00 US dollars, \u00A320.00, $ 67.5 B" + }, + { + "category": "DateTime", + "description": "exact date values", + "examples": "May 11th" + }, + { + "category": "Email", + "description": "Email addresses", + "examples": "user@example.net, user_name@example.com, user.Name12@example.net" + }, + { + "category": "Phone Number", + "description": "US phone numbers", + "examples": "123-456-7890, \u002B1 123 456 789, (123)456-789" + }, + { + "category": "URL", + "description": "Websites URLs and links", + "examples": "www.example.com, http://example.net?name=my_name\u0026age=10" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "RandomSeed": "532900978" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModels.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModels.json new file mode 100644 index 0000000000000..021128f5c1e1e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModels.json @@ -0,0 +1,48 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/CLUScriptDeployed/models?api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-0e20576b6a8e041c3fd0154ff72c7e13-6172aa74a2824be1-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220617.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "a2ec1ef126caa1b36b07131e43144ad2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "daea8987-5870-4252-9770-f85e87bcf9e6", + "Content-Length": "271", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 18 Jun 2022 00:44:14 GMT", + "request-id": "daea8987-5870-4252-9770-f85e87bcf9e6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "365" + }, + "ResponseBody": { + "value": [ + { + "label": "model1", + "modelId": "model1-20220605T110641-613773bae1a04e9d9ae3baff5ffcae5e", + "lastTrainedDateTime": "2022-06-05T11:06:41Z", + "lastTrainingDurationInSeconds": 21, + "modelExpirationDate": "2022-10-28", + "modelTrainingConfigVersion": "2022-05-01" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "CONVERSATIONS_PROJECT_NAME": "CLUScriptDeployed", + "RandomSeed": "1434629996" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModelsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModelsAsync.json new file mode 100644 index 0000000000000..68fb09557cf4d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/SessionRecords/ConversationAuthoringClientLiveTests/GetTrainedModelsAsync.json @@ -0,0 +1,48 @@ +{ + "Entries": [ + { + "RequestUri": "https://languagesdkresource.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/CLUScriptDeployed/models?api-version=2022-05-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-c9a2180f398393021ca11bd7bab9e765-ab2d1ecbb47853be-00", + "User-Agent": "azsdk-net-AI.Language.Conversations/1.0.0-alpha.20220617.1 (.NET 6.0.6; Microsoft Windows 10.0.22000)", + "x-ms-client-request-id": "54fa45554a40013dfb0aeb1c576608c4", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c5f2acf4-a1a1-46b0-8ecb-cb541fe523b2", + "Content-Length": "271", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 18 Jun 2022 00:44:15 GMT", + "request-id": "c5f2acf4-a1a1-46b0-8ecb-cb541fe523b2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "291" + }, + "ResponseBody": { + "value": [ + { + "label": "model1", + "modelId": "model1-20220605T110641-613773bae1a04e9d9ae3baff5ffcae5e", + "lastTrainedDateTime": "2022-06-05T11:06:41Z", + "lastTrainingDurationInSeconds": 21, + "modelExpirationDate": "2022-10-28", + "modelTrainingConfigVersion": "2022-05-01" + } + ], + "nextLink": null + } + } + ], + "Variables": { + "CONVERSATIONS_ENDPOINT": "https://languagesdkresource.cognitiveservices.azure.com/", + "CONVERSATIONS_KEY": "Sanitized", + "CONVERSATIONS_PROJECT_NAME": "CLUScriptDeployed", + "RandomSeed": "1550602700" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/autorest.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/autorest.md index 927f5aa5b684f..d905fb3176786 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/autorest.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/autorest.md @@ -25,7 +25,7 @@ modelerfour: Customizations that should eventually be added to central autorest configuration. -### Model customizations +### General customizations ``` yaml directive: @@ -55,9 +55,10 @@ directive: $["description"] = "Specifies the method used to interpret string offsets. Set this to \"Utf16CodeUnit\" for .NET strings, which are encoded as UTF-16."; $["x-ms-client-default"] = "Utf16CodeUnit"; -# Correct Endpoint parameter description to reference right domain suffix. +# Fix Endpoint parameter description and format. - from: swagger-document where: $.parameters.Endpoint - transform: > - $["description"] = "Supported Cognitive Services endpoint (e.g., https://.cognitiveservices.azure.com)." + transform: | + $["description"] = "Supported Cognitive Services endpoint (e.g., https://.cognitiveservices.azure.com)."; + $["format"] = "url"; ```