Skip to content

Commit 3019474

Browse files
authored
Amber/creating sdk for Conversations authoring (Azure#46979)
* Add custom code to rename GetTrainingStatusResponse and GetCopyProjectStatusResponse * Add custom model classes to resolve naming conflicts by renaming Response suffix to Result * - generated the sdk for Authoring Conversations * Add custom code to resolve naming issues in Azure.AI.Language.Authoring.Analyzetext SDK * Generated the sdk for Authoring AnalyzeText * Initiate first version Conversations.Authoring * complete all the testing files for Conversations for the version 1. * - added all the tests and the livetest file * - add custom code for clients to add a constructor - rename some models * - added all the md files for the sample tests - run the live tests for most tests and generate recording files * - revert test-resources.json to main version - successfully record the test for import * - complete live tests for canceltraining and canceltrainingAsync * - complete all the readme files * - Removed Azure.AI.Language.Text.Authoring folder from version control * - removed "Azure.AI.Language.Authoring.Conversations" from ci.yml * fix all the Snippets * modify the Package (NuGet) in readme * update the netstandard2.0.cs file for Conversations Authoring * Add cspell.json configuration to suppress 'prebuilts' spell check error. * Remove "en-US" from a link in readme * Trigger CI pipeline * - modify the commit id in tsp-location.yaml * - change "ConversationAnalysis" to "AnalyzeConversation" - change all "Config" suffix to "Details" * Trigger CI validation * - update the sdk to the latest version of Typesepc PR * - update the latest version of sdk to spec repo * - include Newest API version 2024-11-15-preview in api version. * - removed AnalyzeConversationAuthoring under src directory * - adjust a broken link in ReadMe * - add comma after and more in Readme * -added ChangeLog.md * - fixed the changelog unreleased version * - updated changelog.md * - updated the changelog
1 parent 8eccea5 commit 3019474

File tree

290 files changed

+57902
-0
lines changed

Some content is hidden

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

290 files changed

+57902
-0
lines changed

.vscode/cspell.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,12 @@
16181618
"AOAI",
16191619
"Rerank"
16201620
]
1621+
},
1622+
{
1623+
"filename": "**/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/*.cs",
1624+
"words": [
1625+
"prebuilts"
1626+
]
16211627
}
16221628
],
16231629
"allowCompoundWords": true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34723.18
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Conversations.Authoring", "src\Azure.AI.Language.Conversations.Authoring.csproj", "{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Conversations.Authoring.Tests", "tests\Azure.AI.Language.Conversations.Authoring.Tests.csproj", "{7D7A2328-261A-42CE-88C4-46E5B3596582}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{7D7A2328-261A-42CE-88C4-46E5B3596582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{7D7A2328-261A-42CE-88C4-46E5B3596582}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{7D7A2328-261A-42CE-88C4-46E5B3596582}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{7D7A2328-261A-42CE-88C4-46E5B3596582}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
13+
## 1.0.0-beta.1
14+
15+
- Initial preview of the Azure.AI.Language.Conversations.Authoring client library.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!--
3+
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
4+
-->
5+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
6+
</Project>

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

Lines changed: 278 additions & 0 deletions
Large diffs are not rendered by default.

sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.net8.0.cs

Lines changed: 1571 additions & 0 deletions
Large diffs are not rendered by default.

sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.netstandard2.0.cs

Lines changed: 1571 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- csharp
5+
products:
6+
- azure
7+
name: Azure.AI.Language.Conversations.Authoring samples for .NET
8+
description: Samples for the Azure.AI.Language.Conversations.Authoring client library.
9+
---
10+
11+
# Azure.AI.Language.Conversations.Authoring Samples
12+
13+
Azure Conversations Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that enables creating, managing, and deploying conversational AI solutions. This client library provides the following features:
14+
15+
## Common Scenarios Samples
16+
17+
* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md)
18+
* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md)
19+
* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md)
20+
* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md)
21+
* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md)
22+
* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md)
23+
* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md)
24+
* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md)
25+
* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md)
26+
* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md)
27+
* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md)
28+
* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md)
29+
* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md)
30+
* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md)
31+
* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md)
32+
* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md)
33+
* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md)
34+
* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md)
35+
* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md)
36+
* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md)
37+
* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md)
38+
* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md)
39+
* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md)
40+
* [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)
41+
* [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)
42+
* [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)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Loading a Snapshot in Azure AI Language
2+
3+
This sample demonstrates how to load a snapshot for a trained model using the `Azure.AI.Language.Conversations.Authoring` SDK.
4+
5+
## Create an `AuthoringClient`
6+
7+
To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance.
8+
9+
```C# Snippet:CreateAuthoringClientForSpecificApiVersion
10+
Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com");
11+
AzureKeyCredential credential = new("your apikey");
12+
AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview);
13+
AuthoringClient client = new AuthoringClient(endpoint, credential, options);
14+
AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient();
15+
```
16+
17+
## Load a Snapshot
18+
19+
To load a snapshot for a specific trained model, call LoadSnapshot on the AnalyzeConversationAuthoring client.
20+
21+
```C# Snippet:Sample10_ConversationsAuthoring_LoadSnapshot
22+
Operation operation = authoringClient.LoadSnapshot(
23+
waitUntil: WaitUntil.Completed,
24+
projectName: projectName,
25+
trainedModelLabel: trainedModelLabel
26+
);
27+
28+
// Extract the operation-location header
29+
string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null;
30+
Console.WriteLine($"Operation Location: {operationLocation}");
31+
32+
Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}");
33+
```
34+
35+
To load a snapshot, call LoadSnapshot on the AnalyzeConversationAuthoring client. This method initiates the snapshot loading process and provides an operation response that includes the status and metadata about the operation.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Loading a Snapshot Asynchronously in Azure AI Language
2+
3+
This sample demonstrates how to load a snapshot for a trained model asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK.
4+
5+
## Create an `AuthoringClient`
6+
7+
To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance.
8+
9+
```C# Snippet:CreateAuthoringClientForSpecificApiVersion
10+
Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com");
11+
AzureKeyCredential credential = new("your apikey");
12+
AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview);
13+
AuthoringClient client = new AuthoringClient(endpoint, credential, options);
14+
AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient();
15+
```
16+
17+
## Load a Snapshot Asynchronously
18+
19+
To load a snapshot for a specific trained model, call LoadSnapshotAsync on the AnalyzeConversationAuthoring client.
20+
21+
```C# Snippet:Sample10_ConversationsAuthoring_LoadSnapshotAsync
22+
Operation operation = await authoringClient.LoadSnapshotAsync(
23+
waitUntil: WaitUntil.Completed,
24+
projectName: projectName,
25+
trainedModelLabel: trainedModelLabel
26+
);
27+
28+
// Extract the operation-location header
29+
string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null;
30+
Console.WriteLine($"Operation Location: {operationLocation}");
31+
32+
Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}");
33+
```
34+
35+
To load a snapshot asynchronously, call LoadSnapshotAsync on the AnalyzeConversationAuthoring client. This method initiates the snapshot loading process and provides an operation response that includes the status and metadata about the operation.

0 commit comments

Comments
 (0)