Skip to content

Commit 5df1bba

Browse files
authored
Amber/creating sdk for text authoring (Azure#47313)
* - initialize the first version of Text Authoring sdk. * - added custom code * - complete most of the sample tests * - complete test samples for text authoring * - complete all the samples md - complete live tests * - delete helloword md * - add tests record for some functions * - completed all the recorded tests * - complete the readme for text authoring * Remove Azure.AI.Language.Conversations.Authoring folder from the repository * - modify the snippets to pass validation. * - run Export-API.ps1 and fix the cspell.json * change all the "Config" suffix to "Details" * Trigger CI validation * - update the PR to the latest version of Typespec * - updated the sdk pr to the latest version of spec repo * - add 2024-11-15-preview in readme as the newest version * - adjusted textAnalysisAuthoring_class in Readme * - update changelog * update the snippets to avoid conflicts * - update the sdk * - updated the ConversationsAuthoringModelFactory
1 parent 4763c6f commit 5df1bba

File tree

332 files changed

+72166
-155
lines changed

Some content is hidden

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

332 files changed

+72166
-155
lines changed

.vscode/cspell.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,12 @@
16191619
"Rerank"
16201620
]
16211621
},
1622+
{
1623+
"filename": "**/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/*.cs",
1624+
"words": [
1625+
"prebuilts"
1626+
]
1627+
},
16221628
{
16231629
"filename": "**/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/*.cs",
16241630
"words": [

sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs

Lines changed: 155 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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.Text.Authoring", "src\Azure.AI.Language.Text.Authoring.csproj", "{DFF66C7A-EED6-4AD9-AABB-F65049394E85}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Text.Authoring.Tests", "tests\Azure.AI.Language.Text.Authoring.Tests.csproj", "{7972BA84-D0F6-4602-8D9D-7C2427B53E30}"
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+
{DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{7972BA84-D0F6-4602-8D9D-7C2427B53E30}.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.Text.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.Text.Authoring/README.md

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

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

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

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

Lines changed: 1894 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- csharp
5+
products:
6+
# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product
7+
- azure
8+
name: Azure.AI.Language.Text.Authoring samples for .NET
9+
description: Samples for the Azure.AI.Language.Text.Authoring client library.
10+
---
11+
12+
# Azure.AI.Language.Text.Authoring Samples
13+
14+
Azure Text Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that enables creating, managing, and deploying text analysis solutions. This client library provides the following features:
15+
16+
## Common Scenarios Samples
17+
18+
* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md)
19+
* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md)
20+
* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md)
21+
* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md)
22+
* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md)
23+
* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md)
24+
* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md)
25+
* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md)
26+
* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md)
27+
* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md)
28+
* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md)
29+
* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md)
30+
* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md)
31+
* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md)
32+
* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md)
33+
* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md)
34+
* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md)
35+
* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md)
36+
* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md)
37+
* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md)
38+
* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md)
39+
* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md)
40+
* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md)
41+
* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Deploying a Project Synchronously in Azure AI Language
2+
3+
This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.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:CreateTextAuthoringClientForSpecificApiVersion
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+
TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient();
15+
```
16+
17+
## Deploy a Project Synchronously
18+
19+
To deploy a project, call DeployProject on the TextAnalysisAuthoring client.
20+
21+
```C# Snippet:Sample10_TextAuthoring_DeployProject
22+
string projectName = "LoanAgreements";
23+
string deploymentName = "DeploymentName";
24+
var deploymentDetails = new CreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66");
25+
26+
Operation operation = authoringClient.DeployProject(
27+
waitUntil: WaitUntil.Completed,
28+
projectName: projectName,
29+
deploymentName: deploymentName,
30+
body: deploymentDetails
31+
);
32+
33+
Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}");
34+
```
35+
36+
To deploy a project, the DeployProject method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status.

0 commit comments

Comments
 (0)