Skip to content

Commit ad50db4

Browse files
authored
Resolving comments for conversation authoring sdk release (Azure#47887)
* modify the clientname to AnalyzeConversationClient and add the AnalyzeConversationClientOptions * - collapse the client level, only use AnalyzeConversationClient * suppress `export` with StringIndexType and set it to correct value internally * -add more subclients. * modifed all getsubclients methods. * remove confusionMatrix and confusionRow and use Record<Record<ConfusionCell>> directly * add one more customed ProjectFilesConversationAuthoringAnalusis and add export and exportAsync in it. * remove custom getSubClients functions to generate the annotation for use. * add annotation to all custom methods for successful pack * changed AnalyzeConversationClient to AnalyzeConversationAuthoringClient * change prefix from AnalyzeConversation to AnalyzeConversationAuthoring for all common models * modify files to successfully generate nupkg * change the subclientname to ConversationAuthoring+ClientletNoun * change the main client name from AnalyzeConversationAuthoringClient to ConversationAnalysisAuthoringClient * add prefix 'ConversationAnalysisAuthoring' to main client and clientOption. * - pass the project name to the subclient constrcutor - remove client suffix from getSubclient functions * remove the projectName parameter from all functions of ConversationAuthoringCopyProject * - remove the projectName parameter from all functions of ConversationAuthoringDeploymentResources * remove the projectName parameter from all functions of ConversationAuthoringDeployments * remove the projectName parameter from all functions of ConversationAuthoringExportedModels * remove the projectName parameter from all functions of ConversationAuthoringModels * remove ConversationAuthoringPrebuilts constructor with projectname * remove the projectName parameter from all functions of ConversationAuthoringProjectFiles * remove ConversationAuthoringProjects constructor with projectname * remove the projectName parameter from all functions of ConversationAuthoringTraining * change property `DeploymentExpirationDate` to `DeploymentExpiresOn` * modify properties type to Azure Regions and Azure Resource Id * add AssignedDeploymentResource constructor with AzureLocation and ResourceIdentifierId * change the doc comments of most functions to include the new change of removing ProjectName from functions parameters * updated ConversationAuthoringCopyProject to ConversationAuthoringCopiedProject, GetCopyProject to GetCopiedProject * changed the list function to paginated templates * add one enum type DatasetType for dataset * Have updated the name to ConversationAnalysisAuthoringModelFactory and move it to .Models namespace. * Have updated the namespace of Extension to `Microsoft.Extensions.Azure` * Changed operation name from `copyProjectAuthorization` to `AuthorizeProjectCopy` * updated parameter name 'body' to 'details' * adjust the stucture for ConversationAuthoringProject clientlet * updated the clientlets strcuture and reduce them to three clientlets * move training mothods to ConversationAuthoringProjects * move DeploymentResources operations to ConversationAuthoringDeployments * move copyproject operations to ConversationAuthoringProjects * moved GetSupportedLanguages and GetProjects to ConversationAnalysisAuthoringClient * moved GetDeployments and GetAssignedResourceDeployments, etc. to ConversationAnalysisAuthoringClient * remove suppress on GetAllDeployments, GetAssignedResourceDeployments, ets. * Move ConversationAuthoringExportedModels into ConversationAuthoringModels * remove some main client functions from clientlets, to make them generate automatically * adjust for dotnet pack * suppress three constructors with no parameters for clientlets * replace all the parameter `body` with `details` * replace parameter `body` with `details` for TrainingJobDetails * remove cache member variables * modifed the tests based on new version sdk * updated the commit id for conversations authoring * updated the readme.file * revert the changes in text authoring * update sdk to the latest commit id. * remove the generated sample tests. * updated property 'projectName' and `deploymentName` to public * use the new commit of "removing generated samples" * updated to the lastest commit id that have been merged to rest api repo * udpated the export and exportAsync protocol methods * remove projectname from convenience methods and protocol methods from Project subclient * remove `projectname` and `deploymentname` from all methods of Deployment subclient * devide the Models subclient into two and remove the inilialized paramters from methods * modified the tests based on new subclients and new clientname * modified all the tests and samples for tests using new clientlets * updated Export API * Update snippets * updated the general readMe * updated the prefix of common class and updated the related tests * udpated Export API * updated Snippets * update client and clientlets links in general readme * move swapDeployment, assignDeploymentresource and unassignDeploymentresoutce to TextAuthoringProject and modified tests * update the links in general readme * have the type for samples to replace var in all readme files * replace deploymentAuthoringClient with deploymentClient * modify the clientlet name in all readme files
1 parent d081065 commit ad50db4

File tree

299 files changed

+13782
-27876
lines changed

Some content is hidden

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

299 files changed

+13782
-27876
lines changed

sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dotnet add package Azure.AI.Language.Conversations.Authoring --prerelease
3737

3838
### Authenticate the client
3939

40-
In order to interact with the Conversations Authoring service, you'll need to create an instance of the [`AnalyzeConversationAuthoring`][conversationalAnalysisAuthoring_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].
40+
In order to interact with the Conversations Authoring service, you'll need to create an instance of the [`ConversationAnalysisAuthoringClient`][ConversationAnalysisAuthoringClient_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].
4141

4242
#### Get an API key
4343

@@ -57,18 +57,18 @@ To use the AnalyzeConversationAuthoring client, include the following namespace
5757
using Azure.AI.Language.Conversations.Authoring;
5858
```
5959

60-
With your endpoint and API key, you can instantiate an AuthoringClient and create a AnalyzeConversationAuthoring client using specific service options:
60+
With your endpoint and API key, you can instantiate a `ConversationAnalysisAuthoringClient` using specific service options:
6161

62-
```C#
62+
```C# Snippet:CreateAuthoringClientForSpecificApiVersion
6363
Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com");
64-
AzureKeyCredential credential = new("your-api-key");
65-
AuthoringClient client = new AuthoringClient(endpoint, credential);
66-
AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient();
64+
AzureKeyCredential credential = new("your apikey");
65+
ConversationAnalysisAuthoringClientOptions options = new ConversationAnalysisAuthoringClientOptions(ConversationAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview);
66+
ConversationAnalysisAuthoringClient client = new ConversationAnalysisAuthoringClient(endpoint, credential, options);
6767
```
6868

6969
#### Create a client using Azure Active Directory authentication
7070

71-
You can also create a `AnalyzeConversationAuthoring` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role.
71+
You can also create a `ConversationAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role.
7272
Using the [DefaultAzureCredential] you can authenticate a service using Managed Identity or a service principal, authenticate as a developer working on an application, and more, all without changing code.
7373

7474
Before you can use the `DefaultAzureCredential`, or any credential type from [Azure.Identity][azure_identity], you'll first need to [install the Azure.Identity package][azure_identity_install].
@@ -88,8 +88,7 @@ Then you can create an instance of `DefaultAzureCredential` and pass it to a new
8888
```C# Snippet:AnalyzeConversationAuthoring_CreateWithDefaultAzureCredential
8989
Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com");
9090
DefaultAzureCredential credential = new DefaultAzureCredential();
91-
AuthoringClient client = new AuthoringClient(endpoint, credential);
92-
AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient();
91+
ConversationAnalysisAuthoringClient client = new ConversationAnalysisAuthoringClient(endpoint, credential);
9392
```
9493

9594
Note that regional endpoints do not support AAD authentication. Instead, create a [custom domain][custom_domain] name for your resource to use AAD authentication.
@@ -107,9 +106,8 @@ For example,
107106
```C# Snippet:CreateAuthoringClientForSpecificApiVersion
108107
Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com");
109108
AzureKeyCredential credential = new("your apikey");
110-
AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview);
111-
AuthoringClient client = new AuthoringClient(endpoint, credential, options);
112-
AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient();
109+
ConversationAnalysisAuthoringClientOptions options = new ConversationAnalysisAuthoringClientOptions(ConversationAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview);
110+
ConversationAnalysisAuthoringClient client = new ConversationAnalysisAuthoringClient(endpoint, credential, options);
113111
```
114112

115113
When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility.
@@ -120,9 +118,9 @@ If you do not select an api version we will default to the latest version availa
120118

121119
## Key concepts
122120

123-
### AnalyzeConversationAuthoring
121+
### ConversationAuthoringClientlet
124122

125-
The [`AnalyzeConversationAuthoring`][AnalyzeConversationAuthoring_class] is the primary interface for developers using the Azure AI Conversation Authoring client library. It provides both synchronous and asynchronous operations to access a specific use of conversation authoring, such as creating and managing conversation projects.
123+
The [ConversationAuthoringProject][ConversationAuthoringProject_class], [ConversationAuthoringDeployment][ConversationAuthoringDeployment_class], [ConversationAuthoringExportedModel][ConversationAuthoringExportedModel_class] and [ConversationAuthoringTrainedModel][ConversationAuthoringTrainedModel_class] are the clientlets for developers using the Azure AI Conversation Authoring client library. It provides both synchronous and asynchronous operations to access a specific use of conversation authoring, such as creating and managing conversation projects.
126124

127125
### Thread safety
128126

@@ -169,6 +167,8 @@ You can familiarize yourself with different APIs using [Samples](https://github.
169167
* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md)
170168
* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md)
171169
* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md)
170+
* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample14_ConversationsAuthoring_DeployProject.md)
171+
* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample14_ConversationsAuthoring_DeployProjectAsync.md)
172172

173173
## Troubleshooting
174174

@@ -182,17 +182,16 @@ For example, if you attempt to create a project with an invalid configuration, a
182182
try
183183
{
184184
string invalidProjectName = "InvalidProject";
185-
186-
var projectData = new
185+
ConversationAuthoringProject projectClient = client.GetProject(invalidProjectName);
186+
CreateProjectDetails projectData = new CreateProjectDetails(
187+
projectKind: "Conversation",
188+
language: "invalid-lang"
189+
)
187190
{
188-
projectName = invalidProjectName,
189-
language = "invalid-lang", // Invalid language code
190-
projectKind = "Conversation",
191-
description = "This is a test for invalid configuration."
191+
Description = "This is a test for invalid configuration."
192192
};
193-
194193
using RequestContent content = RequestContent.Create(projectData);
195-
Response response = authoringClient.CreateProject(invalidProjectName, content);
194+
Response response = projectClient.CreateProject(content);
196195
}
197196
catch (RequestFailedException ex)
198197
{
@@ -270,7 +269,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
270269
[text_refdocs]: https://learn.microsoft.com/dotnet/
271270
[text_docs]: https://learn.microsoft.com/azure/ai-services/language-service/conversational-language-understanding/overview
272271
[azure_sub]: https://azure.microsoft.com/free/dotnet/
273-
[conversationalAnalysisAuthoring_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs
272+
[ConversationAnalysisAuthoringClient_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAnalysisAuthoringClient.cs
273+
[ConversationAuthoringProject_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringProject.cs
274+
[ConversationAuthoringDeployment_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringDeployment.cs
275+
[ConversationAuthoringExportedModel_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringExportedModel.cs
276+
[ConversationAuthoringTrainedModel_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringTrainedModel.cs
274277
[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/
275278
[azure_cli]: https://docs.microsoft.com/cli/azure
276279
[azure_portal]: https://portal.azure.com

0 commit comments

Comments
 (0)