From f048838e8b0ac82abf5d9bb7ef27a8f063272578 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Tue, 3 Jun 2025 14:21:39 -0700 Subject: [PATCH 01/47] initiate first version of Text Authoring 20250515-preview --- .../Generated/DataGenerationConnectionInfo.cs | 4 +-- .../DataGenerationConnectionInfoKind.cs | 4 +-- .../TextAnalysisAuthoringClientOptions.cs | 5 ++- .../TextAnalysisAuthoringModelFactory.cs | 35 ++++++++----------- ...ngCreateDeploymentDetails.Serialization.cs | 20 +++++------ .../TextAuthoringCreateDeploymentDetails.cs | 12 +++---- ...thoringDeploymentResource.Serialization.cs | 17 ++++++++- .../TextAuthoringDeploymentResource.cs | 12 ++++--- ...tAuthoringProjectMetadata.Serialization.cs | 12 +++++++ .../Generated/TextAuthoringProjectMetadata.cs | 6 +++- .../tsp-location.yaml | 2 +- 11 files changed, 80 insertions(+), 49 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs index 982dca9f073b..ca43d1cc4e77 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs @@ -80,8 +80,8 @@ internal DataGenerationConnectionInfo() public DataGenerationConnectionInfoKind Kind { get; } = DataGenerationConnectionInfoKind.AzureOpenAI; /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". - public string ResourceId { get; } + public string ResourceId { get; set; } /// Deployment name of model to be used for synthetic data generation. - public string DeploymentName { get; } + public string DeploymentName { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfoKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfoKind.cs index 4a3f838b1704..63e484d622fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfoKind.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfoKind.cs @@ -22,9 +22,9 @@ public DataGenerationConnectionInfoKind(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string AzureOpenAIValue = "azureOpenAI"; + private const string AzureOpenAIValue = "AzureOpenAI"; - /// azureOpenAI. + /// AzureOpenAI. public static DataGenerationConnectionInfoKind AzureOpenAI { get; } = new DataGenerationConnectionInfoKind(AzureOpenAIValue); /// Determines if two values are the same. public static bool operator ==(DataGenerationConnectionInfoKind left, DataGenerationConnectionInfoKind right) => left.Equals(right); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringClientOptions.cs index fb799cc225cc..90bcac9b94a6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringClientOptions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringClientOptions.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Language.Text.Authoring /// Client options for TextAnalysisAuthoringClient. public partial class TextAnalysisAuthoringClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_15_Preview; /// The version of the service to use. public enum ServiceVersion @@ -24,6 +24,8 @@ public enum ServiceVersion V2023_04_15_Preview = 2, /// Service version "2024-11-15-preview". V2024_11_15_Preview = 3, + /// Service version "2025-05-15-preview". + V2025_05_15_Preview = 4, } internal string Version { get; } @@ -36,6 +38,7 @@ public TextAnalysisAuthoringClientOptions(ServiceVersion version = LatestVersion ServiceVersion.V2023_04_01 => "2023-04-01", ServiceVersion.V2023_04_15_Preview => "2023-04-15-preview", ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview", + ServiceVersion.V2025_05_15_Preview => "2025-05-15-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs index 1d2dbe9c35dd..1a969407f77e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs @@ -21,6 +21,7 @@ public static partial class TextAnalysisAuthoringModelFactory /// Represents the project last training datetime. /// Represents the project last deployment datetime. /// The project kind. + /// The project storage account resource ID. /// The storage container name. /// The project settings. /// The new project name. @@ -28,7 +29,7 @@ public static partial class TextAnalysisAuthoringModelFactory /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// A new instance for mocking. - public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, TextAuthoringProjectKind projectKind = default, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, TextAuthoringProjectKind projectKind = default, string storageAccountResourceId = null, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) { return new TextAuthoringProjectMetadata( createdOn, @@ -36,6 +37,7 @@ public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTime lastTrainedOn, lastDeployedOn, projectKind, + storageAccountResourceId, storageInputContainerName, settings, projectName, @@ -69,13 +71,14 @@ public static TextAuthoringProjectDeployment TextAuthoringProjectDeployment(stri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the Azure resource Id. - /// Represents the resource region. - /// A new instance for mocking. - public static TextAuthoringDeploymentResource TextAuthoringDeploymentResource(string resourceId = null, string region = null) + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// A new instance for mocking. + public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) { - return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData: null); + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -395,16 +398,6 @@ public static TextAuthoringTrainingJobDetails TextAuthoringTrainingJobDetails(st return new TextAuthoringTrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Connection type for data generation settings. Currently only supports Azure Open AI. - /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". - /// Deployment name of model to be used for synthetic data generation. - /// A new instance for mocking. - public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) - { - return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The job ID. /// The creation date time of the job. @@ -532,13 +525,13 @@ public static TextAuthoringDeploymentDeleteFromResourcesState TextAuthoringDeplo /// Initializes a new instance of . /// Represents the trained model label. - /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. /// A new instance for mocking. - public static TextAuthoringCreateDeploymentDetails TextAuthoringCreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + public static TextAuthoringCreateDeploymentDetails TextAuthoringCreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResources = null) { - assignedResourceIds ??= new List(); + assignedResources ??= new List(); - return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResources?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs index f48205a761fa..462a57136e16 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs @@ -36,13 +36,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("trainedModelLabel"u8); writer.WriteStringValue(TrainedModelLabel); - if (Optional.IsCollectionDefined(AssignedResourceIds)) + if (Optional.IsCollectionDefined(AssignedResources)) { - writer.WritePropertyName("assignedResourceIds"u8); + writer.WritePropertyName("assignedResources"u8); writer.WriteStartArray(); - foreach (var item in AssignedResourceIds) + foreach (var item in AssignedResources) { - writer.WriteStringValue(item); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } @@ -84,7 +84,7 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre return null; } string trainedModelLabel = default; - IList assignedResourceIds = default; + IList assignedResources = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,18 +94,18 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre trainedModelLabel = property.Value.GetString(); continue; } - if (property.NameEquals("assignedResourceIds"u8)) + if (property.NameEquals("assignedResources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(TextAuthoringDeploymentResource.DeserializeTextAuthoringDeploymentResource(item, options)); } - assignedResourceIds = array; + assignedResources = array; continue; } if (options.Format != "W") @@ -114,7 +114,7 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre } } serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResources ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs index f41ba590c089..bfef247637e1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs @@ -53,17 +53,17 @@ public TextAuthoringCreateDeploymentDetails(string trainedModelLabel) Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); TrainedModelLabel = trainedModelLabel; - AssignedResourceIds = new ChangeTrackingList(); + AssignedResources = new ChangeTrackingList(); } /// Initializes a new instance of . /// Represents the trained model label. - /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. /// Keeps track of any properties unknown to the library. - internal TextAuthoringCreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + internal TextAuthoringCreateDeploymentDetails(string trainedModelLabel, IList assignedResources, IDictionary serializedAdditionalRawData) { TrainedModelLabel = trainedModelLabel; - AssignedResourceIds = assignedResourceIds; + AssignedResources = assignedResources; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,7 +74,7 @@ internal TextAuthoringCreateDeploymentDetails() /// Represents the trained model label. public string TrainedModelLabel { get; } - /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. - public IList AssignedResourceIds { get; } + /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + public IList AssignedResources { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs index 9b027fe33e14..5972c09d3675 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs @@ -38,6 +38,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(ResourceId); writer.WritePropertyName("region"u8); writer.WriteStringValue(Region); + if (Optional.IsDefined(AssignedAoaiResource)) + { + writer.WritePropertyName("assignedAoaiResource"u8); + writer.WriteObjectValue(AssignedAoaiResource, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +82,7 @@ internal static TextAuthoringDeploymentResource DeserializeTextAuthoringDeployme } string resourceId = default; string region = default; + DataGenerationConnectionInfo assignedAoaiResource = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,13 +97,22 @@ internal static TextAuthoringDeploymentResource DeserializeTextAuthoringDeployme region = property.Value.GetString(); continue; } + if (property.NameEquals("assignedAoaiResource"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignedAoaiResource = DataGenerationConnectionInfo.DeserializeDataGenerationConnectionInfo(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData); + return new TextAuthoringDeploymentResource(resourceId, region, assignedAoaiResource, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs index 79a30f7eeb5d..5b20610cfe03 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs @@ -49,7 +49,7 @@ public partial class TextAuthoringDeploymentResource /// Represents the Azure resource Id. /// Represents the resource region. /// or is null. - internal TextAuthoringDeploymentResource(string resourceId, string region) + public TextAuthoringDeploymentResource(string resourceId, string region) { Argument.AssertNotNull(resourceId, nameof(resourceId)); Argument.AssertNotNull(region, nameof(region)); @@ -61,11 +61,13 @@ internal TextAuthoringDeploymentResource(string resourceId, string region) /// Initializes a new instance of . /// Represents the Azure resource Id. /// Represents the resource region. + /// Represents the AOAI resource assigned for data generation. /// Keeps track of any properties unknown to the library. - internal TextAuthoringDeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentResource(string resourceId, string region, DataGenerationConnectionInfo assignedAoaiResource, IDictionary serializedAdditionalRawData) { ResourceId = resourceId; Region = region; + AssignedAoaiResource = assignedAoaiResource; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -75,8 +77,10 @@ internal TextAuthoringDeploymentResource() } /// Represents the Azure resource Id. - public string ResourceId { get; } + public string ResourceId { get; set; } /// Represents the resource region. - public string Region { get; } + public string Region { get; set; } + /// Represents the AOAI resource assigned for data generation. + public DataGenerationConnectionInfo AssignedAoaiResource { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs index 60bb22c2ac74..da155e303c4b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs @@ -50,6 +50,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("projectKind"u8); writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(StorageAccountResourceId)) + { + writer.WritePropertyName("storageAccountResourceId"u8); + writer.WriteStringValue(StorageAccountResourceId); + } writer.WritePropertyName("storageInputContainerName"u8); writer.WriteStringValue(StorageInputContainerName); if (Optional.IsDefined(Settings)) @@ -116,6 +121,7 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta DateTimeOffset? lastTrainedDateTime = default; DateTimeOffset? lastDeployedDateTime = default; TextAuthoringProjectKind projectKind = default; + string storageAccountResourceId = default; string storageInputContainerName = default; TextAuthoringProjectSettings settings = default; string projectName = default; @@ -159,6 +165,11 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } + if (property.NameEquals("storageAccountResourceId"u8)) + { + storageAccountResourceId = property.Value.GetString(); + continue; + } if (property.NameEquals("storageInputContainerName"u8)) { storageInputContainerName = property.Value.GetString(); @@ -209,6 +220,7 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta lastTrainedDateTime, lastDeployedDateTime, projectKind, + storageAccountResourceId, storageInputContainerName, settings, projectName, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs index d0a834ac796d..7db7ab9464ba 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs @@ -70,6 +70,7 @@ internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset l /// Represents the project last training datetime. /// Represents the project last deployment datetime. /// The project kind. + /// The project storage account resource ID. /// The storage container name. /// The project settings. /// The new project name. @@ -77,13 +78,14 @@ internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset l /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, TextAuthoringProjectKind projectKind, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, TextAuthoringProjectKind projectKind, string storageAccountResourceId, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { CreatedOn = createdOn; LastModifiedOn = lastModifiedOn; LastTrainedOn = lastTrainedOn; LastDeployedOn = lastDeployedOn; ProjectKind = projectKind; + StorageAccountResourceId = storageAccountResourceId; StorageInputContainerName = storageInputContainerName; Settings = settings; ProjectName = projectName; @@ -108,6 +110,8 @@ internal TextAuthoringProjectMetadata() public DateTimeOffset? LastDeployedOn { get; } /// The project kind. public TextAuthoringProjectKind ProjectKind { get; } + /// The project storage account resource ID. + public string StorageAccountResourceId { get; } /// The storage container name. public string StorageInputContainerName { get; } /// The project settings. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index fe470560ef5b..9f62c07bf743 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +commit: 63d4b007f5d9462253cd166feb5ba210bcad4ab7 repo: Azure/azure-rest-api-specs From 2707e287f9f5ee11e1e2550f272b3c1ee17a8985 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Wed, 4 Jun 2025 12:18:57 -0700 Subject: [PATCH 02/47] adding tests for text authoring --- .../Infrastructure/TextAuthoringTestBase.cs | 3 +- .../CreateProjectAsync.json | 31 ++++--- .../CreateProjectAsyncAsync.json | 31 ++++--- .../GetProjectAsync.json | 35 ++++---- .../GetProjectAsyncAsync.json | 34 ++++---- .../ImportAsync.json | 63 +++++++-------- .../ImportAsyncAsync.json | 62 +++++++------- .../tests/TextAuthoringClientLiveTest.cs | 81 ++++++++++++++++++- 8 files changed, 206 insertions(+), 134 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs index f132c7262d2b..177cfcba7fa5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs @@ -13,7 +13,8 @@ namespace Azure.AI.Language.Text.Authoring.Tests [ClientTestFixture( TextAnalysisAuthoringClientOptions.ServiceVersion.V2023_04_01, TextAnalysisAuthoringClientOptions.ServiceVersion.V2023_04_15_Preview, - TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview + TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview, + TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview )] [IgnoreServiceError(429, "429")] public abstract class TextAuthoringTestBase : RecordedTestBase diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json index bd31b61e438b..ad9ed0ea7de2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json @@ -1,21 +1,20 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2025-05-15-preview", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", - "Content-Length": "237", + "Content-Length": "243", "Content-Type": "application/merge-patch+json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, "RequestBody": { "projectKind": "customMultiLabelClassification", - "storageInputContainerName": "e2e0test0data", + "storageInputContainerName": "multi-class-example", "projectName": "MyTextProject001", "multilingual": true, "description": "Project description for a Custom Entity Recognition project", @@ -24,22 +23,22 @@ "StatusCode": 201, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "f5131492-8a2e-4f6f-8395-71e4f2bfe34d", - "Content-Length": "324", + "apim-request-id": "b1e024f4-535a-440b-898c-c87525964b94", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:45:31 GMT", - "Location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/MyTextProject001", - "request-id": "f5131492-8a2e-4f6f-8395-71e4f2bfe34d", + "Date": "Tue, 03 Jun 2025 21:38:48 GMT", + "Location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/MyTextProject001", + "request-id": "b1e024f4-535a-440b-898c-c87525964b94", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "314", + "x-envoy-upstream-service-time": "116", "x-ms-region": "East US" }, "ResponseBody": { - "createdDateTime": "2025-03-03T06:45:31Z", - "lastModifiedDateTime": "2025-03-03T06:45:31Z", + "createdDateTime": "2025-06-03T21:38:49Z", + "lastModifiedDateTime": "2025-06-03T21:38:49Z", "projectKind": "CustomMultiLabelClassification", - "storageInputContainerName": "e2e0test0data", + "storageInputContainerName": "multi-class-example", "projectName": "MyTextProject001", "multilingual": true, "description": "Project description for a Custom Entity Recognition project", @@ -48,8 +47,8 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1027509638" + "RandomSeed": "1167536829" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json index bd31b61e438b..452e43950e87 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json @@ -1,21 +1,20 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2025-05-15-preview", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", - "Content-Length": "237", + "Content-Length": "243", "Content-Type": "application/merge-patch+json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, "RequestBody": { "projectKind": "customMultiLabelClassification", - "storageInputContainerName": "e2e0test0data", + "storageInputContainerName": "multi-class-example", "projectName": "MyTextProject001", "multilingual": true, "description": "Project description for a Custom Entity Recognition project", @@ -24,22 +23,22 @@ "StatusCode": 201, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "f5131492-8a2e-4f6f-8395-71e4f2bfe34d", - "Content-Length": "324", + "apim-request-id": "487ddf57-7d39-4f13-8f16-4a81fc433321", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:45:31 GMT", - "Location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/MyTextProject001", - "request-id": "f5131492-8a2e-4f6f-8395-71e4f2bfe34d", + "Date": "Tue, 03 Jun 2025 21:43:08 GMT", + "Location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/MyTextProject001", + "request-id": "487ddf57-7d39-4f13-8f16-4a81fc433321", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "314", + "x-envoy-upstream-service-time": "434", "x-ms-region": "East US" }, "ResponseBody": { - "createdDateTime": "2025-03-03T06:45:31Z", - "lastModifiedDateTime": "2025-03-03T06:45:31Z", + "createdDateTime": "2025-06-03T21:43:08Z", + "lastModifiedDateTime": "2025-06-03T21:43:08Z", "projectKind": "CustomMultiLabelClassification", - "storageInputContainerName": "e2e0test0data", + "storageInputContainerName": "multi-class-example", "projectName": "MyTextProject001", "multilingual": true, "description": "Project description for a Custom Entity Recognition project", @@ -48,8 +47,8 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1027509638" + "RandomSeed": "178710853" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json index 621d1f52670f..2c2f4076b67b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json @@ -1,13 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -15,31 +14,31 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "2c24f921-c491-4c1a-9865-1641c35a50ad", - "Content-Length": "272", + "apim-request-id": "2b0d7adc-1abf-4aeb-8d37-1a8c8de937af", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:42:49 GMT", - "request-id": "2c24f921-c491-4c1a-9865-1641c35a50ad", + "Date": "Wed, 04 Jun 2025 04:24:46 GMT", + "request-id": "2b0d7adc-1abf-4aeb-8d37-1a8c8de937af", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "25", + "x-envoy-upstream-service-time": "175", "x-ms-region": "East US" }, "ResponseBody": { - "createdDateTime": "2024-12-02T03:53:58Z", - "lastModifiedDateTime": "2025-01-08T19:16:18Z", - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "test-data", - "projectName": "MyTextProject", - "multilingual": false, - "description": "test test", - "language": "en-us" + "createdDateTime": "2025-06-03T21:43:08Z", + "lastModifiedDateTime": "2025-06-03T21:43:08Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "multi-class-example", + "projectName": "MyTextProject001", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "357403586" + "RandomSeed": "1078932068" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json index 176367e2a186..841c4dd9a414 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json @@ -1,12 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -14,31 +14,31 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "33b1dd4d-7ae7-4c40-a899-6acfeedfc80f", - "Content-Length": "272", + "apim-request-id": "1165746d-944c-42f5-b7b5-fd0cd2429d42", + "Content-Length": "330", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:42:49 GMT", - "request-id": "33b1dd4d-7ae7-4c40-a899-6acfeedfc80f", + "Date": "Wed, 04 Jun 2025 04:24:47 GMT", + "request-id": "1165746d-944c-42f5-b7b5-fd0cd2429d42", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "22", + "x-envoy-upstream-service-time": "43", "x-ms-region": "East US" }, "ResponseBody": { - "createdDateTime": "2024-12-02T03:53:58Z", - "lastModifiedDateTime": "2025-01-08T19:16:18Z", - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "test-data", - "projectName": "MyTextProject", - "multilingual": false, - "description": "test test", - "language": "en-us" + "createdDateTime": "2025-06-03T21:43:08Z", + "lastModifiedDateTime": "2025-06-03T21:43:08Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "multi-class-example", + "projectName": "MyTextProject001", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1045965502" + "RandomSeed": "1153998276" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json index ce22bdcb59b2..99892174a11c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json @@ -1,15 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", - "Content-Length": "774", + "Content-Length": "785", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -18,7 +17,7 @@ "stringIndexType": "Utf16CodeUnit", "metadata": { "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "test-data", + "storageInputContainerName": "single-class-example", "settings": {}, "projectName": null, "multilingual": false, @@ -59,24 +58,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "3923a4db-f5ff-4e53-bb51-1857c0d7d030", + "apim-request-id": "11e81652-0c1a-4d6d-bd17-0f7971a3a29d", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:43:44 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f2ab8f15-9a54-4961-83a1-d5c63126e875_638765568000000000?api-version=2024-11-15-preview", - "request-id": "3923a4db-f5ff-4e53-bb51-1857c0d7d030", + "Date": "Tue, 03 Jun 2025 21:46:37 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", + "request-id": "11e81652-0c1a-4d6d-bd17-0f7971a3a29d", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "144", + "x-envoy-upstream-service-time": "275", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f2ab8f15-9a54-4961-83a1-d5c63126e875_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -84,30 +83,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "63a8b337-586f-4100-81ba-3284869a8733", + "apim-request-id": "b4ee2040-896c-4a79-82d4-28cab870c1a4", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:43:45 GMT", - "request-id": "63a8b337-586f-4100-81ba-3284869a8733", + "Date": "Tue, 03 Jun 2025 21:46:38 GMT", + "request-id": "b4ee2040-896c-4a79-82d4-28cab870c1a4", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "28", + "x-envoy-upstream-service-time": "42", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f2ab8f15-9a54-4961-83a1-d5c63126e875_638765568000000000", - "createdDateTime": "2025-03-03T06:43:45Z", - "lastUpdatedDateTime": "2025-03-03T06:43:45Z", - "expirationDateTime": "2025-03-10T06:43:45Z", + "jobId": "2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000", + "createdDateTime": "2025-06-03T21:46:38Z", + "lastUpdatedDateTime": "2025-06-03T21:46:38Z", + "expirationDateTime": "2025-06-10T21:46:38Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f2ab8f15-9a54-4961-83a1-d5c63126e875_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -115,28 +114,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "a715a394-9a0f-4fad-b5c0-d8019f10d25e", + "apim-request-id": "ff2ab8f8-da2a-4f20-a5a7-15e69ebc1951", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:43:46 GMT", - "request-id": "a715a394-9a0f-4fad-b5c0-d8019f10d25e", + "Date": "Tue, 03 Jun 2025 21:46:39 GMT", + "request-id": "ff2ab8f8-da2a-4f20-a5a7-15e69ebc1951", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "25", + "x-envoy-upstream-service-time": "39", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f2ab8f15-9a54-4961-83a1-d5c63126e875_638765568000000000", - "createdDateTime": "2025-03-03T06:43:45Z", - "lastUpdatedDateTime": "2025-03-03T06:43:46Z", - "expirationDateTime": "2025-03-10T06:43:45Z", + "jobId": "2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000", + "createdDateTime": "2025-06-03T21:46:38Z", + "lastUpdatedDateTime": "2025-06-03T21:46:38Z", + "expirationDateTime": "2025-06-10T21:46:38Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "804003028" + "RandomSeed": "188152870" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json index e77f388b6809..e2f414538cc8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json @@ -1,14 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "774", + "Content-Length": "785", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -17,7 +17,7 @@ "stringIndexType": "Utf16CodeUnit", "metadata": { "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "test-data", + "storageInputContainerName": "single-class-example", "settings": {}, "projectName": null, "multilingual": false, @@ -58,24 +58,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "fd0b8426-524d-45cc-a507-87036d300d48", + "apim-request-id": "c38a5fb6-13b0-431a-834b-37a9c472ba83", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:43:46 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f278878a-97ab-4b1e-af8f-83a5f3b465be_638765568000000000?api-version=2024-11-15-preview", - "request-id": "fd0b8426-524d-45cc-a507-87036d300d48", + "Date": "Tue, 03 Jun 2025 21:46:39 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", + "request-id": "c38a5fb6-13b0-431a-834b-37a9c472ba83", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "122", + "x-envoy-upstream-service-time": "250", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f278878a-97ab-4b1e-af8f-83a5f3b465be_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -83,30 +83,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "9e097021-2bb1-49ba-916a-635a7afab2e5", + "apim-request-id": "07f0cbdf-4833-44db-8d17-7cde665fb3ef", "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:43:46 GMT", - "request-id": "9e097021-2bb1-49ba-916a-635a7afab2e5", + "Date": "Tue, 03 Jun 2025 21:46:39 GMT", + "request-id": "07f0cbdf-4833-44db-8d17-7cde665fb3ef", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "28", + "x-envoy-upstream-service-time": "29", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f278878a-97ab-4b1e-af8f-83a5f3b465be_638765568000000000", - "createdDateTime": "2025-03-03T06:43:47Z", - "lastUpdatedDateTime": "2025-03-03T06:43:47Z", - "expirationDateTime": "2025-03-10T06:43:47Z", + "jobId": "13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000", + "createdDateTime": "2025-06-03T21:46:39Z", + "lastUpdatedDateTime": "2025-06-03T21:46:39Z", + "expirationDateTime": "2025-06-10T21:46:39Z", "status": "notStarted" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/f278878a-97ab-4b1e-af8f-83a5f3b465be_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -114,28 +114,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "03193667-b992-4932-97e5-1cb1bd636c5a", + "apim-request-id": "cfce9788-6f9f-411f-9874-ce84edd0df6c", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:43:47 GMT", - "request-id": "03193667-b992-4932-97e5-1cb1bd636c5a", + "Date": "Tue, 03 Jun 2025 21:46:40 GMT", + "request-id": "cfce9788-6f9f-411f-9874-ce84edd0df6c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "25", + "x-envoy-upstream-service-time": "30", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f278878a-97ab-4b1e-af8f-83a5f3b465be_638765568000000000", - "createdDateTime": "2025-03-03T06:43:47Z", - "lastUpdatedDateTime": "2025-03-03T06:43:47Z", - "expirationDateTime": "2025-03-10T06:43:47Z", + "jobId": "13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000", + "createdDateTime": "2025-06-03T21:46:39Z", + "lastUpdatedDateTime": "2025-06-03T21:46:40Z", + "expirationDateTime": "2025-06-10T21:46:39Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1021873558" + "RandomSeed": "1980914448" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 525b589bb98c..1061140d44de 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -27,7 +27,7 @@ public TextAuthoringClientLiveTest(bool isAsync, TextAnalysisAuthoringClientOpti public async Task GetProjectAsync() { // Arrange - string projectName = "MyTextProject"; + string projectName = "MyTextProject001"; TextAuthoringProject projectClient = client.GetProject(projectName); // Act Response response = await projectClient.GetProjectAsync(); @@ -39,12 +39,16 @@ public async Task GetProjectAsync() Assert.IsNotNull(projectMetadata.Language); Assert.IsNotNull(projectMetadata.CreatedOn); Assert.IsNotNull(projectMetadata.LastModifiedOn); + Assert.IsNotNull(projectMetadata.StorageInputContainerName); + //Assert.IsNotNull(projectMetadata.StorageAccountResourceId); Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); Console.WriteLine($"Language: {projectMetadata.Language}"); Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}"); Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); Console.WriteLine($"Description: {projectMetadata.Description}"); + Console.WriteLine($"StorageInputContainerName: {projectMetadata.StorageInputContainerName}"); + Console.WriteLine($"StorageAccountResourceId: {projectMetadata.StorageAccountResourceId}"); } [RecordedTest] @@ -55,7 +59,7 @@ public async Task ImportAsync() var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", - storageInputContainerName: "test-data", + storageInputContainerName: "single-class-example", language: "en" ) { @@ -121,7 +125,7 @@ public async Task CreateProjectAsync() string projectName = "MyTextProject001"; var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", - storageInputContainerName: "e2e0test0data", + storageInputContainerName: "multi-class-example", language: "en" ) { @@ -366,6 +370,77 @@ public async Task DeployProjectAsync() Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); } + [RecordedTest] + public async Task DeployProjectAsync_WithAssignedResources_ShouldReturnAcceptedStatus() + { + // Arrange + string projectName = "single-class-project"; + string deploymentName = "deploymentWithAssignedResource"; + + var requestBody = new + { + trainedModelLabel = "model1", + assignedResources = new[] + { + new + { + resourceId = "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-01", + region = "eastus", + assignedAoaiResource = new + { + kind = "AzureOpenAI", + resourceId = "/subscriptions/e54a2925-af7f-4b05-9ba1-2155c5fe8a8e/resourceGroups/gouri-eastus/providers/Microsoft.CognitiveServices/accounts/sdk-test-openai", + deploymentName = "gpt-4o" + } + } + } + }; + + string json = JsonSerializer.Serialize(requestBody); + Console.WriteLine(json); + var requestContent = RequestContent.Create(BinaryData.FromString(json)); + + // Use the REST client directly (or if the SDK has an overload for raw JSON): + var response = await client.GetDeployment(projectName, deploymentName) + .DeployProjectAsync(WaitUntil.Completed, requestContent); + + Console.WriteLine($"Response status: {response.GetRawResponse().Status}"); + //var deploymentDetails = new TextAuthoringCreateDeploymentDetails( + // trainedModelLabel: "model1"); + + ////Directly add to the AssignedResources collection + //deploymentDetails.AssignedResources.Add(new TextAuthoringDeploymentResource( + // resourceId: "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-01", + // region: "eastus") + //{ + // AssignedAoaiResource = new DataGenerationConnectionInfo( + // resourceId: "/subscriptions/e54a2925-af7f-4b05-9ba1-2155c5fe8a8e/resourceGroups/gouri-eastus/providers/Microsoft.CognitiveServices/accounts/sdk-test-openai", + // deploymentName: "gpt-4o") + //}); + + //string jsonPayload = JsonSerializer.Serialize(deploymentDetails, new JsonSerializerOptions { WriteIndented = true }); + //Console.WriteLine(jsonPayload); + + //var deploymentClient = client.GetDeployment(projectName, deploymentName); + + //// Act + //Operation operation = await deploymentClient.DeployProjectAsync( + // waitUntil: WaitUntil.Completed, + // details: deploymentDetails + //); + + //// Assert + //Assert.IsNotNull(operation); + //Assert.AreEqual(202, operation.GetRawResponse().Status, "Expected 202 Accepted status code for deployment initiation."); + + //string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out string location) + // ? location + // : null; + + //Assert.IsNotNull(operationLocation, "operation-location header is missing."); + //Console.WriteLine($"Deployment initiated. Operation-Location: {operationLocation}"); + } + [RecordedTest] public async Task SwapDeploymentsAsync() { From 44f8f260b8a4471201ec9ced039ace3ed7746342 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Thu, 26 Jun 2025 12:44:32 -0700 Subject: [PATCH 03/47] created the sdk that remove extra properties --- .../Generated/DataGenerationConnectionInfo.cs | 4 +- .../TextAnalysisAuthoringModelFactory.cs | 62 ++--- ...ngCreateDeploymentDetails.Serialization.cs | 20 +- .../TextAuthoringCreateDeploymentDetails.cs | 12 +- ...thoringDeploymentResource.Serialization.cs | 17 +- .../TextAuthoringDeploymentResource.cs | 12 +- ...DeploymentResourcesState.Serialization.cs} | 42 +-- ... TextAuthoringDeploymentResourcesState.cs} | 16 +- ...tAuthoringProjectMetadata.Serialization.cs | 12 - .../Generated/TextAuthoringProjectMetadata.cs | 6 +- ...nDeploymentResourcesState.Serialization.cs | 242 ------------------ ...thoringUnassignDeploymentResourcesState.cs | 102 -------- .../tsp-location.yaml | 2 +- 13 files changed, 76 insertions(+), 473 deletions(-) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/{TextAuthoringAssignDeploymentResourcesState.Serialization.cs => TextAuthoringDeploymentResourcesState.Serialization.cs} (77%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/{TextAuthoringAssignDeploymentResourcesState.cs => TextAuthoringDeploymentResourcesState.cs} (82%) delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.Serialization.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs index ca43d1cc4e77..982dca9f073b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/DataGenerationConnectionInfo.cs @@ -80,8 +80,8 @@ internal DataGenerationConnectionInfo() public DataGenerationConnectionInfoKind Kind { get; } = DataGenerationConnectionInfoKind.AzureOpenAI; /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". - public string ResourceId { get; set; } + public string ResourceId { get; } /// Deployment name of model to be used for synthetic data generation. - public string DeploymentName { get; set; } + public string DeploymentName { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs index 1a969407f77e..3706136a2e0c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoringModelFactory.cs @@ -21,7 +21,6 @@ public static partial class TextAnalysisAuthoringModelFactory /// Represents the project last training datetime. /// Represents the project last deployment datetime. /// The project kind. - /// The project storage account resource ID. /// The storage container name. /// The project settings. /// The new project name. @@ -29,7 +28,7 @@ public static partial class TextAnalysisAuthoringModelFactory /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// A new instance for mocking. - public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, TextAuthoringProjectKind projectKind = default, string storageAccountResourceId = null, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, TextAuthoringProjectKind projectKind = default, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) { return new TextAuthoringProjectMetadata( createdOn, @@ -37,7 +36,6 @@ public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTime lastTrainedOn, lastDeployedOn, projectKind, - storageAccountResourceId, storageInputContainerName, settings, projectName, @@ -71,14 +69,13 @@ public static TextAuthoringProjectDeployment TextAuthoringProjectDeployment(stri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Connection type for data generation settings. Currently only supports Azure Open AI. - /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". - /// Deployment name of model to be used for synthetic data generation. - /// A new instance for mocking. - public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static TextAuthoringDeploymentResource TextAuthoringDeploymentResource(string resourceId = null, string region = null) { - return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); + return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -398,32 +395,17 @@ public static TextAuthoringTrainingJobDetails TextAuthoringTrainingJobDetails(st return new TextAuthoringTrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static TextAuthoringUnassignDeploymentResourcesState TextAuthoringUnassignDeploymentResourcesState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// A new instance for mocking. + public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) { - warnings ??= new List(); - errors ??= new List(); - - return new TextAuthoringUnassignDeploymentResourcesState( - jobId, - createdOn, - lastUpdatedOn, - expiresOn, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. /// The creation date time of the job. /// The last date time the job was updated. @@ -431,13 +413,13 @@ public static TextAuthoringUnassignDeploymentResourcesState TextAuthoringUnassig /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static TextAuthoringAssignDeploymentResourcesState TextAuthoringAssignDeploymentResourcesState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static TextAuthoringDeploymentResourcesState TextAuthoringDeploymentResourcesState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { warnings ??= new List(); errors ??= new List(); - return new TextAuthoringAssignDeploymentResourcesState( + return new TextAuthoringDeploymentResourcesState( jobId, createdOn, lastUpdatedOn, @@ -525,13 +507,13 @@ public static TextAuthoringDeploymentDeleteFromResourcesState TextAuthoringDeplo /// Initializes a new instance of . /// Represents the trained model label. - /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. /// A new instance for mocking. - public static TextAuthoringCreateDeploymentDetails TextAuthoringCreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResources = null) + public static TextAuthoringCreateDeploymentDetails TextAuthoringCreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) { - assignedResources ??= new List(); + assignedResourceIds ??= new List(); - return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResources?.ToList(), serializedAdditionalRawData: null); + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs index 462a57136e16..f48205a761fa 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.Serialization.cs @@ -36,13 +36,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("trainedModelLabel"u8); writer.WriteStringValue(TrainedModelLabel); - if (Optional.IsCollectionDefined(AssignedResources)) + if (Optional.IsCollectionDefined(AssignedResourceIds)) { - writer.WritePropertyName("assignedResources"u8); + writer.WritePropertyName("assignedResourceIds"u8); writer.WriteStartArray(); - foreach (var item in AssignedResources) + foreach (var item in AssignedResourceIds) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } @@ -84,7 +84,7 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre return null; } string trainedModelLabel = default; - IList assignedResources = default; + IList assignedResourceIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,18 +94,18 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre trainedModelLabel = property.Value.GetString(); continue; } - if (property.NameEquals("assignedResources"u8)) + if (property.NameEquals("assignedResourceIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAuthoringDeploymentResource.DeserializeTextAuthoringDeploymentResource(item, options)); + array.Add(item.GetString()); } - assignedResources = array; + assignedResourceIds = array; continue; } if (options.Format != "W") @@ -114,7 +114,7 @@ internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCre } } serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResources ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs index bfef247637e1..f41ba590c089 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringCreateDeploymentDetails.cs @@ -53,17 +53,17 @@ public TextAuthoringCreateDeploymentDetails(string trainedModelLabel) Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); TrainedModelLabel = trainedModelLabel; - AssignedResources = new ChangeTrackingList(); + AssignedResourceIds = new ChangeTrackingList(); } /// Initializes a new instance of . /// Represents the trained model label. - /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. /// Keeps track of any properties unknown to the library. - internal TextAuthoringCreateDeploymentDetails(string trainedModelLabel, IList assignedResources, IDictionary serializedAdditionalRawData) + internal TextAuthoringCreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) { TrainedModelLabel = trainedModelLabel; - AssignedResources = assignedResources; + AssignedResourceIds = assignedResourceIds; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,7 +74,7 @@ internal TextAuthoringCreateDeploymentDetails() /// Represents the trained model label. public string TrainedModelLabel { get; } - /// Represents the resources to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. - public IList AssignedResources { get; } + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + public IList AssignedResourceIds { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs index 5972c09d3675..9b027fe33e14 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.Serialization.cs @@ -38,11 +38,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(ResourceId); writer.WritePropertyName("region"u8); writer.WriteStringValue(Region); - if (Optional.IsDefined(AssignedAoaiResource)) - { - writer.WritePropertyName("assignedAoaiResource"u8); - writer.WriteObjectValue(AssignedAoaiResource, options); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,7 +77,6 @@ internal static TextAuthoringDeploymentResource DeserializeTextAuthoringDeployme } string resourceId = default; string region = default; - DataGenerationConnectionInfo assignedAoaiResource = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -97,22 +91,13 @@ internal static TextAuthoringDeploymentResource DeserializeTextAuthoringDeployme region = property.Value.GetString(); continue; } - if (property.NameEquals("assignedAoaiResource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - assignedAoaiResource = DataGenerationConnectionInfo.DeserializeDataGenerationConnectionInfo(property.Value, options); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringDeploymentResource(resourceId, region, assignedAoaiResource, serializedAdditionalRawData); + return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs index 5b20610cfe03..79a30f7eeb5d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResource.cs @@ -49,7 +49,7 @@ public partial class TextAuthoringDeploymentResource /// Represents the Azure resource Id. /// Represents the resource region. /// or is null. - public TextAuthoringDeploymentResource(string resourceId, string region) + internal TextAuthoringDeploymentResource(string resourceId, string region) { Argument.AssertNotNull(resourceId, nameof(resourceId)); Argument.AssertNotNull(region, nameof(region)); @@ -61,13 +61,11 @@ public TextAuthoringDeploymentResource(string resourceId, string region) /// Initializes a new instance of . /// Represents the Azure resource Id. /// Represents the resource region. - /// Represents the AOAI resource assigned for data generation. /// Keeps track of any properties unknown to the library. - internal TextAuthoringDeploymentResource(string resourceId, string region, DataGenerationConnectionInfo assignedAoaiResource, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) { ResourceId = resourceId; Region = region; - AssignedAoaiResource = assignedAoaiResource; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,10 +75,8 @@ internal TextAuthoringDeploymentResource() } /// Represents the Azure resource Id. - public string ResourceId { get; set; } + public string ResourceId { get; } /// Represents the resource region. - public string Region { get; set; } - /// Represents the AOAI resource assigned for data generation. - public DataGenerationConnectionInfo AssignedAoaiResource { get; set; } + public string Region { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.Serialization.cs similarity index 77% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.Serialization.cs index 983a4d4efde5..9025c51ca279 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring { - public partial class TextAuthoringAssignDeploymentResourcesState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringDeploymentResourcesState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResourcesState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TextAuthoringAssignDeploymentResourcesState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDeploymentResourcesState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResourcesState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTextAuthoringAssignDeploymentResourcesState(document.RootElement, options); + return DeserializeTextAuthoringDeploymentResourcesState(document.RootElement, options); } - internal static TextAuthoringAssignDeploymentResourcesState DeserializeTextAuthoringAssignDeploymentResourcesState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringDeploymentResourcesState DeserializeTextAuthoringDeploymentResourcesState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -181,7 +181,7 @@ internal static TextAuthoringAssignDeploymentResourcesState DeserializeTextAutho } } serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringAssignDeploymentResourcesState( + return new TextAuthoringDeploymentResourcesState( jobId, createdDateTime, lastUpdatedDateTime, @@ -192,43 +192,43 @@ internal static TextAuthoringAssignDeploymentResourcesState DeserializeTextAutho serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureAILanguageTextAuthoringContext.Default); default: - throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResourcesState)} does not support writing '{options.Format}' format."); } } - TextAuthoringAssignDeploymentResourcesState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDeploymentResourcesState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTextAuthoringAssignDeploymentResourcesState(document.RootElement, options); + return DeserializeTextAuthoringDeploymentResourcesState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResourcesState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TextAuthoringAssignDeploymentResourcesState FromResponse(Response response) + internal static TextAuthoringDeploymentResourcesState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTextAuthoringAssignDeploymentResourcesState(document.RootElement); + return DeserializeTextAuthoringDeploymentResourcesState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.cs similarity index 82% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.cs index 5f49d057c066..3dc3fc09df43 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringAssignDeploymentResourcesState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeploymentResourcesState.cs @@ -10,8 +10,8 @@ namespace Azure.AI.Language.Text.Authoring { - /// Represents the state of a assign deployment resources job. - public partial class TextAuthoringAssignDeploymentResourcesState + /// Represents the state of a deployment resources job. + public partial class TextAuthoringDeploymentResourcesState { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class TextAuthoringAssignDeploymentResourcesState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The creation date time of the job. /// The last date time the job was updated. /// The job status. - internal TextAuthoringAssignDeploymentResourcesState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) + internal TextAuthoringDeploymentResourcesState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { CreatedOn = createdOn; LastUpdatedOn = lastUpdatedOn; @@ -58,7 +58,7 @@ internal TextAuthoringAssignDeploymentResourcesState(DateTimeOffset createdOn, D Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. /// The creation date time of the job. /// The last date time the job was updated. @@ -67,7 +67,7 @@ internal TextAuthoringAssignDeploymentResourcesState(DateTimeOffset createdOn, D /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal TextAuthoringAssignDeploymentResourcesState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentResourcesState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; CreatedOn = createdOn; @@ -79,8 +79,8 @@ internal TextAuthoringAssignDeploymentResourcesState(string jobId, DateTimeOffse _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TextAuthoringAssignDeploymentResourcesState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringDeploymentResourcesState() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs index da155e303c4b..60bb22c2ac74 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.Serialization.cs @@ -50,11 +50,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("projectKind"u8); writer.WriteStringValue(ProjectKind.ToString()); - if (Optional.IsDefined(StorageAccountResourceId)) - { - writer.WritePropertyName("storageAccountResourceId"u8); - writer.WriteStringValue(StorageAccountResourceId); - } writer.WritePropertyName("storageInputContainerName"u8); writer.WriteStringValue(StorageInputContainerName); if (Optional.IsDefined(Settings)) @@ -121,7 +116,6 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta DateTimeOffset? lastTrainedDateTime = default; DateTimeOffset? lastDeployedDateTime = default; TextAuthoringProjectKind projectKind = default; - string storageAccountResourceId = default; string storageInputContainerName = default; TextAuthoringProjectSettings settings = default; string projectName = default; @@ -165,11 +159,6 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } - if (property.NameEquals("storageAccountResourceId"u8)) - { - storageAccountResourceId = property.Value.GetString(); - continue; - } if (property.NameEquals("storageInputContainerName"u8)) { storageInputContainerName = property.Value.GetString(); @@ -220,7 +209,6 @@ internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMeta lastTrainedDateTime, lastDeployedDateTime, projectKind, - storageAccountResourceId, storageInputContainerName, settings, projectName, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs index 7db7ab9464ba..d0a834ac796d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjectMetadata.cs @@ -70,7 +70,6 @@ internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset l /// Represents the project last training datetime. /// Represents the project last deployment datetime. /// The project kind. - /// The project storage account resource ID. /// The storage container name. /// The project settings. /// The new project name. @@ -78,14 +77,13 @@ internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset l /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, TextAuthoringProjectKind projectKind, string storageAccountResourceId, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, TextAuthoringProjectKind projectKind, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { CreatedOn = createdOn; LastModifiedOn = lastModifiedOn; LastTrainedOn = lastTrainedOn; LastDeployedOn = lastDeployedOn; ProjectKind = projectKind; - StorageAccountResourceId = storageAccountResourceId; StorageInputContainerName = storageInputContainerName; Settings = settings; ProjectName = projectName; @@ -110,8 +108,6 @@ internal TextAuthoringProjectMetadata() public DateTimeOffset? LastDeployedOn { get; } /// The project kind. public TextAuthoringProjectKind ProjectKind { get; } - /// The project storage account resource ID. - public string StorageAccountResourceId { get; } /// The storage container name. public string StorageInputContainerName { get; } /// The project settings. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.Serialization.cs deleted file mode 100644 index 7d65edb4bd79..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring -{ - public partial class TextAuthoringUnassignDeploymentResourcesState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesState)} does not support writing '{format}' format."); - } - - if (options.Format != "W") - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedOn, "O"); - writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedOn, "O"); - if (Optional.IsDefined(ExpiresOn)) - { - writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpiresOn.Value, "O"); - } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - if (Optional.IsCollectionDefined(Warnings)) - { - writer.WritePropertyName("warnings"u8); - writer.WriteStartArray(); - foreach (var item in Warnings) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Errors)) - { - writer.WritePropertyName("errors"u8); - writer.WriteStartArray(); - foreach (var item in Errors) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TextAuthoringUnassignDeploymentResourcesState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTextAuthoringUnassignDeploymentResourcesState(document.RootElement, options); - } - - internal static TextAuthoringUnassignDeploymentResourcesState DeserializeTextAuthoringUnassignDeploymentResourcesState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobId = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - DateTimeOffset? expirationDateTime = default; - TextAuthoringOperationStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new TextAuthoringOperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("warnings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - warnings = array; - continue; - } - if (property.NameEquals("errors"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - errors = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TextAuthoringUnassignDeploymentResourcesState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAILanguageTextAuthoringContext.Default); - default: - throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesState)} does not support writing '{options.Format}' format."); - } - } - - TextAuthoringUnassignDeploymentResourcesState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTextAuthoringUnassignDeploymentResourcesState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static TextAuthoringUnassignDeploymentResourcesState FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTextAuthoringUnassignDeploymentResourcesState(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.cs deleted file mode 100644 index f3c111265a37..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringUnassignDeploymentResourcesState.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Text.Authoring -{ - /// Represents the state of a unassign deployment resources job. - public partial class TextAuthoringUnassignDeploymentResourcesState - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. - /// The job status. - internal TextAuthoringUnassignDeploymentResourcesState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) - { - CreatedOn = createdOn; - LastUpdatedOn = lastUpdatedOn; - Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// Keeps track of any properties unknown to the library. - internal TextAuthoringUnassignDeploymentResourcesState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) - { - JobId = jobId; - CreatedOn = createdOn; - LastUpdatedOn = lastUpdatedOn; - ExpiresOn = expiresOn; - Status = status; - Warnings = warnings; - Errors = errors; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TextAuthoringUnassignDeploymentResourcesState() - { - } - - /// The job ID. - public string JobId { get; } - /// The creation date time of the job. - public DateTimeOffset CreatedOn { get; } - /// The last date time the job was updated. - public DateTimeOffset LastUpdatedOn { get; } - /// The expiration date time of the job. - public DateTimeOffset? ExpiresOn { get; } - /// The job status. - public TextAuthoringOperationStatus Status { get; } - /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } - /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index 9f62c07bf743..a12e45091d9e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 63d4b007f5d9462253cd166feb5ba210bcad4ab7 +commit: 4719bc50d889f2c313e8b4580596f884439eeaa8 repo: Azure/azure-rest-api-specs From e13e54fdb2ad198565f93af8d7c220c7ae9076b1 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Thu, 26 Jun 2025 14:44:58 -0700 Subject: [PATCH 04/47] updated AssignDeploymentResourcesState and UnassignDeploymentResourcesState to DeploymentResourcesState --- .../src/TextAuthoringProject.cs | 16 ++++++++-------- .../tests/TextAuthoringClientLiveTest.cs | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs index 06b907e6972e..7444f0122fff 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs @@ -1646,14 +1646,14 @@ public virtual Response GetSwapDeploymentsStatus(string jobId, RequestContext co /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string jobId, CancellationToken cancellationToken = default) + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string jobId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = await GetAssignDeploymentResourcesStatusAsync(jobId, context).ConfigureAwait(false); - return Response.FromValue(TextAuthoringAssignDeploymentResourcesState.FromResponse(response), response); + return Response.FromValue(TextAuthoringDeploymentResourcesState.FromResponse(response), response); } /// Gets the status of an existing assign deployment resources job. @@ -1661,14 +1661,14 @@ public virtual async Task> /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response GetAssignDeploymentResourcesStatus(string jobId, CancellationToken cancellationToken = default) + public virtual Response GetAssignDeploymentResourcesStatus(string jobId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = GetAssignDeploymentResourcesStatus(jobId, context); - return Response.FromValue(TextAuthoringAssignDeploymentResourcesState.FromResponse(response), response); + return Response.FromValue(TextAuthoringDeploymentResourcesState.FromResponse(response), response); } /// Gets the status of an existing unassign deployment resources job. @@ -1676,14 +1676,14 @@ public virtual Response GetAssignDe /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, CancellationToken cancellationToken = default) + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = await GetUnassignDeploymentResourcesStatusAsync(jobId, context).ConfigureAwait(false); - return Response.FromValue(TextAuthoringUnassignDeploymentResourcesState.FromResponse(response), response); + return Response.FromValue(TextAuthoringDeploymentResourcesState.FromResponse(response), response); } /// Gets the status of an existing unassign deployment resources job. @@ -1691,14 +1691,14 @@ public virtual async Task The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response GetUnassignDeploymentResourcesStatus(string jobId, CancellationToken cancellationToken = default) + public virtual Response GetUnassignDeploymentResourcesStatus(string jobId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = GetUnassignDeploymentResourcesStatus(jobId, context); - return Response.FromValue(TextAuthoringUnassignDeploymentResourcesState.FromResponse(response), response); + return Response.FromValue(TextAuthoringDeploymentResourcesState.FromResponse(response), response); } /// Assign new Azure resources to a project to allow deploying new deployments to them. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 1061140d44de..d54fd48b6be2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -48,7 +48,6 @@ public async Task GetProjectAsync() Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); Console.WriteLine($"Description: {projectMetadata.Description}"); Console.WriteLine($"StorageInputContainerName: {projectMetadata.StorageInputContainerName}"); - Console.WriteLine($"StorageAccountResourceId: {projectMetadata.StorageAccountResourceId}"); } [RecordedTest] From 687b1a2ae7616f67f6635f6c2df198ac43155793 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Thu, 26 Jun 2025 16:32:15 -0700 Subject: [PATCH 05/47] updated record tests --- .../CancelTrainingJobAsync.json | 19 ++++--- .../CancelTrainingJobAsyncAsync.json | 54 +++++++++---------- .../DeleteProjectAsync.json | 39 +++++++------- .../DeleteProjectAsyncAsync.json | 54 +++++++++---------- .../TrainAsync.json | 19 ++++--- .../tests/TextAuthoringClientLiveTest.cs | 8 +-- 6 files changed, 95 insertions(+), 98 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json index 8e9cece15fcd..37bd0147c54c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json @@ -1,14 +1,13 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/train/jobs/05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000/:cancel?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/train/jobs/a0f21063-df96-49ea-b275-2c50b4c5fe33_638864928000000000/:cancel?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Content-Length": "0", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250626.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -16,22 +15,22 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", + "apim-request-id": "dc156674-ce95-4747-836d-8b05e42d3e1d", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 07:00:58 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/train/jobs/05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000?api-version=2024-11-15-preview", - "request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", + "Date": "Thu, 26 Jun 2025 21:55:01 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/train/jobs/a0f21063-df96-49ea-b275-2c50b4c5fe33_638864928000000000?api-version=2025-05-15-preview", + "request-id": "dc156674-ce95-4747-836d-8b05e42d3e1d", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "50", + "x-envoy-upstream-service-time": "73", "x-ms-region": "East US" }, "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1711680977" + "RandomSeed": "651701705" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json index 8e9cece15fcd..8b1e990b00f7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json @@ -1,36 +1,36 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/train/jobs/05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000/:cancel?api-version=2024-11-15-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Connection": "keep-alive", - "Content-Length": "0", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", - "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 07:00:58 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/train/jobs/05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000?api-version=2024-11-15-preview", - "request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "50", - "x-ms-region": "East US" - }, - "ResponseBody": null + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/train/jobs/a0f21063-df96-49ea-b275-2c50b4c5fe33_638864928000000000/:cancel?api-version=2025-05-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Connection": "keep-alive", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", + "Content-Length": "0", + "Date": "Mon, 03 Mar 2025 07:00:58 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/train/jobs/05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000?api-version=2025-05-15-preview", + "request-id": "320746ce-c23f-49c0-8afe-85563dc0da93", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "East US" + }, + "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", "RandomSeed": "1711680977" } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json index 7ad007ac6786..9e2bcbdf952b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json @@ -1,13 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject?api-version=2025-05-15-preview", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250626.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -15,24 +14,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", + "apim-request-id": "a50be4da-7ab1-48e9-9722-191ff6655565", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:51:01 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2024-11-15-preview", - "request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", + "Date": "Thu, 26 Jun 2025 22:29:43 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/ff5bbb03-9831-40f2-b216-d68680c59a13_638864928000000000?api-version=2025-05-15-preview", + "request-id": "a50be4da-7ab1-48e9-9722-191ff6655565", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "77", + "x-envoy-upstream-service-time": "191", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/ff5bbb03-9831-40f2-b216-d68680c59a13_638864928000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250626.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -40,28 +39,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "0fc33862-e138-41a2-a3c9-626604a67f78", + "apim-request-id": "65576214-22e3-4749-972a-346234cedced", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 06:51:01 GMT", - "request-id": "0fc33862-e138-41a2-a3c9-626604a67f78", + "Date": "Thu, 26 Jun 2025 22:29:43 GMT", + "request-id": "65576214-22e3-4749-972a-346234cedced", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "22", + "x-envoy-upstream-service-time": "156", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000", - "createdDateTime": "2025-03-03T06:51:01Z", - "lastUpdatedDateTime": "2025-03-03T06:51:01Z", - "expirationDateTime": "2025-03-10T06:51:01Z", + "jobId": "ff5bbb03-9831-40f2-b216-d68680c59a13_638864928000000000", + "createdDateTime": "2025-06-26T22:29:43Z", + "lastUpdatedDateTime": "2025-06-26T22:29:43Z", + "expirationDateTime": "2025-07-03T22:29:43Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1203780664" + "RandomSeed": "465730923" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json index 7ad007ac6786..d790df50d584 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json @@ -1,34 +1,34 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Connection": "keep-alive", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", - "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:51:01 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2024-11-15-preview", - "request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "77", - "x-ms-region": "East US" - }, - "ResponseBody": null + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject?api-version=2025-05-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", + "Content-Length": "0", + "Date": "Mon, 03 Mar 2025 06:51:01 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2025-05-15-preview", + "request-id": "5ab3f69f-7aed-4ad7-a951-8b630bb23b75", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "77", + "x-ms-region": "East US" + }, + "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/7b90a928-6fd9-4f92-825b-de8da8eb9ecb_638765568000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", @@ -60,7 +60,7 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", "RandomSeed": "1203780664" } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json index b0e19616154a..85f998f65752 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json @@ -1,15 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/:train?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/:train?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Content-Length": "159", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250626.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -25,22 +24,22 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "4c0b8e99-6774-473c-ac82-1cdae262aff3", + "apim-request-id": "021e0761-cf6e-46b7-ba89-aab0f829212a", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:54:06 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/train/jobs/0fbeef32-263a-46c6-a532-8f819d83c95c_638765568000000000?api-version=2024-11-15-preview", - "request-id": "4c0b8e99-6774-473c-ac82-1cdae262aff3", + "Date": "Thu, 26 Jun 2025 22:33:27 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/train/jobs/214d526f-9247-416e-9562-ca8bff5ea520_638864928000000000?api-version=2025-05-15-preview", + "request-id": "021e0761-cf6e-46b7-ba89-aab0f829212a", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "148", + "x-envoy-upstream-service-time": "318", "x-ms-region": "East US" }, "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "66619128" + "RandomSeed": "1186837361" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index d54fd48b6be2..22cab6c88b6c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -149,7 +149,7 @@ public async Task CreateProjectAsync() public async Task DeleteProjectAsync() { // Arrange - string projectName = "MyTextProject"; + string projectName = "MyImportTextProject"; TextAuthoringProject projectClient = client.GetProject(projectName); // Act @@ -171,7 +171,7 @@ public async Task DeleteProjectAsync() public async Task TrainAsync() { // Arrange - string projectName = "MyTextProject001"; + string projectName = "single-class-project"; var trainingJobDetails = new TextAuthoringTrainingJobDetails( modelLabel: "model1", @@ -207,8 +207,8 @@ public async Task TrainAsync() public async Task CancelTrainingJobAsync() { // Arrange - string projectName = "test001"; - string jobId = "05a7d735-cd04-4402-8aa8-131775ed1bb6_638765568000000000"; // Replace with an actual job ID. + string projectName = "single-class-project"; + string jobId = "a0f21063-df96-49ea-b275-2c50b4c5fe33_638864928000000000"; // Replace with an actual job ID. TextAuthoringProject projectClient = client.GetProject(projectName); // Act From 1b116edb84fb3bfe5a50d25129fe0bd44fa5d8bd Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Fri, 27 Jun 2025 10:36:31 -0700 Subject: [PATCH 06/47] updated some test records. --- .../DeleteDeploymentAsync.json | 140 +++++++--- .../DeleteDeploymentAsyncAsync.json | 56 ++-- .../DeleteTrainedModelAsync.json | 16 +- .../DeleteTrainedModelAsyncAsync.json | 16 +- .../DeployProjectAsync.json | 178 +------------ .../DeployProjectAsyncAsync.json | 240 +----------------- .../GetModelEvaluationSummaryAsync.json | 191 +++++++++----- .../GetModelEvaluationSummaryAsyncAsync.json | 190 ++++++++++---- .../LoadSnapshotAsync.json | 63 +++-- .../LoadSnapshotAsyncAsync.json | 58 ++--- .../SwapDeploymentsAsync.json | 160 ++++-------- .../SwapDeploymentsAsyncAsync.json | 82 +++--- .../TrainAsyncAsync.json | 19 +- .../tests/TextAuthoringClientLiveTest.cs | 95 +------ 14 files changed, 606 insertions(+), 898 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json index 901fb016c724..d1690656c629 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json @@ -1,12 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment?api-version=2025-05-15-preview", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -14,24 +14,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "apim-request-id": "c0b4a326-536f-4aa9-9da2-167caa4a3b13", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:27:27 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", - "request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Date": "Fri, 27 Jun 2025 17:23:21 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", + "request-id": "c0b4a326-536f-4aa9-9da2-167caa4a3b13", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "86", + "x-envoy-upstream-service-time": "67", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -39,30 +39,92 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "apim-request-id": "6bee3bd4-8855-4921-9e1b-0f3642f2ac96", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 27 Jun 2025 17:23:21 GMT", + "request-id": "6bee3bd4-8855-4921-9e1b-0f3642f2ac96", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000", + "createdDateTime": "2025-06-27T17:23:21Z", + "lastUpdatedDateTime": "2025-06-27T17:23:21Z", + "expirationDateTime": "2025-07-04T17:23:21Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1f08ab80-6844-44ee-ab2e-d7283d7fee7c", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 27 Jun 2025 17:23:23 GMT", + "request-id": "1f08ab80-6844-44ee-ab2e-d7283d7fee7c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "40", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000", + "createdDateTime": "2025-06-27T17:23:21Z", + "lastUpdatedDateTime": "2025-06-27T17:23:22Z", + "expirationDateTime": "2025-07-04T17:23:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "29570da7-e894-48c9-8d3d-425814cafa67", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:27:27 GMT", - "request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "Date": "Fri, 27 Jun 2025 17:23:24 GMT", + "request-id": "29570da7-e894-48c9-8d3d-425814cafa67", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "41", + "x-envoy-upstream-service-time": "32", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", - "createdDateTime": "2024-12-02T04:27:27Z", - "lastUpdatedDateTime": "2024-12-02T04:27:28Z", - "expirationDateTime": "2024-12-09T04:27:27Z", + "jobId": "f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000", + "createdDateTime": "2025-06-27T17:23:21Z", + "lastUpdatedDateTime": "2025-06-27T17:23:22Z", + "expirationDateTime": "2025-07-04T17:23:21Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -70,30 +132,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "apim-request-id": "8696a415-1bde-47fd-97c3-4f3830f4d34c", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:27:28 GMT", - "request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "Date": "Fri, 27 Jun 2025 17:23:25 GMT", + "request-id": "8696a415-1bde-47fd-97c3-4f3830f4d34c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "36", + "x-envoy-upstream-service-time": "32", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", - "createdDateTime": "2024-12-02T04:27:27Z", - "lastUpdatedDateTime": "2024-12-02T04:27:28Z", - "expirationDateTime": "2024-12-09T04:27:27Z", + "jobId": "f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000", + "createdDateTime": "2025-06-27T17:23:21Z", + "lastUpdatedDateTime": "2025-06-27T17:23:22Z", + "expirationDateTime": "2025-07-04T17:23:21Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment/jobs/f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -101,28 +163,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "apim-request-id": "fe2b0822-8b83-41af-8f96-085fc59268cf", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:27:30 GMT", - "request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "Date": "Fri, 27 Jun 2025 17:23:26 GMT", + "request-id": "fe2b0822-8b83-41af-8f96-085fc59268cf", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "47", + "x-envoy-upstream-service-time": "31", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", - "createdDateTime": "2024-12-02T04:27:27Z", - "lastUpdatedDateTime": "2024-12-02T04:27:30Z", - "expirationDateTime": "2024-12-09T04:27:27Z", + "jobId": "f7eb24f2-acbc-4f79-9ec6-781f1cdaeae4_638865792000000000", + "createdDateTime": "2025-06-27T17:23:21Z", + "lastUpdatedDateTime": "2025-06-27T17:23:26Z", + "expirationDateTime": "2025-07-04T17:23:21Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "61017863" + "RandomSeed": "1732095234" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json index 901fb016c724..7091d799239e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json @@ -1,33 +1,33 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2?api-version=2024-11-15-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "638b7754-5530-431c-ba47-263bf827ec35", - "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:27:27 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", - "request-id": "638b7754-5530-431c-ba47-263bf827ec35", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "86", - "x-ms-region": "East US" - }, - "ResponseBody": null + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/singleclassdeployment?api-version=2025-05-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:27:27 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2025-05-15-preview", + "request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "86", + "x-ms-region": "East US" + }, + "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", @@ -58,7 +58,7 @@ } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", @@ -89,7 +89,7 @@ } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", @@ -121,7 +121,7 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", "RandomSeed": "61017863" } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json index d4d60bdc3224..6aaf59187eea 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json @@ -1,12 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1?api-version=2025-05-15-preview", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -14,21 +14,21 @@ "StatusCode": 204, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "2ae2677d-180c-4a5e-9db7-c7bd70b2461e", + "apim-request-id": "8c3e6786-2042-4546-846c-ca07a052f7d9", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:18:47 GMT", - "request-id": "2ae2677d-180c-4a5e-9db7-c7bd70b2461e", + "Date": "Fri, 27 Jun 2025 17:26:13 GMT", + "request-id": "8c3e6786-2042-4546-846c-ca07a052f7d9", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "289", + "x-envoy-upstream-service-time": "318", "x-ms-region": "East US" }, "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1981396821" + "RandomSeed": "1786351019" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json index 7b9148f06927..47d15d50f236 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json @@ -1,12 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1?api-version=2025-05-15-preview", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -14,21 +14,21 @@ "StatusCode": 204, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "ce4ff277-0aee-4b53-9423-558862a283f1", + "apim-request-id": "76dfd157-9477-4376-8127-f994820b14d0", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:18:47 GMT", - "request-id": "ce4ff277-0aee-4b53-9423-558862a283f1", + "Date": "Fri, 27 Jun 2025 17:26:13 GMT", + "request-id": "76dfd157-9477-4376-8127-f994820b14d0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "62", + "x-envoy-upstream-service-time": "55", "x-ms-region": "East US" }, "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1604671" + "RandomSeed": "1852229723" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json index 8a790e97112e..a0509694ff3d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json @@ -1,195 +1,39 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1?api-version=2025-05-15-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "26", + "Content-Length": "30", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "trainedModelLabel": "m2" + "trainedModelLabel": "model1" }, "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "68742a20-beec-40bb-a4f7-29ab05f47f7e", + "apim-request-id": "e7f165b4-780a-4ccd-b110-c871ee05c575", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:22:51 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", - "request-id": "68742a20-beec-40bb-a4f7-29ab05f47f7e", + "Date": "Fri, 27 Jun 2025 17:29:49 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1/jobs/6e586443-a389-4257-9bb1-251e84b91cc6_638865792000000000?api-version=2025-05-15-preview", + "request-id": "e7f165b4-780a-4ccd-b110-c871ee05c575", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "132", + "x-envoy-upstream-service-time": "217", "x-ms-region": "East US" }, "ResponseBody": null - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "1ea6f14b-b77f-4461-9b54-f7fa950e793d", - "Content-Length": "219", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:51 GMT", - "request-id": "1ea6f14b-b77f-4461-9b54-f7fa950e793d", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "47", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", - "createdDateTime": "2024-12-02T04:22:51Z", - "lastUpdatedDateTime": "2024-12-02T04:22:51Z", - "expirationDateTime": "2024-12-09T04:22:51Z", - "status": "notStarted" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "857d672a-d18b-42f9-b112-56dcfbfc4c5f", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:52 GMT", - "request-id": "857d672a-d18b-42f9-b112-56dcfbfc4c5f", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "52", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", - "createdDateTime": "2024-12-02T04:22:51Z", - "lastUpdatedDateTime": "2024-12-02T04:22:51Z", - "expirationDateTime": "2024-12-09T04:22:51Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "252eb04a-c423-4223-88d3-b1ef8f162f49", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:53 GMT", - "request-id": "252eb04a-c423-4223-88d3-b1ef8f162f49", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "53", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", - "createdDateTime": "2024-12-02T04:22:51Z", - "lastUpdatedDateTime": "2024-12-02T04:22:51Z", - "expirationDateTime": "2024-12-09T04:22:51Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "95b93e57-7b80-43ef-8e3e-9b2161ba11c3", - "Content-Length": "218", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:54 GMT", - "request-id": "95b93e57-7b80-43ef-8e3e-9b2161ba11c3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "23", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", - "createdDateTime": "2024-12-02T04:22:51Z", - "lastUpdatedDateTime": "2024-12-02T04:22:53Z", - "expirationDateTime": "2024-12-09T04:22:51Z", - "status": "succeeded" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "976d4de3-862c-447b-9f96-29af40568216", - "Content-Length": "277", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:54 GMT", - "request-id": "976d4de3-862c-447b-9f96-29af40568216", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "42", - "x-ms-region": "East US" - }, - "ResponseBody": { - "deploymentName": "deployment1", - "modelId": "m2-20241202T035733-dff6706ab8694964b5acd63a6c2870c0", - "lastTrainedDateTime": "2024-12-02T03:57:33.8992972Z", - "lastDeployedDateTime": "2024-12-02T04:22:53Z", - "deploymentExpirationDate": "2026-10-22", - "modelTrainingConfigVersion": "2022-05-01" - } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1133352948" + "RandomSeed": "1573133456" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json index 6a7833186221..c65f68c2a7d9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json @@ -1,257 +1,39 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1?api-version=2025-05-15-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "26", + "Content-Length": "30", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "trainedModelLabel": "m2" + "trainedModelLabel": "model1" }, "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "8c944397-516c-4e42-a889-0a0b8e946630", + "apim-request-id": "d61f392b-be64-42a0-a70d-4db92b0957ce", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:22:55 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "request-id": "8c944397-516c-4e42-a889-0a0b8e946630", + "Date": "Fri, 27 Jun 2025 17:29:50 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1/jobs/83a41d7c-1cb3-4135-9d54-2d0a4f6f2a5b_638865792000000000?api-version=2025-05-15-preview", + "request-id": "d61f392b-be64-42a0-a70d-4db92b0957ce", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "151", + "x-envoy-upstream-service-time": "196", "x-ms-region": "East US" }, "ResponseBody": null - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "edc7b04f-c219-49fe-b7a4-6e4cf7923c6b", - "Content-Length": "219", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:55 GMT", - "request-id": "edc7b04f-c219-49fe-b7a4-6e4cf7923c6b", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "52", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:22:55Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "notStarted" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "298c6839-af42-413f-b79f-073aafe5cea3", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:56 GMT", - "request-id": "298c6839-af42-413f-b79f-073aafe5cea3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "54", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:22:55Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "8dd19f1c-8d00-4601-a9e8-02add7e96bce", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:57 GMT", - "request-id": "8dd19f1c-8d00-4601-a9e8-02add7e96bce", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "44", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:22:55Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "c23d6296-8efa-465f-9493-bbae709b903f", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:58 GMT", - "request-id": "c23d6296-8efa-465f-9493-bbae709b903f", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "35", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:22:55Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "18e0789a-f58f-4f47-a116-28439df618ba", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:22:59 GMT", - "request-id": "18e0789a-f58f-4f47-a116-28439df618ba", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "33", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:22:55Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "5d78d080-edd2-4b5e-a007-ca253b994a5e", - "Content-Length": "218", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:23:01 GMT", - "request-id": "5d78d080-edd2-4b5e-a007-ca253b994a5e", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "56", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", - "createdDateTime": "2024-12-02T04:22:55Z", - "lastUpdatedDateTime": "2024-12-02T04:23:00Z", - "expirationDateTime": "2024-12-09T04:22:55Z", - "status": "succeeded" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "31ed79a7-1a52-4e53-b858-7e3e41be83b1", - "Content-Length": "277", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:23:01 GMT", - "request-id": "31ed79a7-1a52-4e53-b858-7e3e41be83b1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "44", - "x-ms-region": "East US" - }, - "ResponseBody": { - "deploymentName": "deployment1", - "modelId": "m2-20241202T035733-dff6706ab8694964b5acd63a6c2870c0", - "lastTrainedDateTime": "2024-12-02T03:57:33.8992972Z", - "lastDeployedDateTime": "2024-12-02T04:23:00Z", - "deploymentExpirationDate": "2026-10-22", - "modelTrainingConfigVersion": "2022-05-01" - } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "656965166" + "RandomSeed": "306089719" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json index edb22b07b8a8..22344e3e48e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json @@ -1,13 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/evaluation/summary-result?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -15,81 +14,159 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "8e180d8e-ed30-4e23-886f-21742727e804", - "Content-Length": "1492", + "apim-request-id": "a90ef704-009e-4195-a8b8-8294c5d90202", + "Content-Length": "2820", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:19:50 GMT", - "request-id": "8e180d8e-ed30-4e23-886f-21742727e804", + "Date": "Fri, 27 Jun 2025 17:34:19 GMT", + "request-id": "a90ef704-009e-4195-a8b8-8294c5d90202", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "54", + "x-envoy-upstream-service-time": "71", "x-ms-region": "East US" }, "ResponseBody": { "projectKind": "CustomSingleLabelClassification", "customSingleLabelClassificationEvaluation": { "confusionMatrix": { - "Computer_science": {}, - "Electrical_engineering": {}, - "Mechanical_engineering": { - "Biochemistry": { - "normalizedValue": 50.0, + "Computer_science": { + "Computer_science": { + "normalizedValue": 66.666664, + "rawValue": 4.0 + }, + "Mechanical_engineering": { + "normalizedValue": 16.666666, "rawValue": 1.0 }, + "Civil_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Electrical_engineering": { "Mechanical_engineering": { + "normalizedValue": 33.333332, + "rawValue": 2.0 + }, + "Electrical_engineering": { + "normalizedValue": 50.0, + "rawValue": 3.0 + }, + "Civil_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Psychology": { + "Psychology": { "normalizedValue": 50.0, + "rawValue": 3.0 + }, + "Medical": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + }, + "Biochemistry": { + "normalizedValue": 33.333332, + "rawValue": 2.0 + } + }, + "Mechanical_engineering": { + "Mechanical_engineering": { + "normalizedValue": 66.666664, + "rawValue": 4.0 + }, + "Civil_engineering": { + "normalizedValue": 16.666666, "rawValue": 1.0 + }, + "Electrical_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Civil_engineering": { + "Civil_engineering": { + "normalizedValue": 100.0, + "rawValue": 6.0 + } + }, + "Medical": { + "Medical": { + "normalizedValue": 100.0, + "rawValue": 6.0 + } + }, + "Biochemistry": { + "Biochemistry": { + "normalizedValue": 100.0, + "rawValue": 6.0 } }, - "Civil_engineering": {}, - "Biochemistry": {}, "None": {} }, "classes": { - "Mechanical_engineering": { - "f1": 0.6666666865348816, - "precision": 1.0, - "recall": 0.5, - "truePositiveCount": 1, - "trueNegativeCount": 0, - "falsePositiveCount": 0, - "falseNegativeCount": 1 - }, "Biochemistry": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 1, + "f1": 0.8571428060531616, + "precision": 0.75, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 34, + "falsePositiveCount": 2, + "falseNegativeCount": 0 + }, + "Medical": { + "f1": 0.9230769872665405, + "precision": 0.8571428656578064, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 35, "falsePositiveCount": 1, "falseNegativeCount": 0 }, - "Computer_science": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, - "falsePositiveCount": 0, + "Civil_engineering": { + "f1": 0.800000011920929, + "precision": 0.6666666865348816, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 33, + "falsePositiveCount": 3, "falseNegativeCount": 0 }, + "Mechanical_engineering": { + "f1": 0.6153846383094788, + "precision": 0.5714285969734192, + "recall": 0.6666666865348816, + "truePositiveCount": 4, + "trueNegativeCount": 33, + "falsePositiveCount": 3, + "falseNegativeCount": 2 + }, "Electrical_engineering": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, + "f1": 0.5999999642372131, + "precision": 0.75, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 35, + "falsePositiveCount": 1, + "falseNegativeCount": 3 + }, + "Psychology": { + "f1": 0.6666666865348816, + "precision": 1.0, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 36, "falsePositiveCount": 0, - "falseNegativeCount": 0 + "falseNegativeCount": 3 }, - "Civil_engineering": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, + "Computer_science": { + "f1": 0.800000011920929, + "precision": 1.0, + "recall": 0.6666666865348816, + "truePositiveCount": 4, + "trueNegativeCount": 36, "falsePositiveCount": 0, - "falseNegativeCount": 0 + "falseNegativeCount": 2 }, "None": { "f1": 0.0, @@ -101,12 +178,12 @@ "falseNegativeCount": 0 } }, - "microF1": 0.5, - "microPrecision": 0.5, - "microRecall": 0.5, - "macroF1": 0.6666667, - "macroPrecision": 1.0, - "macroRecall": 0.5 + "microF1": 0.7619048, + "microPrecision": 0.7619048, + "microRecall": 0.7619048, + "macroF1": 0.751753, + "macroPrecision": 0.79931974, + "macroRecall": 0.7619048 }, "evaluationOptions": { "kind": "percentage", @@ -117,8 +194,8 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1732408200" + "RandomSeed": "356072907" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json index f7b83fc800e0..cb8963c78cc8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json @@ -1,12 +1,12 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/evaluation/summary-result?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -14,81 +14,159 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "864d56d4-85c5-41a5-8371-96bf95a6c88b", - "Content-Length": "1492", + "apim-request-id": "cd5a36bd-e79b-4354-a425-51fdd71180b2", + "Content-Length": "2820", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:19:50 GMT", - "request-id": "864d56d4-85c5-41a5-8371-96bf95a6c88b", + "Date": "Fri, 27 Jun 2025 17:34:19 GMT", + "request-id": "cd5a36bd-e79b-4354-a425-51fdd71180b2", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "55", + "x-envoy-upstream-service-time": "116", "x-ms-region": "East US" }, "ResponseBody": { "projectKind": "CustomSingleLabelClassification", "customSingleLabelClassificationEvaluation": { "confusionMatrix": { - "Computer_science": {}, - "Electrical_engineering": {}, - "Mechanical_engineering": { - "Biochemistry": { - "normalizedValue": 50.0, + "Computer_science": { + "Computer_science": { + "normalizedValue": 66.666664, + "rawValue": 4.0 + }, + "Mechanical_engineering": { + "normalizedValue": 16.666666, "rawValue": 1.0 }, + "Civil_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Electrical_engineering": { "Mechanical_engineering": { + "normalizedValue": 33.333332, + "rawValue": 2.0 + }, + "Electrical_engineering": { + "normalizedValue": 50.0, + "rawValue": 3.0 + }, + "Civil_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Psychology": { + "Psychology": { "normalizedValue": 50.0, + "rawValue": 3.0 + }, + "Medical": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + }, + "Biochemistry": { + "normalizedValue": 33.333332, + "rawValue": 2.0 + } + }, + "Mechanical_engineering": { + "Mechanical_engineering": { + "normalizedValue": 66.666664, + "rawValue": 4.0 + }, + "Civil_engineering": { + "normalizedValue": 16.666666, "rawValue": 1.0 + }, + "Electrical_engineering": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "Civil_engineering": { + "Civil_engineering": { + "normalizedValue": 100.0, + "rawValue": 6.0 + } + }, + "Medical": { + "Medical": { + "normalizedValue": 100.0, + "rawValue": 6.0 + } + }, + "Biochemistry": { + "Biochemistry": { + "normalizedValue": 100.0, + "rawValue": 6.0 } }, - "Civil_engineering": {}, - "Biochemistry": {}, "None": {} }, "classes": { - "Mechanical_engineering": { - "f1": 0.6666666865348816, - "precision": 1.0, - "recall": 0.5, - "truePositiveCount": 1, - "trueNegativeCount": 0, - "falsePositiveCount": 0, - "falseNegativeCount": 1 - }, "Biochemistry": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 1, + "f1": 0.8571428060531616, + "precision": 0.75, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 34, + "falsePositiveCount": 2, + "falseNegativeCount": 0 + }, + "Medical": { + "f1": 0.9230769872665405, + "precision": 0.8571428656578064, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 35, "falsePositiveCount": 1, "falseNegativeCount": 0 }, - "Computer_science": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, - "falsePositiveCount": 0, + "Civil_engineering": { + "f1": 0.800000011920929, + "precision": 0.6666666865348816, + "recall": 1.0, + "truePositiveCount": 6, + "trueNegativeCount": 33, + "falsePositiveCount": 3, "falseNegativeCount": 0 }, + "Mechanical_engineering": { + "f1": 0.6153846383094788, + "precision": 0.5714285969734192, + "recall": 0.6666666865348816, + "truePositiveCount": 4, + "trueNegativeCount": 33, + "falsePositiveCount": 3, + "falseNegativeCount": 2 + }, "Electrical_engineering": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, + "f1": 0.5999999642372131, + "precision": 0.75, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 35, + "falsePositiveCount": 1, + "falseNegativeCount": 3 + }, + "Psychology": { + "f1": 0.6666666865348816, + "precision": 1.0, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 36, "falsePositiveCount": 0, - "falseNegativeCount": 0 + "falseNegativeCount": 3 }, - "Civil_engineering": { - "f1": 0.0, - "precision": 0.0, - "recall": 0.0, - "truePositiveCount": 0, - "trueNegativeCount": 0, + "Computer_science": { + "f1": 0.800000011920929, + "precision": 1.0, + "recall": 0.6666666865348816, + "truePositiveCount": 4, + "trueNegativeCount": 36, "falsePositiveCount": 0, - "falseNegativeCount": 0 + "falseNegativeCount": 2 }, "None": { "f1": 0.0, @@ -100,12 +178,12 @@ "falseNegativeCount": 0 } }, - "microF1": 0.5, - "microPrecision": 0.5, - "microRecall": 0.5, - "macroF1": 0.6666667, - "macroPrecision": 1.0, - "macroRecall": 0.5 + "microF1": 0.7619048, + "microPrecision": 0.7619048, + "microRecall": 0.7619048, + "macroF1": 0.751753, + "macroPrecision": 0.79931974, + "macroRecall": 0.7619048 }, "evaluationOptions": { "kind": "percentage", @@ -116,8 +194,8 @@ } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "2069598225" + "RandomSeed": "1722328569" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json index 40ba3e5d144c..53d56406f28a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json @@ -1,14 +1,13 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/:load-snapshot?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/:load-snapshot?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Content-Length": "0", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -16,24 +15,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "fbac219a-b823-44aa-829c-1d18bdc0d5cd", + "apim-request-id": "9ea1bcb7-f6cb-43ab-9722-230c9261fbba", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 07:22:26 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/568777a4-8a1e-4420-a54a-49dffcb080cb_638765568000000000?api-version=2024-11-15-preview", - "request-id": "fbac219a-b823-44aa-829c-1d18bdc0d5cd", + "Date": "Fri, 27 Jun 2025 17:35:10 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/1843f85e-6539-44b6-83a7-1394338689d1_638865792000000000?api-version=2025-05-15-preview", + "request-id": "9ea1bcb7-f6cb-43ab-9722-230c9261fbba", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "73", + "x-envoy-upstream-service-time": "125", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/568777a4-8a1e-4420-a54a-49dffcb080cb_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/1843f85e-6539-44b6-83a7-1394338689d1_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -41,30 +40,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "f4d05e64-e737-4fc0-b9ac-f8721d2e5fb3", - "Content-Length": "216", + "apim-request-id": "d6356c93-a155-47c2-ba43-a9250350f6cc", + "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:22:26 GMT", - "request-id": "f4d05e64-e737-4fc0-b9ac-f8721d2e5fb3", + "Date": "Fri, 27 Jun 2025 17:35:10 GMT", + "request-id": "d6356c93-a155-47c2-ba43-a9250350f6cc", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "30", + "x-envoy-upstream-service-time": "31", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "568777a4-8a1e-4420-a54a-49dffcb080cb_638765568000000000", - "createdDateTime": "2025-03-03T07:22:27Z", - "lastUpdatedDateTime": "2025-03-03T07:22:27Z", - "expirationDateTime": "2025-03-10T07:22:27Z", - "status": "running" + "jobId": "1843f85e-6539-44b6-83a7-1394338689d1_638865792000000000", + "createdDateTime": "2025-06-27T17:35:11Z", + "lastUpdatedDateTime": "2025-06-27T17:35:11Z", + "expirationDateTime": "2025-07-04T17:35:11Z", + "status": "notStarted" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/568777a4-8a1e-4420-a54a-49dffcb080cb_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/1843f85e-6539-44b6-83a7-1394338689d1_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -72,28 +71,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "5656361c-f567-4e14-9149-6a23dda8bfab", + "apim-request-id": "56ae1c56-5246-4e89-8a66-289bb5875178", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:22:27 GMT", - "request-id": "5656361c-f567-4e14-9149-6a23dda8bfab", + "Date": "Fri, 27 Jun 2025 17:35:11 GMT", + "request-id": "56ae1c56-5246-4e89-8a66-289bb5875178", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "32", + "x-envoy-upstream-service-time": "36", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "568777a4-8a1e-4420-a54a-49dffcb080cb_638765568000000000", - "createdDateTime": "2025-03-03T07:22:27Z", - "lastUpdatedDateTime": "2025-03-03T07:22:27Z", - "expirationDateTime": "2025-03-10T07:22:27Z", + "jobId": "1843f85e-6539-44b6-83a7-1394338689d1_638865792000000000", + "createdDateTime": "2025-06-27T17:35:11Z", + "lastUpdatedDateTime": "2025-06-27T17:35:11Z", + "expirationDateTime": "2025-07-04T17:35:11Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "978374734" + "RandomSeed": "317865145" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json index a1d15687aedf..dc5ab9b7ff46 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json @@ -1,13 +1,13 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/:load-snapshot?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/:load-snapshot?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Content-Length": "0", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -15,24 +15,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "cfe75d8f-69b3-4522-81f1-27c2b789c121", + "apim-request-id": "38ac9ac8-dac2-4ffd-a9ab-94fd699e9a1b", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 07:22:27 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/f5499287-8983-4293-8b81-9f0bc1af6a5f_638765568000000000?api-version=2024-11-15-preview", - "request-id": "cfe75d8f-69b3-4522-81f1-27c2b789c121", + "Date": "Fri, 27 Jun 2025 17:35:12 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/450d1d39-39cc-4bf3-97d9-42b4743ec809_638865792000000000?api-version=2025-05-15-preview", + "request-id": "38ac9ac8-dac2-4ffd-a9ab-94fd699e9a1b", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "61", + "x-envoy-upstream-service-time": "113", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/f5499287-8983-4293-8b81-9f0bc1af6a5f_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/450d1d39-39cc-4bf3-97d9-42b4743ec809_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -40,30 +40,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "6609e911-c28c-49d3-8023-ccda365ecca5", + "apim-request-id": "c5b130b7-6416-4ab4-8fc8-b1ce8f78e245", "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:22:28 GMT", - "request-id": "6609e911-c28c-49d3-8023-ccda365ecca5", + "Date": "Fri, 27 Jun 2025 17:35:12 GMT", + "request-id": "c5b130b7-6416-4ab4-8fc8-b1ce8f78e245", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "26", + "x-envoy-upstream-service-time": "28", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f5499287-8983-4293-8b81-9f0bc1af6a5f_638765568000000000", - "createdDateTime": "2025-03-03T07:22:28Z", - "lastUpdatedDateTime": "2025-03-03T07:22:28Z", - "expirationDateTime": "2025-03-10T07:22:28Z", + "jobId": "450d1d39-39cc-4bf3-97d9-42b4743ec809_638865792000000000", + "createdDateTime": "2025-06-27T17:35:12Z", + "lastUpdatedDateTime": "2025-06-27T17:35:12Z", + "expirationDateTime": "2025-07-04T17:35:12Z", "status": "notStarted" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/test001/models/m1/load-snapshot/jobs/f5499287-8983-4293-8b81-9f0bc1af6a5f_638765568000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/load-snapshot/jobs/450d1d39-39cc-4bf3-97d9-42b4743ec809_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -71,28 +71,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "e9063aef-6ce6-40eb-b4a0-ded0a1ed1e0a", + "apim-request-id": "9cbdcce6-6212-473b-a9c6-e3fde392cfcf", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 03 Mar 2025 07:22:29 GMT", - "request-id": "e9063aef-6ce6-40eb-b4a0-ded0a1ed1e0a", + "Date": "Fri, 27 Jun 2025 17:35:13 GMT", + "request-id": "9cbdcce6-6212-473b-a9c6-e3fde392cfcf", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "28", + "x-envoy-upstream-service-time": "36", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "f5499287-8983-4293-8b81-9f0bc1af6a5f_638765568000000000", - "createdDateTime": "2025-03-03T07:22:28Z", - "lastUpdatedDateTime": "2025-03-03T07:22:29Z", - "expirationDateTime": "2025-03-10T07:22:28Z", + "jobId": "450d1d39-39cc-4bf3-97d9-42b4743ec809_638865792000000000", + "createdDateTime": "2025-06-27T17:35:12Z", + "lastUpdatedDateTime": "2025-06-27T17:35:13Z", + "expirationDateTime": "2025-07-04T17:35:12Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "425717336" + "RandomSeed": "1988952223" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json index 0188ba2fbad7..2cbd9c179654 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json @@ -1,14 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/:swap?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/:swap?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Content-Length": "74", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -19,24 +19,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "6119563e-3877-491f-b109-55207a4c32f9", + "apim-request-id": "6d8b7473-c337-44e4-8a4c-51d89bb0144f", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:24:18 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", - "request-id": "6119563e-3877-491f-b109-55207a4c32f9", + "Date": "Fri, 27 Jun 2025 17:33:17 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000?api-version=2025-05-15-preview", + "request-id": "6d8b7473-c337-44e4-8a4c-51d89bb0144f", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "163", + "x-envoy-upstream-service-time": "81", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -44,30 +44,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "f294ac14-0263-4e39-b25c-053af463a643", + "apim-request-id": "9534f830-c6dc-44e8-8718-52c9d59c4a03", "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:18 GMT", - "request-id": "f294ac14-0263-4e39-b25c-053af463a643", + "Date": "Fri, 27 Jun 2025 17:33:17 GMT", + "request-id": "9534f830-c6dc-44e8-8718-52c9d59c4a03", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "45", + "x-envoy-upstream-service-time": "40", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:19Z", - "expirationDateTime": "2024-12-09T04:24:19Z", + "jobId": "73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000", + "createdDateTime": "2025-06-27T17:33:17Z", + "lastUpdatedDateTime": "2025-06-27T17:33:17Z", + "expirationDateTime": "2025-07-04T17:33:17Z", "status": "notStarted" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -75,30 +75,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "b25d8a9a-0b2f-4c7e-90e6-86d8ebf0af8e", + "apim-request-id": "fd639471-2980-4034-95ea-654ca4c9a598", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:20 GMT", - "request-id": "b25d8a9a-0b2f-4c7e-90e6-86d8ebf0af8e", + "Date": "Fri, 27 Jun 2025 17:33:19 GMT", + "request-id": "fd639471-2980-4034-95ea-654ca4c9a598", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "39", + "x-envoy-upstream-service-time": "37", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:19Z", - "expirationDateTime": "2024-12-09T04:24:19Z", + "jobId": "73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000", + "createdDateTime": "2025-06-27T17:33:17Z", + "lastUpdatedDateTime": "2025-06-27T17:33:18Z", + "expirationDateTime": "2025-07-04T17:33:17Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -106,30 +106,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "999cfe4b-dddb-4220-b923-cc8c47032b3c", + "apim-request-id": "b61f243b-a956-4381-9fc3-7866b0347b19", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:21 GMT", - "request-id": "999cfe4b-dddb-4220-b923-cc8c47032b3c", + "Date": "Fri, 27 Jun 2025 17:33:20 GMT", + "request-id": "b61f243b-a956-4381-9fc3-7866b0347b19", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "52", + "x-envoy-upstream-service-time": "36", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:19Z", - "expirationDateTime": "2024-12-09T04:24:19Z", + "jobId": "73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000", + "createdDateTime": "2025-06-27T17:33:17Z", + "lastUpdatedDateTime": "2025-06-27T17:33:18Z", + "expirationDateTime": "2025-07-04T17:33:17Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -137,90 +137,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "6bf73a59-2123-4c1d-afd8-0b931a869544", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:22 GMT", - "request-id": "6bf73a59-2123-4c1d-afd8-0b931a869544", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "33", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:19Z", - "expirationDateTime": "2024-12-09T04:24:19Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "be78628f-1a9c-4f8a-ae9c-5944bd159f12", - "Content-Length": "216", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:23 GMT", - "request-id": "be78628f-1a9c-4f8a-ae9c-5944bd159f12", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "50", - "x-ms-region": "East US" - }, - "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:19Z", - "expirationDateTime": "2024-12-09T04:24:19Z", - "status": "running" - } - }, - { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", - "x-ms-client-request-id": "Sanitized", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Expose-Headers": "*", - "apim-request-id": "5261fbc4-c221-479d-a77e-c3d055ec42cc", + "apim-request-id": "242fb998-38ae-4500-9dc3-d14d19c1ebef", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:24 GMT", - "request-id": "5261fbc4-c221-479d-a77e-c3d055ec42cc", + "Date": "Fri, 27 Jun 2025 17:33:21 GMT", + "request-id": "242fb998-38ae-4500-9dc3-d14d19c1ebef", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "41", + "x-envoy-upstream-service-time": "34", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", - "createdDateTime": "2024-12-02T04:24:19Z", - "lastUpdatedDateTime": "2024-12-02T04:24:24Z", - "expirationDateTime": "2024-12-09T04:24:19Z", + "jobId": "73ae5983-b60c-4d7a-ae26-a3df8e9aa4b2_638865792000000000", + "createdDateTime": "2025-06-27T17:33:17Z", + "lastUpdatedDateTime": "2025-06-27T17:33:20Z", + "expirationDateTime": "2025-07-04T17:33:17Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "20765020" + "RandomSeed": "904779647" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json index 766563c859f6..de5aba233288 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json @@ -1,14 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/:swap?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/:swap?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Content-Length": "74", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -19,24 +19,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "f12f1dba-5dea-428f-b7bc-c67a4a3550da", + "apim-request-id": "2d9662aa-8a9c-48da-9ecc-f66e2cf0ab6c", "Content-Length": "0", - "Date": "Mon, 02 Dec 2024 04:24:24 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", - "request-id": "f12f1dba-5dea-428f-b7bc-c67a4a3550da", + "Date": "Fri, 27 Jun 2025 17:33:21 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000?api-version=2025-05-15-preview", + "request-id": "2d9662aa-8a9c-48da-9ecc-f66e2cf0ab6c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "97", + "x-envoy-upstream-service-time": "156", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -44,30 +44,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "056cd217-a5a7-4e12-af13-ecaa26d3a075", - "Content-Length": "216", + "apim-request-id": "2fd89da7-90c0-492e-91a4-66a20ebfcd1c", + "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:25 GMT", - "request-id": "056cd217-a5a7-4e12-af13-ecaa26d3a075", + "Date": "Fri, 27 Jun 2025 17:33:21 GMT", + "request-id": "2fd89da7-90c0-492e-91a4-66a20ebfcd1c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "45", + "x-envoy-upstream-service-time": "36", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", - "createdDateTime": "2024-12-02T04:24:25Z", - "lastUpdatedDateTime": "2024-12-02T04:24:25Z", - "expirationDateTime": "2024-12-09T04:24:25Z", - "status": "running" + "jobId": "f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000", + "createdDateTime": "2025-06-27T17:33:21Z", + "lastUpdatedDateTime": "2025-06-27T17:33:21Z", + "expirationDateTime": "2025-07-04T17:33:21Z", + "status": "notStarted" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -75,30 +75,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "ee5e1529-7b92-4b03-ad24-74ee0206cb76", + "apim-request-id": "30b50cdf-3503-4b4d-af29-b599aad94598", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:26 GMT", - "request-id": "ee5e1529-7b92-4b03-ad24-74ee0206cb76", + "Date": "Fri, 27 Jun 2025 17:33:22 GMT", + "request-id": "30b50cdf-3503-4b4d-af29-b599aad94598", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "42", + "x-envoy-upstream-service-time": "31", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", - "createdDateTime": "2024-12-02T04:24:25Z", - "lastUpdatedDateTime": "2024-12-02T04:24:25Z", - "expirationDateTime": "2024-12-09T04:24:25Z", + "jobId": "f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000", + "createdDateTime": "2025-06-27T17:33:21Z", + "lastUpdatedDateTime": "2025-06-27T17:33:21Z", + "expirationDateTime": "2025-07-04T17:33:21Z", "status": "running" } }, { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/swap/jobs/f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -106,28 +106,28 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "7e9ddbc7-3781-4493-8872-cd0721a59003", + "apim-request-id": "6b01926e-c6c1-4ab4-af7f-63e43934bee3", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 02 Dec 2024 04:24:27 GMT", - "request-id": "7e9ddbc7-3781-4493-8872-cd0721a59003", + "Date": "Fri, 27 Jun 2025 17:33:24 GMT", + "request-id": "6b01926e-c6c1-4ab4-af7f-63e43934bee3", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "52", + "x-envoy-upstream-service-time": "40", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", - "createdDateTime": "2024-12-02T04:24:25Z", - "lastUpdatedDateTime": "2024-12-02T04:24:27Z", - "expirationDateTime": "2024-12-09T04:24:25Z", + "jobId": "f1bb65a1-37db-4d5b-9b3d-a64c9c6711c0_638865792000000000", + "createdDateTime": "2025-06-27T17:33:21Z", + "lastUpdatedDateTime": "2025-06-27T17:33:24Z", + "expirationDateTime": "2025-07-04T17:33:21Z", "status": "succeeded" } } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "429351611" + "RandomSeed": "296118751" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json index b0e19616154a..f28113157003 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json @@ -1,15 +1,14 @@ { "Entries": [ { - "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/:train?api-version=2024-11-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/:train?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Connection": "keep-alive", "Content-Length": "159", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250302.1 (.NET Framework 4.8.9290.0; Microsoft Windows 10.0.26100 )", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250627.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -25,22 +24,22 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "4c0b8e99-6774-473c-ac82-1cdae262aff3", + "apim-request-id": "65c83d79-a28d-4ed0-b006-644bb60fe511", "Content-Length": "0", - "Date": "Mon, 03 Mar 2025 06:54:06 GMT", - "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject001/train/jobs/0fbeef32-263a-46c6-a532-8f819d83c95c_638765568000000000?api-version=2024-11-15-preview", - "request-id": "4c0b8e99-6774-473c-ac82-1cdae262aff3", + "Date": "Fri, 27 Jun 2025 17:21:35 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/train/jobs/5d105f21-fb58-4d0c-8eab-f42e6a79684a_638865792000000000?api-version=2025-05-15-preview", + "request-id": "65c83d79-a28d-4ed0-b006-644bb60fe511", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "148", + "x-envoy-upstream-service-time": "181", "x-ms-region": "East US" }, "ResponseBody": null } ], "Variables": { - "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "66619128" + "RandomSeed": "1283118484" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 22cab6c88b6c..5b8051a59469 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -231,8 +231,8 @@ public async Task CancelTrainingJobAsync() public async Task GetModelEvaluationSummaryAsync() { // Arrange - string projectName = "test001"; - string trainedModelLabel = "m1"; + string projectName = "single-class-project"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Act @@ -308,8 +308,8 @@ public async Task GetModelEvaluationSummaryAsync() public async Task LoadSnapshotAsync() { // Arrange - string projectName = "test001"; - string trainedModelLabel = "m1"; // Replace with your actual model label. + string projectName = "single-class-project"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Act @@ -331,7 +331,7 @@ public async Task LoadSnapshotAsync() public async Task DeleteTrainedModelAsync() { // Arrange - string projectName = "MyTextProject"; + string projectName = "single-class-project"; string trainedModelLabel = "model1"; // Replace with the actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); @@ -350,101 +350,30 @@ public async Task DeleteTrainedModelAsync() public async Task DeployProjectAsync() { // Arrange - string projectName = "MyTextProject"; + string projectName = "single-class-project"; string deploymentName = "deployment1"; - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "m2"); + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "model1"); TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); // Act Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, + waitUntil: WaitUntil.Started, details: deploymentDetails ); // Assert Assert.IsNotNull(operation); - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + Assert.AreEqual(202, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); // Logging for additional context Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); } - [RecordedTest] - public async Task DeployProjectAsync_WithAssignedResources_ShouldReturnAcceptedStatus() - { - // Arrange - string projectName = "single-class-project"; - string deploymentName = "deploymentWithAssignedResource"; - - var requestBody = new - { - trainedModelLabel = "model1", - assignedResources = new[] - { - new - { - resourceId = "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-01", - region = "eastus", - assignedAoaiResource = new - { - kind = "AzureOpenAI", - resourceId = "/subscriptions/e54a2925-af7f-4b05-9ba1-2155c5fe8a8e/resourceGroups/gouri-eastus/providers/Microsoft.CognitiveServices/accounts/sdk-test-openai", - deploymentName = "gpt-4o" - } - } - } - }; - - string json = JsonSerializer.Serialize(requestBody); - Console.WriteLine(json); - var requestContent = RequestContent.Create(BinaryData.FromString(json)); - - // Use the REST client directly (or if the SDK has an overload for raw JSON): - var response = await client.GetDeployment(projectName, deploymentName) - .DeployProjectAsync(WaitUntil.Completed, requestContent); - - Console.WriteLine($"Response status: {response.GetRawResponse().Status}"); - //var deploymentDetails = new TextAuthoringCreateDeploymentDetails( - // trainedModelLabel: "model1"); - - ////Directly add to the AssignedResources collection - //deploymentDetails.AssignedResources.Add(new TextAuthoringDeploymentResource( - // resourceId: "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-01", - // region: "eastus") - //{ - // AssignedAoaiResource = new DataGenerationConnectionInfo( - // resourceId: "/subscriptions/e54a2925-af7f-4b05-9ba1-2155c5fe8a8e/resourceGroups/gouri-eastus/providers/Microsoft.CognitiveServices/accounts/sdk-test-openai", - // deploymentName: "gpt-4o") - //}); - - //string jsonPayload = JsonSerializer.Serialize(deploymentDetails, new JsonSerializerOptions { WriteIndented = true }); - //Console.WriteLine(jsonPayload); - - //var deploymentClient = client.GetDeployment(projectName, deploymentName); - - //// Act - //Operation operation = await deploymentClient.DeployProjectAsync( - // waitUntil: WaitUntil.Completed, - // details: deploymentDetails - //); - - //// Assert - //Assert.IsNotNull(operation); - //Assert.AreEqual(202, operation.GetRawResponse().Status, "Expected 202 Accepted status code for deployment initiation."); - - //string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out string location) - // ? location - // : null; - - //Assert.IsNotNull(operationLocation, "operation-location header is missing."); - //Console.WriteLine($"Deployment initiated. Operation-Location: {operationLocation}"); - } - [RecordedTest] public async Task SwapDeploymentsAsync() { // Arrange - string projectName = "MyTextProject"; + string projectName = "single-class-project"; var swapDetails = new TextAuthoringSwapDeploymentsDetails( firstDeploymentName: "deployment1", secondDeploymentName: "deployment2" @@ -469,8 +398,8 @@ public async Task SwapDeploymentsAsync() public async Task DeleteDeploymentAsync() { // Arrange - string projectName = "MyTextProject"; - string deploymentName = "deployment2"; + string projectName = "single-class-project"; + string deploymentName = "singleclassdeployment"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); // Act From ba2d1c975eac987f31112f309ce38677f99e0c04 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 17:39:53 -0700 Subject: [PATCH 07/47] add tests and records for some legacy features. and add sample templates for legacy features --- ...=> Sample10_TextAuthoring_LoadSnapshot.md} | 2 +- ...mple10_TextAuthoring_LoadSnapshotAsync.md} | 2 +- ...ple11_TextAuthoring_DeleteTrainedModel.md} | 2 +- ..._TextAuthoring_DeleteTrainedModelAsync.md} | 2 +- ...Sample12_TextAuthoring_SwapDeployments.md} | 2 +- ...e12_TextAuthoring_SwapDeploymentsAsync.md} | 2 +- ...ample13_TextAuthoring_DeleteDeployment.md} | 2 +- ...13_TextAuthoring_DeleteDeploymentAsync.md} | 2 +- ...> Sample14_TextAuthoring_DeployProject.md} | 2 +- ...ple14_TextAuthoring_DeployProjectAsync.md} | 2 +- .../Sample15_TextAuthoring_GetDeployment.md | 35 ++ ...mple15_TextAuthoring_GetDeploymentAsync.md | 35 ++ ...TextAuthoring_AssignDeploymentResources.md | 35 ++ ...uthoring_AssignDeploymentResourcesAsync.md | 35 ++ ...ring_GetAssignDeploymentResourcesStatus.md | 35 ++ ...GetAssignDeploymentResourcesStatusAsync.md | 35 ++ ...xtAuthoring_UnassignDeploymentResources.md | 35 ++ ...horing_UnassignDeploymentResourcesAsync.md | 35 ++ ...ng_GetUnassignDeploymentResourcesStatus.md | 35 ++ ...tUnassignDeploymentResourcesStatusAsync.md | 35 ++ ...=> Sample1_TextAuthoring_CreateProject.md} | 2 +- ...mple1_TextAuthoring_CreateProjectAsync.md} | 2 +- ...md => Sample4_TextAuthoring_GetProject.md} | 2 +- ... Sample4_TextAuthoring_GetProjectAsync.md} | 2 +- ...=> Sample5_TextAuthoring_DeleteProject.md} | 2 +- ...mple5_TextAuthoring_DeleteProjectAsync.md} | 2 +- ...rain.md => Sample6_TextAuthoring_Train.md} | 2 +- ...md => Sample6_TextAuthoring_TrainAsync.md} | 2 +- ...ample7_TextAuthoring_CancelTrainingJob.md} | 2 +- ...7_TextAuthoring_CancelTrainingJobAsync.md} | 2 +- ...extAuthoring_GetModelEvaluationSummary.md} | 2 +- ...thoring_GetModelEvaluationSummaryAsync.md} | 2 +- ...=> Sample10_TextAuthoring_LoadSnapshot.cs} | 4 +- ...mple10_TextAuthoring_LoadSnapshotAsync.cs} | 4 +- ...ple11_TextAuthoring_DeleteTrainedModel.cs} | 4 +- ..._TextAuthoring_DeleteTrainedModelAsync.cs} | 4 +- ...Sample12_TextAuthoring_SwapDeployments.cs} | 4 +- ...e12_TextAuthoring_SwapDeploymentsAsync.cs} | 4 +- ...ample13_TextAuthoring_DeleteDeployment.cs} | 4 +- ...13_TextAuthoring_DeleteDeploymentAsync.cs} | 4 +- ...> Sample14_TextAuthoring_DeployProject.cs} | 4 +- ...ple14_TextAuthoring_DeployProjectAsync.cs} | 4 +- .../Sample15_TextAuthoring_GetDeployment.cs | 42 ++ ...mple15_TextAuthoring_GetDeploymentAsync.cs | 43 ++ ...TextAuthoring_AssignDeploymentResources.cs | 42 ++ ...uthoring_AssignDeploymentResourcesAsync.cs | 43 ++ ...ring_GetAssignDeploymentResourcesStatus.cs | 42 ++ ...GetAssignDeploymentResourcesStatusAsync.cs | 43 ++ ...xtAuthoring_UnassignDeploymentResources.cs | 42 ++ ...horing_UnassignDeploymentResourcesAsync.cs | 43 ++ ...ng_GetUnassignDeploymentResourcesStatus.cs | 42 ++ ...tUnassignDeploymentResourcesStatusAsync.cs | 43 ++ ...=> Sample1_TextAuthoring_CreateProject.cs} | 4 +- ...mple1_TextAuthoring_CreateProjectAsync.cs} | 4 +- .../Samples/Sample3_TextAuthoring_Export.cs | 151 +++++++ .../Sample3_TextAuthoring_ExportAsync.cs | 149 +++++++ ...cs => Sample4_TextAuthoring_GetProject.cs} | 4 +- ... Sample4_TextAuthoring_GetProjectAsync.cs} | 4 +- ...=> Sample5_TextAuthoring_DeleteProject.cs} | 4 +- ...mple5_TextAuthoring_DeleteProjectAsync.cs} | 4 +- ...rain.cs => Sample6_TextAuthoring_Train.cs} | 2 +- ...cs => Sample6_TextAuthoring_TrainAsync.cs} | 2 +- ...ample7_TextAuthoring_CancelTrainingJob.cs} | 4 +- ...7_TextAuthoring_CancelTrainingJobAsync.cs} | 4 +- ...extAuthoring_GetModelEvaluationSummary.cs} | 4 +- ...thoring_GetModelEvaluationSummaryAsync.cs} | 4 +- ...TextAuthoring_GetModelEvaluationResults.cs | 91 ++++ ...uthoring_GetModelEvaluationResultsAsync.cs | 91 ++++ .../ExportProjectAsync.json | 130 ++++++ .../ExportProjectAsyncAsync.json | 99 +++++ .../GetDeploymentAsync.json | 42 ++ .../GetDeploymentAsyncAsync.json | 42 ++ .../GetModelEvaluationResultsAsync.json | 417 ++++++++++++++++++ .../GetModelEvaluationResultsAsyncAsync.json | 417 ++++++++++++++++++ .../tests/TextAuthoringClientLiveTest.cs | 92 ++++ 75 files changed, 2560 insertions(+), 64 deletions(-) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample8_TextAuthoring_LoadSnapshot.md => Sample10_TextAuthoring_LoadSnapshot.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample8_TextAuthoring_LoadSnapshotAsync.md => Sample10_TextAuthoring_LoadSnapshotAsync.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample9_TextAuthoring_DeleteTrainedModel.md => Sample11_TextAuthoring_DeleteTrainedModel.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample9_TextAuthoring_DeleteTrainedModelAsync.md => Sample11_TextAuthoring_DeleteTrainedModelAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample11_TextAuthoring_SwapDeployments.md => Sample12_TextAuthoring_SwapDeployments.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample11_TextAuthoring_SwapDeploymentsAsync.md => Sample12_TextAuthoring_SwapDeploymentsAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample12_TextAuthoring_DeleteDeployment.md => Sample13_TextAuthoring_DeleteDeployment.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample12_TextAuthoring_DeleteDeploymentAsync.md => Sample13_TextAuthoring_DeleteDeploymentAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample10_TextAuthoring_DeployProject.md => Sample14_TextAuthoring_DeployProject.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample10_TextAuthoring_DeployProjectAsync.md => Sample14_TextAuthoring_DeployProjectAsync.md} (96%) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample3_TextAuthoring_CreateProject.md => Sample1_TextAuthoring_CreateProject.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample3_TextAuthoring_CreateProjectAsync.md => Sample1_TextAuthoring_CreateProjectAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample1_TextAuthoring_GetProject.md => Sample4_TextAuthoring_GetProject.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample1_TextAuthoring_GetProjectAsync.md => Sample4_TextAuthoring_GetProjectAsync.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample4_TextAuthoring_DeleteProject.md => Sample5_TextAuthoring_DeleteProject.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample4_TextAuthoring_DeleteProjectAsync.md => Sample5_TextAuthoring_DeleteProjectAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample5_TextAuthoring_Train.md => Sample6_TextAuthoring_Train.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample5_TextAuthoring_TrainAsync.md => Sample6_TextAuthoring_TrainAsync.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample6_TextAuthoring_CancelTrainingJob.md => Sample7_TextAuthoring_CancelTrainingJob.md} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample6_TextAuthoring_CancelTrainingJobAsync.md => Sample7_TextAuthoring_CancelTrainingJobAsync.md} (96%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample7_TextAuthoring_GetModelEvaluationSummary.md => Sample8_TextAuthoring_GetModelEvaluationSummary.md} (98%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/{Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md => Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md} (98%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample8_TextAuthoring_LoadSnapshot.cs => Sample10_TextAuthoring_LoadSnapshot.cs} (90%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample8_TextAuthoring_LoadSnapshotAsync.cs => Sample10_TextAuthoring_LoadSnapshotAsync.cs} (89%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample9_TextAuthoring_DeleteTrainedModel.cs => Sample11_TextAuthoring_DeleteTrainedModel.cs} (87%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample9_TextAuthoring_DeleteTrainedModelAsync.cs => Sample11_TextAuthoring_DeleteTrainedModelAsync.cs} (87%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample11_TextAuthoring_SwapDeployments.cs => Sample12_TextAuthoring_SwapDeployments.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample11_TextAuthoring_SwapDeploymentsAsync.cs => Sample12_TextAuthoring_SwapDeploymentsAsync.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample12_TextAuthoring_DeleteDeployment.cs => Sample13_TextAuthoring_DeleteDeployment.cs} (91%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample12_TextAuthoring_DeleteDeploymentAsync.cs => Sample13_TextAuthoring_DeleteDeploymentAsync.cs} (91%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample10_TextAuthoring_DeployProject.cs => Sample14_TextAuthoring_DeployProject.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample10_TextAuthoring_DeployProjectAsync.cs => Sample14_TextAuthoring_DeployProjectAsync.cs} (92%) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample3_TextAuthoring_CreateProject.cs => Sample1_TextAuthoring_CreateProject.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample3_TextAuthoring_CreateProjectAsync.cs => Sample1_TextAuthoring_CreateProjectAsync.cs} (92%) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample1_TextAuthoring_GetProject.cs => Sample4_TextAuthoring_GetProject.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample1_TextAuthoring_GetProjectAsync.cs => Sample4_TextAuthoring_GetProjectAsync.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample4_TextAuthoring_DeleteProject.cs => Sample5_TextAuthoring_DeleteProject.cs} (91%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample4_TextAuthoring_DeleteProjectAsync.cs => Sample5_TextAuthoring_DeleteProjectAsync.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample5_TextAuthoring_Train.cs => Sample6_TextAuthoring_Train.cs} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample5_TextAuthoring_TrainAsync.cs => Sample6_TextAuthoring_TrainAsync.cs} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample6_TextAuthoring_CancelTrainingJob.cs => Sample7_TextAuthoring_CancelTrainingJob.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample6_TextAuthoring_CancelTrainingJobAsync.cs => Sample7_TextAuthoring_CancelTrainingJobAsync.cs} (92%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample7_TextAuthoring_GetModelEvaluationSummary.cs => Sample8_TextAuthoring_GetModelEvaluationSummary.cs} (97%) rename sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/{Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs => Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs} (97%) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsyncAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsyncAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index 59585ad47705..e01b944f1f60 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshot on the TextAnalysisAuthoring client. -```C# Snippet:Sample8_TextAuthoring_LoadSnapshot +```C# Snippet:Sample10_TextAuthoring_LoadSnapshot string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index a28168e397e0..8385d0c23cc0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample8_TextAuthoring_LoadSnapshotAsync +```C# Snippet:Sample10_TextAuthoring_LoadSnapshotAsync string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 7e3ac0c1cdc7..5794f16bb7fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModel on the TextAnalysisAuthoring client. -```C# Snippet:Sample9_TextAuthoring_DeleteTrainedModel +```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModel string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index fc6085a23141..b23ab9c7f465 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample9_TextAuthoring_DeleteTrainedModelAsync +```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 67c89bf79509..13b642b5b362 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. -```C# Snippet:Sample11_TextAuthoring_SwapDeployments +```C# Snippet:Sample12_TextAuthoring_SwapDeployments string projectName = "LoanAgreements"; string firstDeploymentName = "DeploymentA"; string secondDeploymentName = "DeploymentB"; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index 10960bb2af52..30270d4d2361 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample11_TextAuthoring_SwapDeploymentsAsync +```C# Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync string projectName = "LoanAgreements"; string firstDeploymentName = "DeploymentA"; string secondDeploymentName = "DeploymentB"; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index a04cc9516f25..3a32fe5f7085 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeployment on the TextAnalysisAuthoring client. -```C# Snippet:Sample12_TextAuthoring_DeleteDeployment +```C# Snippet:Sample13_TextAuthoring_DeleteDeployment string projectName = "LoanAgreements"; string deploymentName = "DeploymentA"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index 0115f48cf9c1..60b0f2742ed4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample12_TextAuthoring_DeleteDeploymentAsync +```C# Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync string projectName = "LoanAgreements"; string deploymentName = "DeploymentA"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index 2ce69d67d3d9..677cb70f8f13 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. -```C# Snippet:Sample10_TextAuthoring_DeployProject +```C# Snippet:Sample14_TextAuthoring_DeployProject string projectName = "LoanAgreements"; string deploymentName = "DeploymentName"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index accbcf8e2668..8ffdc58bd13d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample10_TextAuthoring_DeployProjectAsync +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync string projectName = "LoanAgreements"; string deploymentName = "DeploymentName"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md new file mode 100644 index 000000000000..677cb70f8f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -0,0 +1,35 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md new file mode 100644 index 000000000000..8ffdc58bd13d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -0,0 +1,35 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md new file mode 100644 index 000000000000..677cb70f8f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -0,0 +1,35 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md new file mode 100644 index 000000000000..8ffdc58bd13d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -0,0 +1,35 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md new file mode 100644 index 000000000000..677cb70f8f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -0,0 +1,35 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md new file mode 100644 index 000000000000..8ffdc58bd13d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -0,0 +1,35 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md new file mode 100644 index 000000000000..677cb70f8f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -0,0 +1,35 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md new file mode 100644 index 000000000000..8ffdc58bd13d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -0,0 +1,35 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md new file mode 100644 index 000000000000..677cb70f8f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -0,0 +1,35 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md new file mode 100644 index 000000000000..8ffdc58bd13d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -0,0 +1,35 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index 5edb6ede98f5..7ee38c7d0951 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -19,7 +19,7 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To create a new project, call CreateProject on the TextAnalysisAuthoring client. -```C# Snippet:Sample3_TextAuthoring_CreateProject +```C# Snippet:Sample1_TextAuthoring_CreateProject string projectName = "MyNewProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index 87298f83c896..ce7c961711da 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample3_TextAuthoring_CreateProjectAsync +```C# Snippet:Sample1_TextAuthoring_CreateProjectAsync string projectName = "MyNewProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index d78575d26494..be41015b893b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -16,7 +16,7 @@ The values of the endpoint and apiKey variables can be retrieved from environmen ## Retrieve Project Metadata Synchronously To retrieve metadata of a project, call GetProject on the TextAnalysisAuthoring client. -```C# Snippet:Sample1_TextAuthoring_GetProject +```C# Snippet:Sample4_TextAuthoring_GetProject string projectName = "MyTextProject"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index 28fee21e9d29..2ca3c32e61f2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -19,7 +19,7 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample1_TextAuthoring_GetProjectAsync +```C# Snippet:Sample4_TextAuthoring_GetProjectAsync string projectName = "MyTextProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index 9b3b7f8e2415..c57fa75fec65 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProject on the TextAnalysisAuthoring client. -```C# Snippet:Sample4_TextAuthoring_DeleteProject +```C# Snippet:Sample5_TextAuthoring_DeleteProject string projectName = "ProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index 464c280ac964..0a640d8ef980 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample4_TextAuthoring_DeleteProjectAsync +```C# Snippet:Sample5_TextAuthoring_DeleteProjectAsync string projectName = "ProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index 65b8300bd573..3e6ea0aaee5d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call Train on the TextAnalysisAuthoring client. -```C# Snippet:Sample5_TextAuthoring_Train +```C# Snippet:Sample6_TextAuthoring_Train string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index 258baad96c78..5cc8d13f0d71 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call TrainAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample5_TextAuthoring_TrainAsync +```C# Snippet:Sample6_TextAuthoring_TrainAsync string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index eb205d13f386..c66e798bcc2c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring client. -```C# Snippet:Sample6_TextAuthoring_CancelTrainingJob +```C# Snippet:Sample7_TextAuthoring_CancelTrainingJob string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md similarity index 96% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index c3b8b9c01429..57b59a2c87de 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample6_TextAuthoring_CancelTrainingJobAsync +```C# Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md similarity index 98% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index 1e13b3bfe35d..dd8f6e5a5337 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummary on the TextAnalysisAuthoring client. -```C# Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummary +```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary string projectName = "LoanAgreements"; string trainedModelLabel = "model2"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md similarity index 98% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index c58cacd6ab5a..c35d8cf8a755 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. -```C# Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync +```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync string projectName = "LoanAgreements"; string trainedModelLabel = "model2"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs similarity index 90% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs index 9c1315bf135c..0c68769b41cc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample8_TextAuthoring_LoadSnapshot : SamplesBase + public partial class Sample10_TextAuthoring_LoadSnapshot : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void LoadSnapshot() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample8_TextAuthoring_LoadSnapshot + #region Snippet:Sample10_TextAuthoring_LoadSnapshot string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs similarity index 89% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs index 482ec4dfbbf6..936548bd4069 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample8_TextAuthoring_LoadSnapshotAsync : SamplesBase + public partial class Sample10_TextAuthoring_LoadSnapshotAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task LoadSnapshotAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample8_TextAuthoring_LoadSnapshotAsync + #region Snippet:Sample10_TextAuthoring_LoadSnapshotAsync string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs similarity index 87% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs index 2ec41874b841..8e52f813cf71 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample9_TextAuthoring_DeleteTrainedModel : SamplesBase + public partial class Sample11_TextAuthoring_DeleteTrainedModel : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void DeleteTrainedModel() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample9_TextAuthoring_DeleteTrainedModel + #region Snippet:Sample11_TextAuthoring_DeleteTrainedModel string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs similarity index 87% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs index 3aa0f4f52e70..49a98bb71da4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample9_TextAuthoring_DeleteTrainedModelAsync : SamplesBase + public partial class Sample11_TextAuthoring_DeleteTrainedModelAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task DeleteTrainedModelAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample9_TextAuthoring_DeleteTrainedModelAsync + #region Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync string projectName = "LoanAgreements"; string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index 8f80694b6000..c1de42f371d9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample11_TextAuthoring_SwapDeployments : SamplesBase + public partial class Sample12_TextAuthoring_SwapDeployments : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void SwapDeployments() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample11_TextAuthoring_SwapDeployments + #region Snippet:Sample12_TextAuthoring_SwapDeployments string projectName = "LoanAgreements"; string firstDeploymentName = "DeploymentA"; string secondDeploymentName = "DeploymentB"; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs index a54f8f9270a9..0ea6c56f88fd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample11_TextAuthoring_SwapDeploymentsAsync : SamplesBase + public partial class Sample12_TextAuthoring_SwapDeploymentsAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task SwapDeploymentsAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample11_TextAuthoring_SwapDeploymentsAsync + #region Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync string projectName = "LoanAgreements"; string firstDeploymentName = "DeploymentA"; string secondDeploymentName = "DeploymentB"; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs similarity index 91% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs index 74c3e3c72635..81c54a4fd2fb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample12_TextAuthoring_DeleteDeployment : SamplesBase + public partial class Sample13_TextAuthoring_DeleteDeployment : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void DeleteDeployment() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample12_TextAuthoring_DeleteDeployment + #region Snippet:Sample13_TextAuthoring_DeleteDeployment string projectName = "LoanAgreements"; string deploymentName = "DeploymentA"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs similarity index 91% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs index 2da12ce0e423..bb8bbf5418b9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample12_TextAuthoring_DeleteDeploymentAsync : SamplesBase + public partial class Sample13_TextAuthoring_DeleteDeploymentAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task DeleteDeploymentAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample12_TextAuthoring_DeleteDeploymentAsync + #region Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync string projectName = "LoanAgreements"; string deploymentName = "DeploymentA"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs index ebc7b9c36cad..bca231cecc9c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample10_TextAuthoring_DeployProject : SamplesBase + public partial class Sample14_TextAuthoring_DeployProject : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void DeployProject() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample10_TextAuthoring_DeployProject + #region Snippet:Sample14_TextAuthoring_DeployProject string projectName = "LoanAgreements"; string deploymentName = "DeploymentName"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs index 199255286e0e..523fa98a1cb7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample10_TextAuthoring_DeployProjectAsync : SamplesBase + public partial class Sample14_TextAuthoring_DeployProjectAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task DeployProjectAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample10_TextAuthoring_DeployProjectAsync + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync string projectName = "LoanAgreements"; string deploymentName = "DeploymentName"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs new file mode 100644 index 000000000000..a8fc19e43a8d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample15_TextAuthoring_GetDeployment : SamplesBase + { + [Test] + [SyncOnly] + public void GetDeployment() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs new file mode 100644 index 000000000000..eda51b4f751b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample15_TextAuthoring_GetDeploymentAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs new file mode 100644 index 000000000000..d17c035625f9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample16_TextAuthoring_AssignDeploymentResources : SamplesBase + { + [Test] + [SyncOnly] + public void DeployProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs new file mode 100644 index 000000000000..efe09f0bb991 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample16_TextAuthoring_AssignDeploymentResourcesAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs new file mode 100644 index 000000000000..be41dc2c5097 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus : SamplesBase + { + [Test] + [SyncOnly] + public void DeployProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs new file mode 100644 index 000000000000..aa1c86b03d7a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs new file mode 100644 index 000000000000..41e103655814 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample18_TextAuthoring_UnassignDeploymentResources : SamplesBase + { + [Test] + [SyncOnly] + public void DeployProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs new file mode 100644 index 000000000000..80500a38fe56 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample18_TextAuthoring_UnassignDeploymentResourcesAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs new file mode 100644 index 000000000000..43655e9c01a5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus : SamplesBase + { + [Test] + [SyncOnly] + public void DeployProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = deploymentClient.DeployProject( + waitUntil: WaitUntil.Completed, + details: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs new file mode 100644 index 000000000000..2e65990b9655 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index fecc2e5a3f56..6ff1f58726af 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample3_TextAuthoring_CreateProject : SamplesBase + public partial class Sample1_TextAuthoring_CreateProject : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void CreateProject() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample3_TextAuthoring_CreateProject + #region Snippet:Sample1_TextAuthoring_CreateProject string projectName = "MyNewProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs index 8412bf79e94d..980ff3362d7b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample3_TextAuthoring_CreateProjectAsync : SamplesBase + public partial class Sample1_TextAuthoring_CreateProjectAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task CreateProjectAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample3_TextAuthoring_CreateProjectAsync + #region Snippet:Sample1_TextAuthoring_CreateProjectAsync string projectName = "MyNewProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs new file mode 100644 index 000000000000..463462d749bf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Reflection.Emit; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample3_TextAuthoring_Export : SamplesBase + { + [Test] + [SyncOnly] + public void Import() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_Import + string projectName = "LoanAgreements"; + TextAuthoringProject projectClient = client.GetProject(projectName); + var projectMetadata = new TextAuthoringCreateProjectDetails( + projectKind: "CustomSingleLabelClassification", + storageInputContainerName: "test-data", + language: "en" + ) + { + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new TextAuthoringProjectSettings() + }; + + var projectAssets = new ExportedCustomEntityRecognitionProjectAsset + { + Entities = + { + new TextAuthoringExportedEntity + { + Category = "Date" + }, + new TextAuthoringExportedEntity + { + Category = "LenderName" + }, + new TextAuthoringExportedEntity + { + Category = "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } + }; + + var exportedProject = new TextAuthoringExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata + ) + { + Assets = projectAssets + }; + + Operation operation = projectClient.Import( + waitUntil: WaitUntil.Completed, + body: exportedProject + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs new file mode 100644 index 000000000000..40b588a6924c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample3_TextAuthoring_ExportAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task ImportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_ImportAsync + string projectName = "LoanAgreements"; + TextAuthoringProject projectClient = client.GetProject(projectName); + var projectMetadata = new TextAuthoringCreateProjectDetails( + projectKind: "CustomEntityRecognition", + storageInputContainerName: "loanagreements", + language: "en" + ) + { + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false + }; + + var projectAssets = new ExportedCustomEntityRecognitionProjectAsset + { + Entities = + { + new TextAuthoringExportedEntity + { + Category= "Date" + }, + new TextAuthoringExportedEntity + { + Category= "LenderName" + }, + new TextAuthoringExportedEntity + { + Category= "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } + }; + + var exportedProject = new TextAuthoringExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) + { + Assets = projectAssets + }; + + Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Completed, + body: exportedProject + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs index 59e5e719eba0..896a23ac2a79 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample1_TextAuthoring_GetProject : SamplesBase + public partial class Sample4_TextAuthoring_GetProject : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void GetProject() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample1_TextAuthoring_GetProject + #region Snippet:Sample4_TextAuthoring_GetProject string projectName = "MyTextProject"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs index 95361e43b68b..12cf8f88a132 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample1_TextAuthoring_GetProjectAsync : SamplesBase + public partial class Sample4_TextAuthoring_GetProjectAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task GetProjectAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample1_TextAuthoring_GetProjectAsync + #region Snippet:Sample4_TextAuthoring_GetProjectAsync string projectName = "MyTextProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs similarity index 91% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs index 7dc3b4f80352..c6b60a76460a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample4_TextAuthoring_DeleteProject : SamplesBase + public partial class Sample5_TextAuthoring_DeleteProject : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void DeleteProject() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample4_TextAuthoring_DeleteProject + #region Snippet:Sample5_TextAuthoring_DeleteProject string projectName = "ProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs index 52ab4c0e415c..1c19620af4d6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample4_TextAuthoring_DeleteProjectAsync : SamplesBase + public partial class Sample5_TextAuthoring_DeleteProjectAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task DeleteProjectAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample4_TextAuthoring_DeleteProjectAsync + #region Snippet:Sample5_TextAuthoring_DeleteProjectAsync string projectName = "ProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs index 93990fd4a27b..795645f5977c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs @@ -21,7 +21,7 @@ public void Train() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample5_TextAuthoring_Train + #region Snippet:Sample6_TextAuthoring_Train string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs index 2f7ef0a65a00..a02e3f1cefe0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs @@ -22,7 +22,7 @@ public async Task TrainAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample5_TextAuthoring_TrainAsync + #region Snippet:Sample6_TextAuthoring_TrainAsync string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index 52f1cc9d5810..cb1b030e492e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample6_TextAuthoring_CancelTrainingJob : SamplesBase + public partial class Sample7_TextAuthoring_CancelTrainingJob : SamplesBase { [Test] [SyncOnly] @@ -21,7 +21,7 @@ public void CancelTrainingJob() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample6_TextAuthoring_CancelTrainingJob + #region Snippet:Sample7_TextAuthoring_CancelTrainingJob string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs similarity index 92% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs index c89ca8389752..db3be2152dcf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample6_TextAuthoring_CancelTrainingJobAsync : SamplesBase + public partial class Sample7_TextAuthoring_CancelTrainingJobAsync : SamplesBase { [Test] [AsyncOnly] @@ -22,7 +22,7 @@ public async Task CancelTrainingJobAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample6_TextAuthoring_CancelTrainingJobAsync + #region Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync string projectName = "LoanAgreements"; TextAuthoringProject projectClient = client.GetProject(projectName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs index e23c48db0a60..ce6a225996a5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample7_TextAuthoring_GetModelEvaluationSummary : SamplesBase + public partial class Sample8_TextAuthoring_GetModelEvaluationSummary : SamplesBase { [Test] [SyncOnly] @@ -20,7 +20,7 @@ public void GetModelEvaluationSummary() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummary + #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary string projectName = "LoanAgreements"; string trainedModelLabel = "model2"; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs similarity index 97% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs index e09832c8f8e3..cbad309b8063 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample7_TextAuthoring_GetModelEvaluationSummaryAsync : SamplesBase + public partial class Sample8_TextAuthoring_GetModelEvaluationSummaryAsync : SamplesBase { [Test] [AsyncOnly] @@ -21,7 +21,7 @@ public async Task GetModelEvaluationSummaryAsync() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync + #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync string projectName = "LoanAgreements"; string trainedModelLabel = "model2"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs new file mode 100644 index 000000000000..e6d2d4a13472 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core.Serialization; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample9_TextAuthoring_GetModelEvaluationResults : SamplesBase + { + [Test] + [SyncOnly] + public void GetModelEvaluationSummary() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary + + string projectName = "LoanAgreements"; + string trainedModelLabel = "model2"; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + // Get the evaluation summary for the trained model + Response evaluationSummaryResponse = trainedModelClient.GetModelEvaluationSummary(); + + TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Cast to the specific evaluation summary type for custom single label classification + if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) + { + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) + { + Console.WriteLine($"Row: {row.Key}"); + foreach (var col in row.Value.AdditionalProperties) + { + try + { + // Deserialize BinaryData properly + var cell = col.Value.ToObject(new JsonObjectSerializer()); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); + } + catch (Exception ex) + { + Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); + } + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs new file mode 100644 index 000000000000..dd3816ef146d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; +using System.Text.Json; +using Azure.Core.Serialization; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample9_TextAuthoring_GetModelEvaluationResultsAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetModelEvaluationSummaryAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync + string projectName = "LoanAgreements"; + string trainedModelLabel = "model2"; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + // Get the evaluation summary for the trained model + Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); + + TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Cast to the specific evaluation summary type for custom single label classification + if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) + { + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) + { + Console.WriteLine($"Row: {row.Key}"); + foreach (var col in row.Value.AdditionalProperties) + { + try + { + // Deserialize BinaryData properly + var cell = col.Value.ToObject(new JsonObjectSerializer()); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); + } + catch (Exception ex) + { + Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); + } + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsync.json new file mode 100644 index 000000000000..804b666f606e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsync.json @@ -0,0 +1,130 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/:export?stringIndexType=Utf16CodeUnit&api-version=2025-05-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8408beab-6fdc-4b1c-b0b8-a6ac329e2825", + "Content-Length": "0", + "Date": "Sun, 29 Jun 2025 00:34:28 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000?api-version=2025-05-15-preview", + "request-id": "8408beab-6fdc-4b1c-b0b8-a6ac329e2825", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "169", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "56925671-1e4f-45c1-83b0-eb3551f56186", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:34:28 GMT", + "request-id": "56925671-1e4f-45c1-83b0-eb3551f56186", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "43", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000", + "createdDateTime": "2025-06-29T00:34:28Z", + "lastUpdatedDateTime": "2025-06-29T00:34:29Z", + "expirationDateTime": "2025-07-06T00:34:28Z", + "status": "running" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5f87df2f-4d6e-4956-b421-4774ace773cc", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:34:29 GMT", + "request-id": "5f87df2f-4d6e-4956-b421-4774ace773cc", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "43", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000", + "createdDateTime": "2025-06-29T00:34:28Z", + "lastUpdatedDateTime": "2025-06-29T00:34:29Z", + "expirationDateTime": "2025-07-06T00:34:28Z", + "status": "running" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "42b30409-ccc0-4308-a3e3-a7c482b56564", + "Content-Length": "448", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:34:31 GMT", + "request-id": "42b30409-ccc0-4308-a3e3-a7c482b56564", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "resultUrl": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000/result?api-version=2025-05-15-preview", + "jobId": "540b5fcf-055f-4389-b917-6c9aebaf1cc0_638867520000000000", + "createdDateTime": "2025-06-29T00:34:28Z", + "lastUpdatedDateTime": "2025-06-29T00:34:31Z", + "expirationDateTime": "2025-07-06T00:34:28Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1482202997" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsyncAsync.json new file mode 100644 index 000000000000..c4d733feb350 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ExportProjectAsyncAsync.json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/:export?stringIndexType=Utf16CodeUnit&api-version=2025-05-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "85c2a418-bd4a-4529-9230-4dbb76cfa185", + "Content-Length": "0", + "Date": "Sun, 29 Jun 2025 00:34:31 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000?api-version=2025-05-15-preview", + "request-id": "85c2a418-bd4a-4529-9230-4dbb76cfa185", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "51", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "92cbb63c-3c1c-4b45-bbd4-c91a0c82477b", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:34:31 GMT", + "request-id": "92cbb63c-3c1c-4b45-bbd4-c91a0c82477b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "38", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000", + "createdDateTime": "2025-06-29T00:34:32Z", + "lastUpdatedDateTime": "2025-06-29T00:34:32Z", + "expirationDateTime": "2025-07-06T00:34:32Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2f2d6298-c3f7-4b1b-8f02-641c70782ceb", + "Content-Length": "448", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:34:33 GMT", + "request-id": "2f2d6298-c3f7-4b1b-8f02-641c70782ceb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "resultUrl": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/export/jobs/568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000/result?api-version=2025-05-15-preview", + "jobId": "568a829a-4c37-49e5-a8e6-52a6eb58dab9_638867520000000000", + "createdDateTime": "2025-06-29T00:34:32Z", + "lastUpdatedDateTime": "2025-06-29T00:34:32Z", + "expirationDateTime": "2025-07-06T00:34:32Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "302685925" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsync.json new file mode 100644 index 000000000000..7d8d7c7ff27c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsync.json @@ -0,0 +1,42 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4246e425-15ff-479f-b9c1-1778d2477b8f", + "Content-Length": "281", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:38:29 GMT", + "request-id": "4246e425-15ff-479f-b9c1-1778d2477b8f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "46", + "x-ms-region": "East US" + }, + "ResponseBody": { + "deploymentName": "deployment1", + "modelId": "model1-20250627T052846-829bed4c9fc94643941617052f9bc99e", + "lastTrainedDateTime": "2025-06-27T17:28:46.7961946Z", + "lastDeployedDateTime": "2025-06-27T17:29:54Z", + "deploymentExpirationDate": "2026-10-27", + "modelTrainingConfigVersion": "2022-05-01" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "370186168" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsyncAsync.json new file mode 100644 index 000000000000..2639be1de4bd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetDeploymentAsyncAsync.json @@ -0,0 +1,42 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/deployments/deployment1?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "63454254-3705-4e25-ae29-d3f090c331af", + "Content-Length": "281", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:38:29 GMT", + "request-id": "63454254-3705-4e25-ae29-d3f090c331af", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "38", + "x-ms-region": "East US" + }, + "ResponseBody": { + "deploymentName": "deployment1", + "modelId": "model1-20250627T052846-829bed4c9fc94643941617052f9bc99e", + "lastTrainedDateTime": "2025-06-27T17:28:46.7961946Z", + "lastDeployedDateTime": "2025-06-27T17:29:54Z", + "deploymentExpirationDate": "2026-10-27", + "modelTrainingConfigVersion": "2022-05-01" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "682672729" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json new file mode 100644 index 000000000000..840ccb5dcc9c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json @@ -0,0 +1,417 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/evaluation/result?stringIndexType=Utf16CodeUnit&api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f7890a97-de51-4150-b79f-1b5623130cf6", + "Content-Length": "8479", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:37:43 GMT", + "request-id": "f7890a97-de51-4150-b79f-1b5623130cf6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "110", + "x-ms-region": "East US" + }, + "ResponseBody": { + "value": [ + { + "location": "202.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "198.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "185.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "199.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "192.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "182.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "153.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "155.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "158.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "180.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "161.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "163.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "143.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "150.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "138.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "126.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "133.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "121.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "100.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "113.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "097.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "095.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "104.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "105.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "066.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "083.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Medical" + } + }, + { + "location": "074.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "086.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Biochemistry" + } + }, + { + "location": "075.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "087.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Biochemistry" + } + }, + { + "location": "051.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "056.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "043.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "034.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "050.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "053.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "025.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "015.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "012.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "002.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "029.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "019.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Civil_engineering" + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1561670891" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json new file mode 100644 index 000000000000..c7aff6750fe7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json @@ -0,0 +1,417 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/single-class-project/models/model1/evaluation/result?stringIndexType=Utf16CodeUnit&api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250628.1 (.NET 9.0.6; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5f2eb9a0-2d38-41c8-aa4b-678418484d96", + "Content-Length": "8479", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 29 Jun 2025 00:37:43 GMT", + "request-id": "5f2eb9a0-2d38-41c8-aa4b-678418484d96", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "81", + "x-ms-region": "East US" + }, + "ResponseBody": { + "value": [ + { + "location": "202.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "198.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "185.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "199.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "192.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "182.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Biochemistry", + "predictedClass": "Biochemistry" + } + }, + { + "location": "153.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "155.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "158.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "180.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "161.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "163.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Medical", + "predictedClass": "Medical" + } + }, + { + "location": "143.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "150.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "138.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "126.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "133.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "121.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Civil_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "100.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "113.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "097.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "095.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "104.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "105.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Mechanical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "066.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "083.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Medical" + } + }, + { + "location": "074.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "086.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Biochemistry" + } + }, + { + "location": "075.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Psychology" + } + }, + { + "location": "087.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Psychology", + "predictedClass": "Biochemistry" + } + }, + { + "location": "051.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "056.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "043.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "034.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "050.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Civil_engineering" + } + }, + { + "location": "053.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Electrical_engineering", + "predictedClass": "Electrical_engineering" + } + }, + { + "location": "025.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "015.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "012.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Mechanical_engineering" + } + }, + { + "location": "002.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "029.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Computer_science" + } + }, + { + "location": "019.txt", + "language": "en-us", + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationResult": { + "expectedClass": "Computer_science", + "predictedClass": "Civil_engineering" + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1405782415" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 5b8051a59469..7f53b3227b22 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -414,5 +414,97 @@ public async Task DeleteDeploymentAsync() // Logging for additional context Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); } + + [RecordedTest] + public async Task ExportProjectAsync() + { + // Arrange + string projectName = "single-class-project"; + + TextAuthoringProject projectAuthoringClient = client.GetProject(projectName); + + // Act + Operation operation = await projectAuthoringClient.ExportAsync( + waitUntil: WaitUntil.Completed, + stringIndexType: StringIndexType.Utf16CodeUnit); + + // Assert + Assert.IsNotNull(operation, "The export operation should not be null."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + + // Extract and check the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task GetModelEvaluationResultsAsync() + { + // Arrange + string projectName = "single-class-project"; + string trainedModelLabel = "model1"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + + TextAuthoringTrainedModel trainedModelAuthoringClient = client.GetTrainedModel(projectName, trainedModelLabel); + + // Act + AsyncPageable results = trainedModelAuthoringClient.GetModelEvaluationResultsAsync( + stringIndexType: stringIndexType + ); + + // Assert + Assert.IsNotNull(results, "The evaluation results should not be null."); + + await foreach (TextAuthoringDocumentEvalResult result in results) + { + // Validate base properties + Assert.IsNotNull(result, "The result should not be null."); + Assert.IsNotNull(result.Location, "The result location should not be null."); + Assert.IsNotNull(result.Language, "The result language should not be null."); + + // Validate classification result + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) + { + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + + Assert.IsNotNull(classification, "The classification result should not be null."); + Assert.IsFalse(string.IsNullOrWhiteSpace(classification.ExpectedClass), "The expected class should not be null or empty."); + Assert.IsFalse(string.IsNullOrWhiteSpace(classification.PredictedClass), "The predicted class should not be null or empty."); + } + else + { + Assert.Fail($"Unsupported result type: {result.GetType().Name}"); + } + } + } + + [RecordedTest] + public async Task GetDeploymentAsync() + { + // Arrange + string projectName = "single-class-project"; + string deploymentName = "deployment1"; + + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + // Act + Response response = await deploymentClient.GetDeploymentAsync(); + + // Assert + Assert.IsNotNull(response, "The response should not be null."); + Assert.AreEqual(200, response.GetRawResponse().Status, "Expected status to be 200 (OK)."); + + TextAuthoringProjectDeployment deployment = response.Value; + + Assert.IsNotNull(deployment, "Deployment details should not be null."); + Assert.IsNotNull(deployment.DeploymentName, "DeploymentName should not be null."); + Assert.IsNotNull(deployment.ModelId, "ModelId should not be null."); + Assert.IsNotNull(deployment.LastTrainedOn, "LastTrainedOn should not be null."); + Assert.IsNotNull(deployment.LastDeployedOn, "LastDeployedOn should not be null."); + Assert.IsNotNull(deployment.DeploymentExpiredOn, "DeploymentExpiredOn should not be null."); + Assert.IsNotNull(deployment.ModelTrainingConfigVersion, "ModelTrainingConfigVersion should not be null."); + } } } From af073fd137ddb805c6b3149aaceca9f64880bebb Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 19:23:05 -0700 Subject: [PATCH 08/47] add tests and samples for getDeployment, export and getModelEvalResult --- .../Sample15_TextAuthoring_GetDeployment.md | 30 ++--- ...mple15_TextAuthoring_GetDeploymentAsync.md | 14 +- .../samples/Sample3_TextAuthoring_Export.md | 30 +++++ .../Sample3_TextAuthoring_ExportAsync.md | 21 +++ ...TextAuthoring_GetModelEvaluationResults.md | 24 ++++ ...uthoring_GetModelEvaluationResultsAsync.md | 24 ++++ .../Sample15_TextAuthoring_GetDeployment.cs | 22 +-- ...mple15_TextAuthoring_GetDeploymentAsync.cs | 24 ++-- .../Samples/Sample3_TextAuthoring_Export.cs | 125 ++---------------- .../Sample3_TextAuthoring_ExportAsync.cs | 123 ++--------------- ...TextAuthoring_GetModelEvaluationResults.cs | 81 +++--------- ...uthoring_GetModelEvaluationResultsAsync.cs | 82 +++--------- 12 files changed, 199 insertions(+), 401 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index 677cb70f8f13..ac522d617f25 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -1,6 +1,6 @@ -# Deploying a Project Synchronously in Azure AI Language +# Retrieving Deployment Details Synchronously in Azure AI Language -This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve deployment details synchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,15 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Synchronously +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. -To deploy a project, call DeployProject on the TextAnalysisAuthoring client. +## Retrieve Deployment Details Synchronously -```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); - -Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails -); - -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +To retrieve deployment details, call `GetDeployment` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. + +```C# Snippet:Sample15_TextAuthoring_GetDeployment +string projectName = "MyTextProject"; string deploymentName = "MyDeployment"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +Response response = deploymentClient.GetDeployment(); +TextAuthoringProjectDeployment deployment = response.Value; +Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); Console.WriteLine($"Model Id: {deployment.ModelId}"); Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); ``` - -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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 8ffdc58bd13d..7f221a212381 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -1,6 +1,6 @@ -# Deploying a Project Asynchronously in Azure AI Language +# Retrieving Deployment Details Asynchronously in Azure AI Language -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve deployment details asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,11 +13,13 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Asynchronously +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. +## Retrieve Deployment Details Asynchronously -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. + +```C# Snippet:Sample15_TextAuthoring_GetDeploymentAsync string projectName = "LoanAgreements"; string deploymentName = "DeploymentName"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); @@ -31,5 +33,3 @@ Operation operation = await deploymentClient.DeployProjectAsync( Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); ``` - -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md new file mode 100644 index 000000000000..ea998262d7ec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -0,0 +1,30 @@ +# Exporting Project Data Synchronously in Azure AI Language + +This sample demonstrates how to export project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Export Project Data Synchronously +To export project data, call `Export` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. + +```C# Snippet:Sample3_TextAuthoring_Export +string projectName = "MyExportedTextProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); +Operation operation = projectClient.Export(waitUntil: WaitUntil.Completed, stringIndexType: StringIndexType.Utf16CodeUnit); +// Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); +Console.WriteLine("Export operation has finished successfully."); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md new file mode 100644 index 000000000000..a400acea6b7b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -0,0 +1,21 @@ +# Exporting Project Data Asynchronously in Azure AI Language + +This sample demonstrates how to export project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Export Project Data Asynchronously + +To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. + +```C# Snippet:Sample3_TextAuthoring_ExportAsync +string projectName = "MyExportedTextProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.ExportAsync(waitUntil: WaitUntil.Completed, stringIndexType: StringIndexType.Utf16CodeUnit); // Extract the operation-location header string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); Console.WriteLine("Export operation has finished successfully."); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md new file mode 100644 index 000000000000..53bfc7546f1b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -0,0 +1,24 @@ +# Retrieving Model Evaluation Results Synchronously in Azure AI Language + +This sample demonstrates how to retrieve model evaluation results synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Model Evaluation Results Synchronously + +To retrieve model evaluation results, call `GetModelEvaluationResults` on the `TextAuthoringTrainedModel` client. The method returns a `Pageable` that allows you to enumerate the evaluation results for each document. + +```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResults +string projectName = "MyTextProject"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); +Pageable results = trainedModelClient.GetModelEvaluationResults( stringIndexType: stringIndexType ); +foreach (TextAuthoringDocumentEvalResult result in results) { Console.WriteLine($"Document Location: {result.Location}"); Console.WriteLine($"Language: {result.Language}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md new file mode 100644 index 000000000000..4024db0e3557 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -0,0 +1,24 @@ +# Retrieving Model Evaluation Results Asynchronously in Azure AI Language + +This sample demonstrates how to retrieve model evaluation results asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +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. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Model Evaluation Results Asynchronously + +To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. + +```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync +string projectName = "MyTextProjectAsync"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); +AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( stringIndexType: stringIndexType ); +await foreach (TextAuthoringDocumentEvalResult result in results) { Console.WriteLine($"Document Location: {result.Location}"); Console.WriteLine($"Language: {result.Language}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs index a8fc19e43a8d..f731113f76df 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -21,22 +21,22 @@ public void GetDeployment() AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; + #region Snippet:Sample15_TextAuthoring_GetDeployment + string projectName = "MyTextProject"; + string deploymentName = "MyDeployment"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + Response response = deploymentClient.GetDeployment(); - Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails - ); + TextAuthoringProjectDeployment deployment = response.Value; - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); + Console.WriteLine($"Model Id: {deployment.ModelId}"); + Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); + Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); + Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); + Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs index eda51b4f751b..661c10dbfc04 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs @@ -16,28 +16,28 @@ public partial class Sample15_TextAuthoring_GetDeploymentAsync : SamplesBase response = await deploymentClient.GetDeploymentAsync(); - Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig - ); + TextAuthoringProjectDeployment deployment = response.Value; - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); + Console.WriteLine($"Model Id: {deployment.ModelId}"); + Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); + Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); + Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); + Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs index 463462d749bf..a8bb5db6fd66 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -16,135 +16,26 @@ public partial class Sample3_TextAuthoring_Export : SamplesBase evaluationSummaryResponse = trainedModelClient.GetModelEvaluationSummary(); + Pageable results = trainedModelClient.GetModelEvaluationResults( + stringIndexType: stringIndexType + ); - TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; - - // Cast to the specific evaluation summary type for custom single label classification - if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) + foreach (TextAuthoringDocumentEvalResult result in results) { - Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); - Console.WriteLine($"Evaluation Options: "); - Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); - Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); - Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); - - Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); - Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); - Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); - Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); - Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); - Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); - // Print confusion matrix - Console.WriteLine("Confusion Matrix:"); - foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) { - Console.WriteLine($"Row: {row.Key}"); - foreach (var col in row.Value.AdditionalProperties) - { - try - { - // Deserialize BinaryData properly - var cell = col.Value.ToObject(new JsonObjectSerializer()); - Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); - } - catch (Exception ex) - { - Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); - } - } + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); } - - // Print class-specific metrics - Console.WriteLine("Class-Specific Metrics:"); - foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) - { - Console.WriteLine($"Class: {kvp.Key}"); - Console.WriteLine($" F1: {kvp.Value.F1}"); - Console.WriteLine($" Precision: {kvp.Value.Precision}"); - Console.WriteLine($" Recall: {kvp.Value.Recall}"); - Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); - Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); - Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); - Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); - } - } - else - { - Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + // Add handling for other result types as needed } #endregion } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs index dd3816ef146d..092f4ea844e7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; -using System.Text.Json; -using Azure.Core.Serialization; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { @@ -15,75 +16,36 @@ public partial class Sample9_TextAuthoring_GetModelEvaluationResultsAsync : Samp { [Test] [AsyncOnly] - public async Task GetModelEvaluationSummaryAsync() + public async Task GetModelEvaluationResultsAsync() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync - string projectName = "LoanAgreements"; - string trainedModelLabel = "model2"; - TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync + string projectName = "MyTextProjectAsync"; + string trainedModelLabel = "model1"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; - // Get the evaluation summary for the trained model - Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; + AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( + stringIndexType: stringIndexType + ); - // Cast to the specific evaluation summary type for custom single label classification - if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) + await foreach (TextAuthoringDocumentEvalResult result in results) { - Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); - Console.WriteLine($"Evaluation Options: "); - Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); - Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); - Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); - - Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); - Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); - Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); - Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); - Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); - Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); - - // Print confusion matrix - Console.WriteLine("Confusion Matrix:"); - foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) - { - Console.WriteLine($"Row: {row.Key}"); - foreach (var col in row.Value.AdditionalProperties) - { - try - { - // Deserialize BinaryData properly - var cell = col.Value.ToObject(new JsonObjectSerializer()); - Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); - } - catch (Exception ex) - { - Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); - } - } - } + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); - // Print class-specific metrics - Console.WriteLine("Class-Specific Metrics:"); - foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) { - Console.WriteLine($"Class: {kvp.Key}"); - Console.WriteLine($" F1: {kvp.Value.F1}"); - Console.WriteLine($" Precision: {kvp.Value.Precision}"); - Console.WriteLine($" Recall: {kvp.Value.Recall}"); - Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); - Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); - Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); - Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); } - } - else - { - Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + // Add handling for other result types as needed } #endregion } From 8a6698ed005534a624f228ca3ce758c00c7655ec Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 21:33:01 -0700 Subject: [PATCH 09/47] add sample tests for assignDeploymentResource, getAssignStatus, unAssignDeploymentResource, getUnassignStatus --- ...TextAuthoring_AssignDeploymentResources.cs | 28 ++++++---- ...uthoring_AssignDeploymentResourcesAsync.cs | 28 ++++++---- ...ring_GetAssignDeploymentResourcesStatus.cs | 43 ++++++++++----- ...GetAssignDeploymentResourcesStatusAsync.cs | 48 ++++++++++++----- ...xtAuthoring_UnassignDeploymentResources.cs | 25 +++++---- ...horing_UnassignDeploymentResourcesAsync.cs | 25 +++++---- ...ng_GetUnassignDeploymentResourcesStatus.cs | 50 ++++++++++++++---- ...tUnassignDeploymentResourcesStatusAsync.cs | 52 ++++++++++++++----- .../tests/TextAuthoringClientLiveTest.cs | 8 +-- 9 files changed, 212 insertions(+), 95 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index d17c035625f9..18072427b341 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; @@ -15,28 +16,33 @@ public partial class Sample16_TextAuthoring_AssignDeploymentResources : SamplesB { [Test] [SyncOnly] - public void DeployProject() + public void AssignDeploymentResources() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample16_TextAuthoring_AssignDeploymentResources + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" + ); + + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } + ); - Operation operation = deploymentClient.DeployProject( + Operation operation = projectClient.AssignDeploymentResources( waitUntil: WaitUntil.Completed, - details: deploymentDetails + details: assignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs index efe09f0bb991..bbacb5b5d77c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Threading.Tasks; using Azure; using Azure.AI.Language.Text.Authoring; @@ -16,28 +17,33 @@ public partial class Sample16_TextAuthoring_AssignDeploymentResourcesAsync : Sam { [Test] [AsyncOnly] - public async Task DeployProjectAsync() + public async Task AssignDeploymentResourcesAsync() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" + ); + + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } + ); - Operation operation = await deploymentClient.DeployProjectAsync( + Operation operation = await projectClient.AssignDeploymentResourcesAsync( waitUntil: WaitUntil.Completed, - details: deploymentConfig + details: assignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index be41dc2c5097..e418472736bf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -2,6 +2,8 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; +using System.Linq; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; @@ -15,28 +17,45 @@ public partial class Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus : { [Test] [SyncOnly] - public void DeployProject() + public void GetAssignDeploymentResourcesStatus() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" + ); - Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); - #endregion + // Submit assignment operation + Operation assignOperation = projectClient.AssignDeploymentResources( + waitUntil: WaitUntil.Started, + details: assignDetails + ); + + string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + // Extract only the jobId part from the URL + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Job ID: {jobId}"); + + // Call status API + Response statusResponse = projectClient.GetAssignDeploymentResourcesStatus(jobId); + + Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); + #endregion } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs index aa1c86b03d7a..47df9a475e25 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs @@ -2,12 +2,15 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using Azure.Identity; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples @@ -16,28 +19,45 @@ public partial class Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAs { [Test] [AsyncOnly] - public async Task DeployProjectAsync() + public async Task GetAssignDeploymentResourcesStatusAsync() { Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + DefaultAzureCredential credential = new DefaultAzureCredential(); + var client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" + ); - Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); - #endregion + // Submit assignment operation + Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: assignDetails + ); + + string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + // Extract only the jobId part from the URL + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Job ID: {jobId}"); + + // Call status API + Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); + + Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); + #endregion } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs index 41e103655814..855f06f4d1b5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; @@ -15,28 +16,32 @@ public partial class Sample18_TextAuthoring_UnassignDeploymentResources : Sample { [Test] [SyncOnly] - public void DeployProject() + public void UnassignDeploymentResources() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResources + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } + ); - Operation operation = deploymentClient.DeployProject( + Operation operation = projectClient.UnassignDeploymentResources( waitUntil: WaitUntil.Completed, - details: deploymentDetails + details: unassignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); #endregion - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful unassignment of deployment resources."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs index 80500a38fe56..962c348dbcca 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Threading.Tasks; using Azure; using Azure.AI.Language.Text.Authoring; @@ -16,28 +17,32 @@ public partial class Sample18_TextAuthoring_UnassignDeploymentResourcesAsync : S { [Test] [AsyncOnly] - public async Task DeployProjectAsync() + public async Task UnassignDeploymentResourcesAsync() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } + ); - Operation operation = await deploymentClient.DeployProjectAsync( + Operation operation = await projectClient.UnassignDeploymentResourcesAsync( waitUntil: WaitUntil.Completed, - details: deploymentConfig + details: unassignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); #endregion - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful unassignment of deployment resources."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs index 43655e9c01a5..8daea7190a3c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -2,6 +2,8 @@ // Licensed under the MIT License. using System; +using System.Linq; +using System.Collections.Generic; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; @@ -15,28 +17,54 @@ public partial class Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus { [Test] [SyncOnly] - public void DeployProject() + public void GetUnassignDeploymentResourcesStatus() { Uri endpoint = TestEnvironment.Endpoint; AzureKeyCredential credential = new(TestEnvironment.ApiKey); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + // Prepare the details for unassigning resources + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } + ); - Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails + // Submit the unassign operation and get the job ID + Operation unassignOperation = projectClient.UnassignDeploymentResources( + waitUntil: WaitUntil.Started, + details: unassignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Unassign Job ID: {jobId}"); + + // Call the API to get unassign job status + Response response = + projectClient.GetUnassignDeploymentResourcesStatus(jobId); + + Console.WriteLine($"Job Status: {response.Value.Status}"); + + if (response.Value.Errors != null && response.Value.Errors.Any()) + { + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } + } #endregion - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + Assert.AreEqual("Succeeded", response.Value.Status, "Expected the unassign operation to succeed."); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs index 2e65990b9655..1ec3c6f94062 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs @@ -2,12 +2,14 @@ // Licensed under the MIT License. using System; +using System.Linq; using System.Threading.Tasks; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using Azure.Identity; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples @@ -16,28 +18,52 @@ public partial class Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus { [Test] [AsyncOnly] - public async Task DeployProjectAsync() + public async Task GetUnassignDeploymentResourcesStatusAsync() { Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); + DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync + string projectName = "MyTextProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + // Prepare the details for unassigning resources + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } + ); - Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig + // Submit the unassign operation and get the job ID + Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: unassignDetails ); - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); - #endregion + string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Unassign Job ID: {jobId}"); - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + // Call the API to get unassign job status + Response response = + await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); + + Console.WriteLine($"Job Status: {response.Value.Status}"); + + if (response.Value.Errors != null && response.Value.Errors.Any()) + { + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } + } + #endregion } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 7f53b3227b22..e22b73e01942 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -3,16 +3,18 @@ using System; using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Text.Json; using System.Threading.Tasks; using Azure; using Azure.AI.Language.Text.Authoring; using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; +using Azure.Core.Serialization; using Azure.Core.TestFramework; +using Azure.Identity; using NUnit.Framework; -using System.Text.Json; -using System.Security.Claims; -using Azure.Core.Serialization; namespace Azure.AI.Language.Text.Authoring.Tests { From 4178e6b739969cc64b8eee967bbe10cc1c8b3c6d Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 22:13:29 -0700 Subject: [PATCH 10/47] obscure variable names in sample tests --- .../tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs | 4 ++-- .../Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs | 4 ++-- .../Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs | 4 ++-- .../Sample11_TextAuthoring_DeleteTrainedModelAsync.cs | 4 ++-- .../tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs | 6 +++--- .../Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs | 6 +++--- .../Samples/Sample13_TextAuthoring_DeleteDeployment.cs | 4 ++-- .../Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs | 4 ++-- .../tests/Samples/Sample14_TextAuthoring_DeployProject.cs | 4 ++-- .../Samples/Sample14_TextAuthoring_DeployProjectAsync.cs | 4 ++-- .../tests/Samples/Sample15_TextAuthoring_GetDeployment.cs | 2 +- .../Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs | 4 ++-- .../Sample16_TextAuthoring_AssignDeploymentResources.cs | 2 +- ...Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs | 2 +- ...le17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs | 2 +- ...TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs | 2 +- .../Sample18_TextAuthoring_UnassignDeploymentResources.cs | 2 +- ...mple18_TextAuthoring_UnassignDeploymentResourcesAsync.cs | 2 +- ...19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs | 2 +- ...xtAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs | 2 +- .../tests/Samples/Sample1_TextAuthoring_CreateProject.cs | 4 ++-- .../Samples/Sample1_TextAuthoring_CreateProjectAsync.cs | 2 +- .../tests/Samples/Sample2_TextAuthoring_Import.cs | 4 ++-- .../tests/Samples/Sample2_TextAuthoring_ImportAsync.cs | 6 +++--- .../tests/Samples/Sample3_TextAuthoring_Export.cs | 2 +- .../tests/Samples/Sample3_TextAuthoring_ExportAsync.cs | 2 +- .../tests/Samples/Sample5_TextAuthoring_DeleteProject.cs | 2 +- .../Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs | 2 +- .../tests/Samples/Sample6_TextAuthoring_Train.cs | 4 ++-- .../tests/Samples/Sample6_TextAuthoring_TrainAsync.cs | 4 ++-- .../Samples/Sample7_TextAuthoring_CancelTrainingJob.cs | 2 +- .../Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs | 2 +- .../Sample8_TextAuthoring_GetModelEvaluationSummary.cs | 4 ++-- .../Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResults.cs | 2 +- .../Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs | 2 +- 36 files changed, 57 insertions(+), 57 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs index 0c68769b41cc..06b2db986057 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs @@ -22,8 +22,8 @@ public void LoadSnapshot() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample10_TextAuthoring_LoadSnapshot - string projectName = "LoanAgreements"; - string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + string projectName = "MySnapshotProject"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = trainedModelClient.LoadSnapshot( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs index 936548bd4069..8398d664ba6c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs @@ -23,8 +23,8 @@ public async Task LoadSnapshotAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample10_TextAuthoring_LoadSnapshotAsync - string projectName = "LoanAgreements"; - string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + string projectName = "MySnapshotProjectAsync"; + string trainedModelLabel = "model1"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = await trainedModelClient.LoadSnapshotAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs index 8e52f813cf71..03742709abd5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs @@ -22,8 +22,8 @@ public void DeleteTrainedModel() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample11_TextAuthoring_DeleteTrainedModel - string projectName = "LoanAgreements"; - string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + string projectName = "MyModelProject"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = trainedModelClient.DeleteTrainedModel(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs index 49a98bb71da4..78c301fa703b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs @@ -23,8 +23,8 @@ public async Task DeleteTrainedModelAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync - string projectName = "LoanAgreements"; - string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + string projectName = "MyModelProjectAsync"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = await trainedModelClient.DeleteTrainedModelAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index c1de42f371d9..be928f777c85 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -22,9 +22,9 @@ public void SwapDeployments() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample12_TextAuthoring_SwapDeployments - string projectName = "LoanAgreements"; - string firstDeploymentName = "DeploymentA"; - string secondDeploymentName = "DeploymentB"; + string projectName = "MySwapProject"; + string firstDeploymentName = "Deployment1"; + string secondDeploymentName = "Deployment2"; TextAuthoringProject porjectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs index 0ea6c56f88fd..9154fa8e5eb3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs @@ -23,9 +23,9 @@ public async Task SwapDeploymentsAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync - string projectName = "LoanAgreements"; - string firstDeploymentName = "DeploymentA"; - string secondDeploymentName = "DeploymentB"; + string projectName = "MySwapProjectAsync"; + string firstDeploymentName = "Deployment1"; + string secondDeploymentName = "Deployment2"; TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs index 81c54a4fd2fb..0979539a46ac 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs @@ -22,8 +22,8 @@ public void DeleteDeployment() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample13_TextAuthoring_DeleteDeployment - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentA"; + string projectName = "MyDeploymentProject"; + string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = deploymentClient.DeleteDeployment( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs index bb8bbf5418b9..898193ddfcc7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs @@ -23,8 +23,8 @@ public async Task DeleteDeploymentAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentA"; + string projectName = "MyDeploymentProjectAsync"; + string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = await deploymentClient.DeleteDeploymentAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs index bca231cecc9c..62a1e5a61e72 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs @@ -22,8 +22,8 @@ public void DeployProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; + string projectName = "MyDeploymentProject"; + string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs index 523fa98a1cb7..d969924e22a8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs @@ -23,8 +23,8 @@ public async Task DeployProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "LoanAgreements"; - string deploymentName = "DeploymentName"; + string projectName = "MyDeploymentProjectAsync"; + string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs index f731113f76df..69127ee00dd9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -22,7 +22,7 @@ public void GetDeployment() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample15_TextAuthoring_GetDeployment - string projectName = "MyTextProject"; + string projectName = "MyDeploymentProject"; string deploymentName = "MyDeployment"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs index 661c10dbfc04..f8a95d139d20 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs @@ -23,8 +23,8 @@ public async Task GetDeploymentAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample15_TextAuthoring_GetDeploymentAsync - string projectName = "MyTextProject"; - string deploymentName = "MyDeployment"; + string projectName = "MyDeploymentProjectAsync"; + string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Response response = await deploymentClient.GetDeploymentAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index 18072427b341..d9aa751cddf3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -23,7 +23,7 @@ public void AssignDeploymentResources() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample16_TextAuthoring_AssignDeploymentResources - string projectName = "MyTextProject"; + string projectName = "MyResourceProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs index bbacb5b5d77c..0580a48b7ee0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs @@ -24,7 +24,7 @@ public async Task AssignDeploymentResourcesAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync - string projectName = "MyTextProject"; + string projectName = "MyResourceProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index e418472736bf..e0ef8cabf878 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -24,7 +24,7 @@ public void GetAssignDeploymentResourcesStatus() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus - string projectName = "MyTextProject"; + string projectName = "MyResourceProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs index 47df9a475e25..7b2e0166e330 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs @@ -26,7 +26,7 @@ public async Task GetAssignDeploymentResourcesStatusAsync() var client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync - string projectName = "MyTextProject"; + string projectName = "MyResourceProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs index 855f06f4d1b5..22dcdcd705db 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -23,7 +23,7 @@ public void UnassignDeploymentResources() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResources - string projectName = "MyTextProject"; + string projectName = "MyResourceProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs index 962c348dbcca..3bab828caa7b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs @@ -24,7 +24,7 @@ public async Task UnassignDeploymentResourcesAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync - string projectName = "MyTextProject"; + string projectName = "MyResourceProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs index 8daea7190a3c..be5c21ae5d28 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -24,7 +24,7 @@ public void GetUnassignDeploymentResourcesStatus() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus - string projectName = "MyTextProject"; + string projectName = "MyResourceProject"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs index 1ec3c6f94062..8c25564cf083 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs @@ -25,7 +25,7 @@ public async Task GetUnassignDeploymentResourcesStatusAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync - string projectName = "MyTextProject"; + string projectName = "MyResourceProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index 6ff1f58726af..3a21b25ea938 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -26,18 +26,18 @@ public void CreateProject() TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", - storageInputContainerName: "e2e0test0data", + storageInputContainerName: "test-data", language: "en" ) { Description = "Project description for a Custom Entity Recognition project", Multilingual = true }; + #endregion Response response = projectClient.CreateProject(projectData); Console.WriteLine($"Project created with status: {response.Status}"); - #endregion Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs index 980ff3362d7b..33373ccbc0ba 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs @@ -27,7 +27,7 @@ public async Task CreateProjectAsync() TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", - storageInputContainerName: "e2e0test0data", + storageInputContainerName: "test-data", language: "en" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index 5536e56b96ac..7020743e093b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -23,7 +23,7 @@ public void Import() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_Import - string projectName = "LoanAgreements"; + string projectName = "MyImportProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", @@ -31,7 +31,7 @@ public void Import() language: "en" ) { - Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Description = "Sample dataset for Custom Entity Recognition", Multilingual = false, Settings = new TextAuthoringProjectSettings() }; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs index ec7a77cd3bfb..78500aafbee5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs @@ -23,15 +23,15 @@ public async Task ImportAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_ImportAsync - string projectName = "LoanAgreements"; + string projectName = "MyImportProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomEntityRecognition", - storageInputContainerName: "loanagreements", + storageInputContainerName: "test-data", language: "en" ) { - Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Description = "Sample dataset for Custom Entity Recognition", Multilingual = false }; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs index a8bb5db6fd66..8b6a09d0ac65 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -23,7 +23,7 @@ public void Export() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample3_TextAuthoring_Export - string projectName = "MyExportedTextProject"; + string projectName = "MyExportedProject"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.Export( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs index ac87b35f35db..d58e20ed61ee 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs @@ -23,7 +23,7 @@ public async Task ExportAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample3_TextAuthoring_ExportAsync - string projectName = "MyExportedTextProjectAsync"; + string projectName = "MyExportedProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.ExportAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs index c6b60a76460a..bdd55fc0dda3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs @@ -22,7 +22,7 @@ public void DeleteProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample5_TextAuthoring_DeleteProject - string projectName = "ProjectToDelete"; + string projectName = "MyProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.DeleteProject( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs index 1c19620af4d6..e5c7151bc1ef 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs @@ -23,7 +23,7 @@ public async Task DeleteProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample5_TextAuthoring_DeleteProjectAsync - string projectName = "ProjectToDelete"; + string projectName = "MyProjectToDeleteAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.DeleteProjectAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs index 795645f5977c..29b0f09ecc6f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample5_TextAuthoring_Train : SamplesBase + public partial class Sample6_TextAuthoring_Train : SamplesBase { [Test] [SyncOnly] @@ -22,7 +22,7 @@ public void Train() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample6_TextAuthoring_Train - string projectName = "LoanAgreements"; + string projectName = "MyTrainingProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobDetails = new TextAuthoringTrainingJobDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs index a02e3f1cefe0..c55e01f19849 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Tests.Samples { - public partial class Sample5_TextAuthoring_TrainAsync : SamplesBase + public partial class Sample6_TextAuthoring_TrainAsync : SamplesBase { [Test] [AsyncOnly] @@ -23,7 +23,7 @@ public async Task TrainAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample6_TextAuthoring_TrainAsync - string projectName = "LoanAgreements"; + string projectName = "MyTrainingProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobConfig = new TextAuthoringTrainingJobDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index cb1b030e492e..8f8ef4bfd854 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -22,7 +22,7 @@ public void CancelTrainingJob() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample7_TextAuthoring_CancelTrainingJob - string projectName = "LoanAgreements"; + string projectName = "MyTrainingProject"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs index db3be2152dcf..ee60a355ac16 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs @@ -23,7 +23,7 @@ public async Task CancelTrainingJobAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync - string projectName = "LoanAgreements"; + string projectName = "MyTrainingProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs index ce6a225996a5..af38fe506619 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs @@ -22,8 +22,8 @@ public void GetModelEvaluationSummary() #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary - string projectName = "LoanAgreements"; - string trainedModelLabel = "model2"; + string projectName = "MyEvaluationProject"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs index cbad309b8063..c3832d6b8166 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs @@ -22,8 +22,8 @@ public async Task GetModelEvaluationSummaryAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync - string projectName = "LoanAgreements"; - string trainedModelLabel = "model2"; + string projectName = "MyEvaluationProjectAsync"; + string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs index 71bbc14f928b..012b2ec9d4e2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs @@ -22,7 +22,7 @@ public void GetModelEvaluationResults() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResults - string projectName = "MyTextProject"; + string projectName = "MyEvaluationProject"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs index 092f4ea844e7..0e8025d812f5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs @@ -23,7 +23,7 @@ public async Task GetModelEvaluationResultsAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync - string projectName = "MyTextProjectAsync"; + string projectName = "MyEvaluationProjectAsync"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; From 19d71bbe9929e596169a6211259eb8fb016f859d Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 22:17:06 -0700 Subject: [PATCH 11/47] updated samples --- .../Sample10_TextAuthoring_LoadSnapshot.md | 4 +-- ...ample10_TextAuthoring_LoadSnapshotAsync.md | 4 +-- ...mple11_TextAuthoring_DeleteTrainedModel.md | 4 +-- ...1_TextAuthoring_DeleteTrainedModelAsync.md | 4 +-- .../Sample12_TextAuthoring_SwapDeployments.md | 6 ++-- ...le12_TextAuthoring_SwapDeploymentsAsync.md | 6 ++-- ...Sample13_TextAuthoring_DeleteDeployment.md | 4 +-- ...e13_TextAuthoring_DeleteDeploymentAsync.md | 4 +-- .../Sample14_TextAuthoring_DeployProject.md | 4 +-- ...mple14_TextAuthoring_DeployProjectAsync.md | 4 +-- .../Sample15_TextAuthoring_GetDeployment.md | 14 +++++++-- ...mple15_TextAuthoring_GetDeploymentAsync.md | 18 ++++++----- ...TextAuthoring_AssignDeploymentResources.md | 4 +-- ...uthoring_AssignDeploymentResourcesAsync.md | 4 +-- ...ring_GetAssignDeploymentResourcesStatus.md | 4 +-- ...GetAssignDeploymentResourcesStatusAsync.md | 4 +-- ...xtAuthoring_UnassignDeploymentResources.md | 4 +-- ...horing_UnassignDeploymentResourcesAsync.md | 4 +-- ...ng_GetUnassignDeploymentResourcesStatus.md | 4 +-- ...tUnassignDeploymentResourcesStatusAsync.md | 4 +-- .../Sample1_TextAuthoring_CreateProject.md | 6 +--- ...ample1_TextAuthoring_CreateProjectAsync.md | 2 +- .../samples/Sample2_TextAuthoring_Import.md | 4 +-- .../Sample2_TextAuthoring_ImportAsync.md | 6 ++-- .../samples/Sample3_TextAuthoring_Export.md | 21 ++++++++----- .../Sample3_TextAuthoring_ExportAsync.md | 19 ++++++++++-- .../Sample5_TextAuthoring_DeleteProject.md | 2 +- ...ample5_TextAuthoring_DeleteProjectAsync.md | 2 +- .../samples/Sample6_TextAuthoring_Train.md | 2 +- .../Sample6_TextAuthoring_TrainAsync.md | 2 +- ...Sample7_TextAuthoring_CancelTrainingJob.md | 2 +- ...e7_TextAuthoring_CancelTrainingJobAsync.md | 2 +- ...TextAuthoring_GetModelEvaluationSummary.md | 4 +-- ...uthoring_GetModelEvaluationSummaryAsync.md | 4 +-- ...TextAuthoring_GetModelEvaluationResults.md | 31 ++++++++++++++++--- ...uthoring_GetModelEvaluationResultsAsync.md | 31 ++++++++++++++++--- 36 files changed, 161 insertions(+), 87 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index e01b944f1f60..81ea9c72a29f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshot on the TextAnalysisAuthoring client. ```C# Snippet:Sample10_TextAuthoring_LoadSnapshot -string projectName = "LoanAgreements"; -string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. +string projectName = "MySnapshotProject"; +string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = trainedModelClient.LoadSnapshot( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index 8385d0c23cc0..d1762151d9fe 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample10_TextAuthoring_LoadSnapshotAsync -string projectName = "LoanAgreements"; -string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. +string projectName = "MySnapshotProjectAsync"; +string trainedModelLabel = "model1"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = await trainedModelClient.LoadSnapshotAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 5794f16bb7fc..6488d3a7f543 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModel on the TextAnalysisAuthoring client. ```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModel -string projectName = "LoanAgreements"; -string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. +string projectName = "MyModelProject"; +string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = trainedModelClient.DeleteTrainedModel(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index b23ab9c7f465..00d59a09d6f9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync -string projectName = "LoanAgreements"; -string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. +string projectName = "MyModelProjectAsync"; +string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = await trainedModelClient.DeleteTrainedModelAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 13b642b5b362..020cc8aeb39e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -18,9 +18,9 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. ```C# Snippet:Sample12_TextAuthoring_SwapDeployments -string projectName = "LoanAgreements"; -string firstDeploymentName = "DeploymentA"; -string secondDeploymentName = "DeploymentB"; +string projectName = "MySwapProject"; +string firstDeploymentName = "Deployment1"; +string secondDeploymentName = "Deployment2"; TextAuthoringProject porjectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index 30270d4d2361..63e6d173e8ae 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -18,9 +18,9 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync -string projectName = "LoanAgreements"; -string firstDeploymentName = "DeploymentA"; -string secondDeploymentName = "DeploymentB"; +string projectName = "MySwapProjectAsync"; +string firstDeploymentName = "Deployment1"; +string secondDeploymentName = "Deployment2"; TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index 3a32fe5f7085..051217d669bb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeployment on the TextAnalysisAuthoring client. ```C# Snippet:Sample13_TextAuthoring_DeleteDeployment -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentA"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = deploymentClient.DeleteDeployment( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index 60b0f2742ed4..80725a13c139 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentA"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = await deploymentClient.DeleteDeploymentAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index 677cb70f8f13..9b74ce66b8a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index 8ffdc58bd13d..cf74ae9be044 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index ac522d617f25..13de8bae5e0f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -20,8 +20,18 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To retrieve deployment details, call `GetDeployment` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. ```C# Snippet:Sample15_TextAuthoring_GetDeployment -string projectName = "MyTextProject"; string deploymentName = "MyDeployment"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +string projectName = "MyDeploymentProject"; +string deploymentName = "MyDeployment"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + Response response = deploymentClient.GetDeployment(); + TextAuthoringProjectDeployment deployment = response.Value; -Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); Console.WriteLine($"Model Id: {deployment.ModelId}"); Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); + +Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); +Console.WriteLine($"Model Id: {deployment.ModelId}"); +Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); +Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); +Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); +Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 7f221a212381..0da79cb3852f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -20,16 +20,18 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. ```C# Snippet:Sample15_TextAuthoring_GetDeploymentAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +Response response = await deploymentClient.GetDeploymentAsync(); -Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig -); +TextAuthoringProjectDeployment deployment = response.Value; -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); +Console.WriteLine($"Model Id: {deployment.ModelId}"); +Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); +Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); +Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); +Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index 677cb70f8f13..9b74ce66b8a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index 8ffdc58bd13d..cf74ae9be044 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index 677cb70f8f13..9b74ce66b8a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index 8ffdc58bd13d..cf74ae9be044 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 677cb70f8f13..9b74ce66b8a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index 8ffdc58bd13d..cf74ae9be044 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index 677cb70f8f13..9b74ce66b8a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProject"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index 8ffdc58bd13d..cf74ae9be044 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "LoanAgreements"; -string deploymentName = "DeploymentName"; +string projectName = "MyDeploymentProjectAsync"; +string deploymentName = "Deployment1"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index 7ee38c7d0951..ae5378056a4c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -24,17 +24,13 @@ string projectName = "MyNewProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", - storageInputContainerName: "e2e0test0data", + storageInputContainerName: "test-data", language: "en" ) { Description = "Project description for a Custom Entity Recognition project", Multilingual = true }; - -Response response = projectClient.CreateProject(projectData); - -Console.WriteLine($"Project created with status: {response.Status}"); ``` To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index ce7c961711da..9ad24f29c83a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -22,7 +22,7 @@ string projectName = "MyNewProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", - storageInputContainerName: "e2e0test0data", + storageInputContainerName: "test-data", language: "en" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 835ef272e16a..536d3c65408e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -20,7 +20,7 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To import project data, call Import on the TextAnalysisAuthoring client. ```C# Snippet:Sample2_TextAuthoring_Import -string projectName = "LoanAgreements"; +string projectName = "MyImportProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", @@ -28,7 +28,7 @@ var projectMetadata = new TextAuthoringCreateProjectDetails( language: "en" ) { - Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Description = "Sample dataset for Custom Entity Recognition", Multilingual = false, Settings = new TextAuthoringProjectSettings() }; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index f751c2431e42..aac6a456aaf1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -20,15 +20,15 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To import project data, call ImportAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample2_TextAuthoring_ImportAsync -string projectName = "LoanAgreements"; +string projectName = "MyImportProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomEntityRecognition", - storageInputContainerName: "loanagreements", + storageInputContainerName: "test-data", language: "en" ) { - Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Description = "Sample dataset for Custom Entity Recognition", Multilingual = false }; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index ea998262d7ec..522aa1b4236c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -7,9 +7,9 @@ This sample demonstrates how to export project data synchronously using the `Azu 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` @@ -19,12 +19,17 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To export project data, call `Export` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. ```C# Snippet:Sample3_TextAuthoring_Export -string projectName = "MyExportedTextProject"; +string projectName = "MyExportedProject"; TextAuthoringProject projectClient = client.GetProject(projectName); -Operation operation = projectClient.Export(waitUntil: WaitUntil.Completed, stringIndexType: StringIndexType.Utf16CodeUnit); -// Extract the operation-location header -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + +Operation operation = projectClient.Export( + waitUntil: WaitUntil.Completed, + stringIndexType: StringIndexType.Utf16CodeUnit +); + +// Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); -Console.WriteLine("Export operation has finished successfully."); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index a400acea6b7b..08ba4c7c448c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -7,7 +7,10 @@ This sample demonstrates how to export project data asynchronously using the `Az 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. @@ -17,5 +20,17 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. ```C# Snippet:Sample3_TextAuthoring_ExportAsync -string projectName = "MyExportedTextProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.ExportAsync(waitUntil: WaitUntil.Completed, stringIndexType: StringIndexType.Utf16CodeUnit); // Extract the operation-location header string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); Console.WriteLine("Export operation has finished successfully."); +string projectName = "MyExportedProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +Operation operation = await projectClient.ExportAsync( + waitUntil: WaitUntil.Completed, + stringIndexType: StringIndexType.Utf16CodeUnit +); + +// Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index c57fa75fec65..4e27a1fee494 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample5_TextAuthoring_DeleteProject -string projectName = "ProjectToDelete"; +string projectName = "MyProjectToDelete"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.DeleteProject( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index 0a640d8ef980..b5c712e654c8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample5_TextAuthoring_DeleteProjectAsync -string projectName = "ProjectToDelete"; +string projectName = "MyProjectToDeleteAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.DeleteProjectAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index 3e6ea0aaee5d..ef1db332110e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call Train on the TextAnalysisAuthoring client. ```C# Snippet:Sample6_TextAuthoring_Train -string projectName = "LoanAgreements"; +string projectName = "MyTrainingProject"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobDetails = new TextAuthoringTrainingJobDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index 5cc8d13f0d71..af62a9c62f15 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call TrainAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample6_TextAuthoring_TrainAsync -string projectName = "LoanAgreements"; +string projectName = "MyTrainingProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobConfig = new TextAuthoringTrainingJobDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index c66e798bcc2c..7a4c5a24b162 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring client. ```C# Snippet:Sample7_TextAuthoring_CancelTrainingJob -string projectName = "LoanAgreements"; +string projectName = "MyTrainingProject"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 57b59a2c87de..7465fb6168f1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync -string projectName = "LoanAgreements"; +string projectName = "MyTrainingProjectAsync"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index dd8f6e5a5337..bda4e41848da 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummary on the TextAnalysisAuthoring client. ```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary -string projectName = "LoanAgreements"; -string trainedModelLabel = "model2"; +string projectName = "MyEvaluationProject"; +string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index c35d8cf8a755..d0b224355114 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync -string projectName = "LoanAgreements"; -string trainedModelLabel = "model2"; +string projectName = "MyEvaluationProjectAsync"; +string trainedModelLabel = "model1"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 53bfc7546f1b..6f5862843c7e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -7,7 +7,10 @@ This sample demonstrates how to retrieve model evaluation results synchronously 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. @@ -17,8 +20,28 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To retrieve model evaluation results, call `GetModelEvaluationResults` on the `TextAuthoringTrainedModel` client. The method returns a `Pageable` that allows you to enumerate the evaluation results for each document. ```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResults -string projectName = "MyTextProject"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; +string projectName = "MyEvaluationProject"; +string trainedModelLabel = "model1"; +StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); -Pageable results = trainedModelClient.GetModelEvaluationResults( stringIndexType: stringIndexType ); -foreach (TextAuthoringDocumentEvalResult result in results) { Console.WriteLine($"Document Location: {result.Location}"); Console.WriteLine($"Language: {result.Language}"); + +Pageable results = trainedModelClient.GetModelEvaluationResults( + stringIndexType: stringIndexType +); + +foreach (TextAuthoringDocumentEvalResult result in results) +{ + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); + + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) + { + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); + } + // Add handling for other result types as needed +} ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index 4024db0e3557..caba93837aeb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -7,7 +7,10 @@ This sample demonstrates how to retrieve model evaluation results asynchronously 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new("your apikey"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. @@ -17,8 +20,28 @@ The values of the endpoint and apiKey variables can be retrieved from environmen To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. ```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync -string projectName = "MyTextProjectAsync"; string trainedModelLabel = "model1"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; +string projectName = "MyEvaluationProjectAsync"; +string trainedModelLabel = "model1"; +StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); -AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( stringIndexType: stringIndexType ); -await foreach (TextAuthoringDocumentEvalResult result in results) { Console.WriteLine($"Document Location: {result.Location}"); Console.WriteLine($"Language: {result.Language}"); + +AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( + stringIndexType: stringIndexType +); + +await foreach (TextAuthoringDocumentEvalResult result in results) +{ + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); + + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) + { + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); + } + // Add handling for other result types as needed +} ``` From ddefb4cb04efab571293760898782b69805de7ed Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 23:16:24 -0700 Subject: [PATCH 12/47] udpated the md and snippets for assing/unAssignDeployment and getAssign/UnassignStatus --- ...TextAuthoring_AssignDeploymentResources.md | 33 +++++++----- ...uthoring_AssignDeploymentResourcesAsync.md | 33 +++++++----- ...ring_GetAssignDeploymentResourcesStatus.md | 47 ++++++++++------ ...GetAssignDeploymentResourcesStatusAsync.md | 47 ++++++++++------ ...xtAuthoring_UnassignDeploymentResources.md | 30 ++++++----- ...horing_UnassignDeploymentResourcesAsync.md | 30 ++++++----- ...ng_GetUnassignDeploymentResourcesStatus.md | 54 +++++++++++++------ ...tUnassignDeploymentResourcesStatusAsync.md | 54 +++++++++++++------ 8 files changed, 212 insertions(+), 116 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index 9b74ce66b8a3..2d722669d88d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -1,6 +1,6 @@ -# Deploying a Project Synchronously in Azure AI Language +# Assigning Deployment Resources Synchronously in Azure AI Language -This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to assign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,28 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Synchronously +## Assign Deployment Resources Synchronously -To deploy a project, call DeployProject on the TextAnalysisAuthoring client. +To assign deployment resources, call `AssignDeploymentResources` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResources +string projectName = "MyResourceProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" +); + +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } +); -Operation operation = deploymentClient.DeployProject( +Operation operation = projectClient.AssignDeploymentResources( waitUntil: WaitUntil.Completed, - details: deploymentDetails + details: assignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); ``` - -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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index cf74ae9be044..d8f442cdbfa2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -1,6 +1,6 @@ -# Deploying a Project Asynchronously in Azure AI Language +# Assigning Deployment Resources Asynchronously in Azure AI Language -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to assign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,28 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Asynchronously +## Assign Deployment Resources Asynchronously -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. +To assign deployment resources, call `AssignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync +string projectName = "MyResourceProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" +); + +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } +); -Operation operation = await deploymentClient.DeployProjectAsync( +Operation operation = await projectClient.AssignDeploymentResourcesAsync( waitUntil: WaitUntil.Completed, - details: deploymentConfig + details: assignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); ``` - -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index 9b74ce66b8a3..02a77e7a872d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -1,6 +1,6 @@ -# Deploying a Project Synchronously in Azure AI Language +# Retrieving Deployment Resources Assignment Status Synchronously in Azure AI Language -This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve the status of deployment resources assignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,40 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Synchronously +## Retrieve Deployment Resources Assignment Status Synchronously -To deploy a project, call DeployProject on the TextAnalysisAuthoring client. +To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatus` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus +string projectName = "MyResourceProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" +); -Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); -``` +// Submit assignment operation +Operation assignOperation = projectClient.AssignDeploymentResources( + waitUntil: WaitUntil.Started, + details: assignDetails +); + +string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); -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. +// Extract only the jobId part from the URL +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Job ID: {jobId}"); + +// Call status API +Response statusResponse = projectClient.GetAssignDeploymentResourcesStatus(jobId); + +Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index cf74ae9be044..df902d5ca632 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -1,6 +1,6 @@ -# Deploying a Project Asynchronously in Azure AI Language +# Retrieving Deployment Resources Assignment Status Asynchronously in Azure AI Language -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve the status of deployment resources assignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,40 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Asynchronously +## Retrieve Deployment Resources Assignment Status Asynchronously -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. +To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync +string projectName = "MyResourceProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", + customDomain: "my-custom-domain", + region: "my-region" +); -Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); -``` +// Submit assignment operation +Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: assignDetails +); + +string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. +// Extract only the jobId part from the URL +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Job ID: {jobId}"); + +// Call status API +Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); + +Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 9b74ce66b8a3..1547bf00936c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -1,6 +1,6 @@ -# Deploying a Project Synchronously in Azure AI Language +# Unassigning Deployment Resources Synchronously in Azure AI Language -This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to unassign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,25 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Synchronously +## Unassign Deployment Resources Synchronously -To deploy a project, call DeployProject on the TextAnalysisAuthoring client. +To unassign deployment resources, call `UnassignDeploymentResources` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResources +string projectName = "MyResourceProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } +); -Operation operation = deploymentClient.DeployProject( +Operation operation = projectClient.UnassignDeploymentResources( waitUntil: WaitUntil.Completed, - details: deploymentDetails + details: unassignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); ``` - -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. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index cf74ae9be044..58a3be0fd3d5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -1,6 +1,6 @@ -# Deploying a Project Asynchronously in Azure AI Language +# Unassigning Deployment Resources Asynchronously in Azure AI Language -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to unassign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,25 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Asynchronously +## Unassign Deployment Resources Asynchronously -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. +To unassign deployment resources, call `UnassignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync +string projectName = "MyResourceProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } +); -Operation operation = await deploymentClient.DeployProjectAsync( +Operation operation = await projectClient.UnassignDeploymentResourcesAsync( waitUntil: WaitUntil.Completed, - details: deploymentConfig + details: unassignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); ``` - -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index 9b74ce66b8a3..cbdc48fcb03c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -1,6 +1,6 @@ -# Deploying a Project Synchronously in Azure AI Language +# Retrieving Deployment Resources Unassignment Status Synchronously in Azure AI Language -This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve the status of deployment resources unassignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,47 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Synchronously +## Retrieve Deployment Resources Unassignment Status Synchronously -To deploy a project, call DeployProject on the TextAnalysisAuthoring client. +To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatus` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus +string projectName = "MyResourceProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +// Prepare the details for unassigning resources +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } +); -Operation operation = deploymentClient.DeployProject( - waitUntil: WaitUntil.Completed, - details: deploymentDetails +// Submit the unassign operation and get the job ID +Operation unassignOperation = projectClient.UnassignDeploymentResources( + waitUntil: WaitUntil.Started, + details: unassignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); -``` +string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Unassign Job ID: {jobId}"); -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. +// Call the API to get unassign job status +Response response = + projectClient.GetUnassignDeploymentResourcesStatus(jobId); + +Console.WriteLine($"Job Status: {response.Value.Status}"); + +if (response.Value.Errors != null && response.Value.Errors.Any()) +{ + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } +} +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index cf74ae9be044..317d3a6a0604 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -1,6 +1,6 @@ -# Deploying a Project Asynchronously in Azure AI Language +# Retrieving Deployment Resources Unassignment Status Asynchronously in Azure AI Language -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. +This sample demonstrates how to retrieve the status of deployment resources unassignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. ## Create an `AuthoringClient` @@ -13,23 +13,47 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -## Deploy a Project Asynchronously +## Retrieve Deployment Resources Unassignment Status Asynchronously -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. +To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); +```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync +string projectName = "MyResourceProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +// Prepare the details for unassigning resources +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + } +); -Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig +// Submit the unassign operation and get the job ID +Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: unassignDetails ); -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); -``` +string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Unassign Job ID: {jobId}"); -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. +// Call the API to get unassign job status +Response response = + await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); + +Console.WriteLine($"Job Status: {response.Value.Status}"); + +if (response.Value.Errors != null && response.Value.Errors.Any()) +{ + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } +} +``` From cd7d7d36f18f09d88e9a289348b83a73fd386246 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 23:20:31 -0700 Subject: [PATCH 13/47] remove the extra sentence in md files --- .../samples/Sample15_TextAuthoring_GetDeployment.md | 2 -- .../samples/Sample15_TextAuthoring_GetDeploymentAsync.md | 2 -- .../samples/Sample1_TextAuthoring_CreateProject.md | 2 -- .../samples/Sample2_TextAuthoring_Import.md | 2 -- .../samples/Sample2_TextAuthoring_ImportAsync.md | 2 -- .../samples/Sample3_TextAuthoring_Export.md | 2 -- .../samples/Sample3_TextAuthoring_ExportAsync.md | 2 -- .../samples/Sample4_TextAuthoring_GetProject.md | 2 -- .../samples/Sample4_TextAuthoring_GetProjectAsync.md | 2 -- .../samples/Sample9_TextAuthoring_GetModelEvaluationResults.md | 2 -- .../Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md | 2 -- 11 files changed, 22 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index 13de8bae5e0f..e722fd1d7b5b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Deployment Details Synchronously To retrieve deployment details, call `GetDeployment` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 0da79cb3852f..04823a3db0b9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Deployment Details Asynchronously To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index ae5378056a4c..4c89b9ef906a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Create a Project Synchronously To create a new project, call CreateProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 536d3c65408e..817097619bab 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Import Project Data Synchronously To import project data, call Import on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index aac6a456aaf1..f468a7264439 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Import Project Data Asynchronously To import project data, call ImportAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index 522aa1b4236c..5ef583b79a52 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Export Project Data Synchronously To export project data, call `Export` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index 08ba4c7c448c..afa1aa70a648 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Export Project Data Asynchronously To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index be41015b893b..2bd5c3e039f8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -11,8 +11,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Project Metadata Synchronously To retrieve metadata of a project, call GetProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index 2ca3c32e61f2..e94953341af2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Project Metadata Asynchronously To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 6f5862843c7e..04c96eab4851 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Model Evaluation Results Synchronously To retrieve model evaluation results, call `GetModelEvaluationResults` on the `TextAuthoringTrainedModel` client. The method returns a `Pageable` that allows you to enumerate the evaluation results for each document. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index caba93837aeb..975d6316a9d6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -13,8 +13,6 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` -The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. - ## Retrieve Model Evaluation Results Asynchronously To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. From 97c48d4b25861aa922fcf734c4d44b0924a22b9b Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 23:29:36 -0700 Subject: [PATCH 14/47] amend the default Azure create client snippets for 16,17,18,19 md --- ...ample16_TextAuthoring_AssignDeploymentResources.md | 11 +++++------ ...16_TextAuthoring_AssignDeploymentResourcesAsync.md | 11 +++++------ ...extAuthoring_GetAssignDeploymentResourcesStatus.md | 11 +++++------ ...thoring_GetAssignDeploymentResourcesStatusAsync.md | 11 +++++------ ...ple18_TextAuthoring_UnassignDeploymentResources.md | 11 +++++------ ..._TextAuthoring_UnassignDeploymentResourcesAsync.md | 11 +++++------ ...tAuthoring_GetUnassignDeploymentResourcesStatus.md | 11 +++++------ ...oring_GetUnassignDeploymentResourcesStatusAsync.md | 11 +++++------ 8 files changed, 40 insertions(+), 48 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index 2d722669d88d..0d3c3ee7fef4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -2,15 +2,14 @@ This sample demonstrates how to assign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Assign Deployment Resources Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index d8f442cdbfa2..bae979e82d44 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -2,15 +2,14 @@ This sample demonstrates how to assign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Assign Deployment Resources Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index 02a77e7a872d..b22c7b6426ea 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -2,15 +2,14 @@ This sample demonstrates how to retrieve the status of deployment resources assignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Retrieve Deployment Resources Assignment Status Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index df902d5ca632..efb23ada5034 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -2,15 +2,14 @@ This sample demonstrates how to retrieve the status of deployment resources assignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Retrieve Deployment Resources Assignment Status Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 1547bf00936c..348d5d829337 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -2,15 +2,14 @@ This sample demonstrates how to unassign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Unassign Deployment Resources Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index 58a3be0fd3d5..0a5b30880a75 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -2,15 +2,14 @@ This sample demonstrates how to unassign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Unassign Deployment Resources Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index cbdc48fcb03c..c07bb0e07829 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -2,15 +2,14 @@ This sample demonstrates how to retrieve the status of deployment resources unassignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Retrieve Deployment Resources Unassignment Status Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index 317d3a6a0604..d038c72ab8fe 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -2,15 +2,14 @@ This sample demonstrates how to retrieve the status of deployment resources unassignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create an `AuthoringClient` using AAD Authentication -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. +To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); +DefaultAzureCredential credential = new DefaultAzureCredential(); +TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` ## Retrieve Deployment Resources Unassignment Status Asynchronously From f22404e68111966f8d0f02f6331483396a4b4eaa Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 23:51:59 -0700 Subject: [PATCH 15/47] update sample links on main readme --- .../README.md | 69 +++++++++++-------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 785fcee528bb..5f2757de6dc7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -27,8 +27,9 @@ dotnet add package Azure.AI.Language.Text.Authoring --prerelease ``` |SDK version |Supported API version of service -|-------------|------------------------------------------------------------------ +|-------------|------------------------------------------------------------------------------ |1.0.0-beta.1 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview (default) +|1.0.0-beta.2 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview, 2025-05-15-preview (default) ### Prerequisites @@ -139,32 +140,46 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples -You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). - -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) +You can familiarize yourself with different APIs using [Samples](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). + +* [Create a New Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) +* [Import a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) +* [Export a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) +* [Deploy a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Deploy a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) +* [Get Deployment Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Get Deployment Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) +* [Assign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Assign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) +* [Get Deployment Resources Assignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Get Deployment Resources Assignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) +* [Unassign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Unassign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) +* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) +* [Get Deployment Resources Unassignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) ## Troubleshooting From 5b3f4a923ad0660ee6d25d37bd76c5457f4f41c0 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sat, 28 Jun 2025 23:56:40 -0700 Subject: [PATCH 16/47] udpated snippets to {endpoint} and {api-key} --- .../Azure.AI.Language.Text.Authoring/README.md | 10 +++++----- .../samples/Sample10_TextAuthoring_LoadSnapshot.md | 4 ++-- .../Sample10_TextAuthoring_LoadSnapshotAsync.md | 4 ++-- .../Sample11_TextAuthoring_DeleteTrainedModel.md | 4 ++-- .../Sample11_TextAuthoring_DeleteTrainedModelAsync.md | 4 ++-- .../samples/Sample12_TextAuthoring_SwapDeployments.md | 4 ++-- .../Sample12_TextAuthoring_SwapDeploymentsAsync.md | 4 ++-- .../samples/Sample13_TextAuthoring_DeleteDeployment.md | 4 ++-- .../Sample13_TextAuthoring_DeleteDeploymentAsync.md | 4 ++-- .../samples/Sample14_TextAuthoring_DeployProject.md | 4 ++-- .../Sample14_TextAuthoring_DeployProjectAsync.md | 4 ++-- .../samples/Sample15_TextAuthoring_GetDeployment.md | 4 ++-- .../Sample15_TextAuthoring_GetDeploymentAsync.md | 4 ++-- ...Sample16_TextAuthoring_AssignDeploymentResources.md | 2 +- ...e16_TextAuthoring_AssignDeploymentResourcesAsync.md | 2 +- ...TextAuthoring_GetAssignDeploymentResourcesStatus.md | 2 +- ...uthoring_GetAssignDeploymentResourcesStatusAsync.md | 2 +- ...mple18_TextAuthoring_UnassignDeploymentResources.md | 2 +- ...8_TextAuthoring_UnassignDeploymentResourcesAsync.md | 2 +- ...xtAuthoring_GetUnassignDeploymentResourcesStatus.md | 2 +- ...horing_GetUnassignDeploymentResourcesStatusAsync.md | 2 +- .../samples/Sample1_TextAuthoring_CreateProject.md | 4 ++-- .../Sample1_TextAuthoring_CreateProjectAsync.md | 4 ++-- .../samples/Sample2_TextAuthoring_Import.md | 4 ++-- .../samples/Sample2_TextAuthoring_ImportAsync.md | 4 ++-- .../samples/Sample3_TextAuthoring_Export.md | 4 ++-- .../samples/Sample3_TextAuthoring_ExportAsync.md | 4 ++-- .../samples/Sample4_TextAuthoring_GetProject.md | 4 ++-- .../samples/Sample4_TextAuthoring_GetProjectAsync.md | 4 ++-- .../samples/Sample5_TextAuthoring_DeleteProject.md | 4 ++-- .../Sample5_TextAuthoring_DeleteProjectAsync.md | 4 ++-- .../samples/Sample6_TextAuthoring_Train.md | 4 ++-- .../samples/Sample6_TextAuthoring_TrainAsync.md | 4 ++-- .../samples/Sample7_TextAuthoring_CancelTrainingJob.md | 4 ++-- .../Sample7_TextAuthoring_CancelTrainingJobAsync.md | 4 ++-- .../Sample8_TextAuthoring_GetModelEvaluationSummary.md | 4 ++-- ...le8_TextAuthoring_GetModelEvaluationSummaryAsync.md | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResults.md | 4 ++-- ...le9_TextAuthoring_GetModelEvaluationResultsAsync.md | 4 ++-- .../tests/Samples/CreateClient.cs | 6 +++--- 40 files changed, 76 insertions(+), 76 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 5f2757de6dc7..727aa5a60895 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -61,8 +61,8 @@ using Azure.AI.Language.Text.Authoring; With your endpoint and API key, you can instantiate a TextAnalysisAuthoringClient using specific service options: ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` @@ -87,7 +87,7 @@ using Microsoft.Extensions.Options; Then you can create an instance of DefaultAzureCredential and pass it to a new instance of your client: ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` @@ -105,8 +105,8 @@ You have the flexibility to explicitly select a supported service API version wh For example: ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index 81ea9c72a29f..01ac82f46319 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -7,8 +7,8 @@ This sample demonstrates how to load a snapshot synchronously using the `Azure.A 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index d1762151d9fe..2936d872f622 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to load a snapshot asynchronously using the `Azure. 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 6488d3a7f543..c7e34b3b411e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a trained model synchronously using the ` 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index 00d59a09d6f9..ff702fa144e0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a trained model asynchronously using the 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 020cc8aeb39e..206eb9506d39 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -7,8 +7,8 @@ This sample demonstrates how to swap deployments synchronously using the `Azure. 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index 63e6d173e8ae..a6c78d6d1f01 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to swap deployments asynchronously using the `Azure 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index 051217d669bb..08e610a33f4f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a deployment synchronously using the `Azu 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index 80725a13c139..537127fcb908 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a deployment asynchronously using the `Az 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index 9b74ce66b8a3..8f95b41d78be 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -7,8 +7,8 @@ This sample demonstrates how to deploy a project synchronously using the `Azure. 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index cf74ae9be044..357a57696cc6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to deploy a project asynchronously using the `Azure 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index e722fd1d7b5b..c92f888f448b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve deployment details synchronously using 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 04823a3db0b9..06e2ac749859 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve deployment details asynchronously using 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index 0d3c3ee7fef4..d44ccdf9496b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -7,7 +7,7 @@ This sample demonstrates how to assign deployment resources synchronously using To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index bae979e82d44..3044efda0e46 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -7,7 +7,7 @@ This sample demonstrates how to assign deployment resources asynchronously using To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index b22c7b6426ea..be62fa0cf841 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -7,7 +7,7 @@ This sample demonstrates how to retrieve the status of deployment resources assi To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index efb23ada5034..2b220d209ee0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -7,7 +7,7 @@ This sample demonstrates how to retrieve the status of deployment resources assi To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 348d5d829337..5cd831075f4b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -7,7 +7,7 @@ This sample demonstrates how to unassign deployment resources synchronously usin To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index 0a5b30880a75..44b77682e329 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -7,7 +7,7 @@ This sample demonstrates how to unassign deployment resources asynchronously usi To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index c07bb0e07829..bb6976443ea2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -7,7 +7,7 @@ This sample demonstrates how to retrieve the status of deployment resources unas To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index d038c72ab8fe..e794f720699e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -7,7 +7,7 @@ This sample demonstrates how to retrieve the status of deployment resources unas To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. ```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +Uri endpoint = new Uri("{endpoint}");; DefaultAzureCredential credential = new DefaultAzureCredential(); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index 4c89b9ef906a..a0221f598649 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -7,8 +7,8 @@ This sample demonstrates how to create a new project synchronously using the `Az 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index 9ad24f29c83a..653737e9f85d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to create a new project asynchronously using the `A 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 817097619bab..d331c7b255d1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -7,8 +7,8 @@ This sample demonstrates how to import project data synchronously using the `Azu 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index f468a7264439..cf8c63c1a701 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to import project data asynchronously using the `Az 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index 5ef583b79a52..c7b428248359 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -7,8 +7,8 @@ This sample demonstrates how to export project data synchronously using the `Azu 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index afa1aa70a648..8c091d0a3fad 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to export project data asynchronously using the `Az 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index 2bd5c3e039f8..133b9e224d19 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -5,8 +5,8 @@ This sample demonstrates how to retrieve metadata of a project synchronously usi 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index e94953341af2..6e8b795ac4f6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve metadata of a project asynchronously us 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index 4e27a1fee494..e3e0330e9e29 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a project synchronously using the `Azure. 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index b5c712e654c8..b7db0ef8b9cf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to delete a project asynchronously using the `Azure 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index ef1db332110e..e4458d1a8247 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -7,8 +7,8 @@ This sample demonstrates how to train a project synchronously using the `Azure.A 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index af62a9c62f15..7f064d21809b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to train a project asynchronously using the `Azure. 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 7a4c5a24b162..679a51e65f97 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -7,8 +7,8 @@ This sample demonstrates how to cancel a training job synchronously using the `A 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 7465fb6168f1..9c7e2fcb6085 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to cancel a training job asynchronously using the ` 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index bda4e41848da..a9dee87b257a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve the evaluation summary of a trained mod 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index d0b224355114..9a189b3d3fe9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve the evaluation summary of a trained mod 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 04c96eab4851..ba55859c93e8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve model evaluation results synchronously 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index 975d6316a9d6..3e29bebe0b8f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -7,8 +7,8 @@ This sample demonstrates how to retrieve model evaluation results asynchronously 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. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); -AzureKeyCredential credential = new("your apikey"); +Uri endpoint = new Uri("{endpoint}"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs index 62362751f8e7..c41d915c7f46 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs @@ -20,8 +20,8 @@ public partial class CreateClient : SamplesBase public void CreateAuthoringClientForSpecificApiVersion() { #region Snippet:CreateTextAuthoringClientForSpecificApiVersion - Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); - AzureKeyCredential credential = new("your apikey"); + Uri endpoint = new Uri("{endpoint}"); + AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); #if !SNIPPET endpoint = TestEnvironment.Endpoint; credential = new(TestEnvironment.ApiKey); @@ -35,7 +35,7 @@ public void CreateAuthoringClientForSpecificApiVersion() public void AuthoringClient_CreateWithDefaultAzureCredential() { #region Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential - Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); + Uri endpoint = new Uri("{endpoint}");; #if !SNIPPET endpoint = TestEnvironment.Endpoint; #endif From 8a6ef0f02c07fb9f26b80a16beadb07f26b0d8c9 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sun, 29 Jun 2025 00:11:33 -0700 Subject: [PATCH 17/47] update change log --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index 288c541f8a04..763f2527f1b1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -4,12 +4,17 @@ ### Features Added -### Breaking Changes +- Added support for Custom Text Authoring API Versions + - 2025-05-15-preview ### Bugs Fixed +- Merged TextAuthoringUnassignDeploymentResourcesState and TextAuthoringAssignDeploymentResourcesState into one class TextAuthoringDeploymentResourcesState + ### Other Changes +- Added tests and samples for some legacy features. + ## 1.0.0-beta.1 (2025-03-04) ### Other Changes From 6c209c009b662015ed3708f720607a38ff092cdd Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sun, 29 Jun 2025 00:16:29 -0700 Subject: [PATCH 18/47] update `Export API` using command --- ...Azure.AI.Language.Text.Authoring.net8.0.cs | 65 +++++++------------ ....Language.Text.Authoring.netstandard2.0.cs | 65 +++++++------------ 2 files changed, 48 insertions(+), 82 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs index 6ebf9f16459a..64e0737eccf9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs @@ -665,12 +665,13 @@ public TextAnalysisAuthoringClient(System.Uri endpoint, Azure.Core.TokenCredenti } public partial class TextAnalysisAuthoringClientOptions : Azure.Core.ClientOptions { - public TextAnalysisAuthoringClientOptions(Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public TextAnalysisAuthoringClientOptions(Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview) { } public enum ServiceVersion { V2023_04_01 = 1, V2023_04_15_Preview = 2, V2024_11_15_Preview = 3, + V2025_05_15_Preview = 4, } } public static partial class TextAnalysisAuthoringModelFactory @@ -703,7 +704,6 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.SingleLabelClassEvalSummary SingleLabelClassEvalSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } public static Azure.AI.Language.Text.Authoring.SingleLabelClassificationEvalSummary SingleLabelClassificationEvalSummary(System.Collections.Generic.IReadOnlyDictionary confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } public static Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary SpanSentimentEvalSummary(System.Collections.Generic.IReadOnlyDictionary confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary sentiments = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } - public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState TextAuthoringAssignDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedDeploymentResource TextAuthoringAssignedDeploymentResource(string azureResourceId = null, Azure.Core.AzureLocation region = default(Azure.Core.AzureLocation)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentMetadata TextAuthoringAssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedOn = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpiresOn = default(System.DateTimeOffset)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentsMetadata TextAuthoringAssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } @@ -714,6 +714,7 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.TextAuthoringCreateProjectDetails TextAuthoringCreateProjectDetails(Azure.AI.Language.Text.Authoring.TextAuthoringProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.TextAuthoringProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentDeleteFromResourcesState TextAuthoringDeploymentDeleteFromResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResource TextAuthoringDeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState TextAuthoringDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentState TextAuthoringDeploymentState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDocumentEvalResult TextAuthoringDocumentEvalResult(string projectKind = null, string location = null, string language = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringEntityEvalSummary TextAuthoringEntityEvalSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } @@ -739,7 +740,6 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobDetails TextAuthoringTrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.TextAuthoringEvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.DataGenerationSetting dataGenerationSettings = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult TextAuthoringTrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.TextAuthoringSubTrainingState trainingStatus = null, Azure.AI.Language.Text.Authoring.TextAuthoringSubTrainingState evaluationStatus = null, System.DateTimeOffset? estimatedEndOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingState TextAuthoringTrainingState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult result = null) { throw null; } - public static Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState TextAuthoringUnassignDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextSentimentEvalSummary TextSentimentEvalSummary(Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary spanSentimentsEvaluation = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } } public partial class TextAuthoringAssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -753,23 +753,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TextAuthoringAssignDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal TextAuthoringAssignDeploymentResourcesState() { } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public System.DateTimeOffset? ExpiresOn { get { throw null; } } - public string JobId { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TextAuthoringAssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextAuthoringAssignedDeploymentResource() { } @@ -980,6 +963,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextAuthoringDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAuthoringDeploymentResourcesState() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextAuthoringDeploymentState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextAuthoringDeploymentState() { } @@ -1407,9 +1407,9 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string jobId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCopyProjectStatus(string jobId, Azure.RequestContext context) { throw null; } public virtual Azure.Response GetCopyProjectStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string jobId, Azure.RequestContext context) { throw null; } @@ -1439,9 +1439,9 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string jobId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string jobId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1766,23 +1766,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TextAuthoringUnassignDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal TextAuthoringUnassignDeploymentResourcesState() { } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public System.DateTimeOffset? ExpiresOn { get { throw null; } } - public string JobId { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TextSentimentEvalSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextSentimentEvalSummary() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs index c3e132c8688b..c99e323e8d55 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs @@ -665,12 +665,13 @@ public TextAnalysisAuthoringClient(System.Uri endpoint, Azure.Core.TokenCredenti } public partial class TextAnalysisAuthoringClientOptions : Azure.Core.ClientOptions { - public TextAnalysisAuthoringClientOptions(Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public TextAnalysisAuthoringClientOptions(Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview) { } public enum ServiceVersion { V2023_04_01 = 1, V2023_04_15_Preview = 2, V2024_11_15_Preview = 3, + V2025_05_15_Preview = 4, } } public static partial class TextAnalysisAuthoringModelFactory @@ -703,7 +704,6 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.SingleLabelClassEvalSummary SingleLabelClassEvalSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } public static Azure.AI.Language.Text.Authoring.SingleLabelClassificationEvalSummary SingleLabelClassificationEvalSummary(System.Collections.Generic.IReadOnlyDictionary confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } public static Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary SpanSentimentEvalSummary(System.Collections.Generic.IReadOnlyDictionary confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary sentiments = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } - public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState TextAuthoringAssignDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedDeploymentResource TextAuthoringAssignedDeploymentResource(string azureResourceId = null, Azure.Core.AzureLocation region = default(Azure.Core.AzureLocation)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentMetadata TextAuthoringAssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedOn = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpiresOn = default(System.DateTimeOffset)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentsMetadata TextAuthoringAssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } @@ -714,6 +714,7 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.TextAuthoringCreateProjectDetails TextAuthoringCreateProjectDetails(Azure.AI.Language.Text.Authoring.TextAuthoringProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.TextAuthoringProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentDeleteFromResourcesState TextAuthoringDeploymentDeleteFromResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResource TextAuthoringDeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState TextAuthoringDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentState TextAuthoringDeploymentState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringDocumentEvalResult TextAuthoringDocumentEvalResult(string projectKind = null, string location = null, string language = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringEntityEvalSummary TextAuthoringEntityEvalSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } @@ -739,7 +740,6 @@ public static partial class TextAnalysisAuthoringModelFactory public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobDetails TextAuthoringTrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.TextAuthoringEvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.DataGenerationSetting dataGenerationSettings = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult TextAuthoringTrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.TextAuthoringSubTrainingState trainingStatus = null, Azure.AI.Language.Text.Authoring.TextAuthoringSubTrainingState evaluationStatus = null, System.DateTimeOffset? estimatedEndOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.AI.Language.Text.Authoring.TextAuthoringTrainingState TextAuthoringTrainingState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult result = null) { throw null; } - public static Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState TextAuthoringUnassignDeploymentResourcesState(string jobId = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus status = default(Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } public static Azure.AI.Language.Text.Authoring.TextSentimentEvalSummary TextSentimentEvalSummary(Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary spanSentimentsEvaluation = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } } public partial class TextAuthoringAssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -753,23 +753,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TextAuthoringAssignDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal TextAuthoringAssignDeploymentResourcesState() { } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public System.DateTimeOffset? ExpiresOn { get { throw null; } } - public string JobId { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TextAuthoringAssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextAuthoringAssignedDeploymentResource() { } @@ -980,6 +963,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextAuthoringDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAuthoringDeploymentResourcesState() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.TextAuthoringDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextAuthoringDeploymentState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextAuthoringDeploymentState() { } @@ -1407,9 +1407,9 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string jobId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCopyProjectStatus(string jobId, Azure.RequestContext context) { throw null; } public virtual Azure.Response GetCopyProjectStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string jobId, Azure.RequestContext context) { throw null; } @@ -1439,9 +1439,9 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string jobId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string jobId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1766,23 +1766,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TextAuthoringUnassignDeploymentResourcesState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal TextAuthoringUnassignDeploymentResourcesState() { } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public System.DateTimeOffset? ExpiresOn { get { throw null; } } - public string JobId { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public Azure.AI.Language.Text.Authoring.TextAuthoringOperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class TextSentimentEvalSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TextSentimentEvalSummary() { } From 760685261cceb624da1158f1e4d314d1298df636 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sun, 29 Jun 2025 01:47:29 -0700 Subject: [PATCH 19/47] add all sample lists. --- .../README.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 727aa5a60895..e6ce7b2e5150 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -3,14 +3,24 @@ Azure Text Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that provides tools for creating, managing, and deploying text processing and AI solutions. This client library offers the following features: * Creating and managing text analysis projects -* Importing and exporting text analysis projects -* Training models for text processing and analysis -* Evaluating trained models -* Deploying text processing models -* Swapping deployments for active models -* Canceling active training jobs +* Importing data into text analysis projects +* Exporting text analysis projects +* Retrieving project details +* Deleting projects +* Training models +* Canceling training jobs +* Retrieving model evaluation summaries +* Retrieving model evaluation results * Managing project snapshots -* Deleting trained models and deployments +* Deleting trained models +* Swapping deployments +* Deleting deployments +* Deploying trained models +* Retrieving deployment details +* Assigning deployment resources +* Checking the status of assigned resource operations +* Unassigning deployment resources +* Checking the status of unassigned resource operations [Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][text_refdocs] | [Product documentation][text_docs] | [Samples][source_samples] From 4ae96ca7c20db5b34b1683172dd45169d0abd0f1 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sun, 29 Jun 2025 01:55:23 -0700 Subject: [PATCH 20/47] udpate the samples readme --- .../samples/README.md | 62 ++++++++++++------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md index 04e3a3ef4248..af0a1722fb53 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md @@ -15,27 +15,41 @@ Azure Text Authoring is part of the Azure Cognitive Service for Language, a clou ## Common Scenarios Samples -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) -* [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) +* [Create a New Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) +* [Import a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) +* [Export a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) +* [Deploy a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Deploy a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) +* [Get Deployment Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Get Deployment Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) +* [Assign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Assign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) +* [Get Deployment Resources Assignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Get Deployment Resources Assignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) +* [Unassign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Unassign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) +* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) +* [Get Deployment Resources Unassignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) From 54eccbc9477a4bf64cfe20eb51224891e5d42102 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Sun, 29 Jun 2025 04:42:03 -0700 Subject: [PATCH 21/47] update change log --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index 763f2527f1b1..7ba319f84dea 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -14,6 +14,11 @@ ### Other Changes - Added tests and samples for some legacy features. + - Get Deployment + - Assign Deployment Resources + - Get Assign Deployment Resources Status + - Unassign Deployment Resources + - Get Unassign Deployment Resources Status ## 1.0.0-beta.1 (2025-03-04) From a93f60e3b078bce05814d5dedaf9366c94098bec Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 11 Jul 2025 00:03:21 -0700 Subject: [PATCH 22/47] generate the importRawJson functions --- .../Internal/RequestContentHelper.cs | 136 +++++++++++++++ .../src/Generated/TextAuthoringProject.cs | 159 ++++++++++++++++++ .../tsp-location.yaml | 2 +- 3 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/RequestContentHelper.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/RequestContentHelper.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 000000000000..38ad705c475e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/RequestContentHelper.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + internal static class RequestContentHelper + { + public static RequestContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromObject(object value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); + return content; + } + + public static RequestContent FromObject(BinaryData value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs index 15db64dbfe81..7c9aa45b90ad 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs @@ -161,6 +161,142 @@ public virtual Response GetProjectDeletionStatus(string jobId, RequestContext co } } + /// + /// Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// A raw JSON string representing the entire project to import. + /// This string should match the format of an exported Text Authoring project. + /// + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, string exportedProject, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + + using RequestContent content = RequestContentHelper.FromObject(exportedProject); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportRawJsonAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); + } + + /// + /// Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// A raw JSON string representing the entire project to import. + /// This string should match the format of an exported Text Authoring project. + /// + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, string exportedProject, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + + using RequestContent content = RequestContentHelper.FromObject(exportedProject); + RequestContext context = FromCancellationToken(cancellationToken); + return ImportRawJson(waitUntil, projectName, content, format, context); + } + + /// + /// [Protocol Method] Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -334,6 +470,29 @@ internal HttpMessage CreateImportRequest(string projectName, RequestContent cont return message; } + internal HttpMessage CreateImportRawJsonRequest(string projectName, RequestContent content, string format, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (format != null) + { + request.Headers.Add("format", format); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index a12e45091d9e..6244f05a61f6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 4719bc50d889f2c313e8b4580596f884439eeaa8 +commit: 115496f0376d61aec2c19c22d7e4b6dacd35a9f6 repo: Azure/azure-rest-api-specs From ed36f14d3f52ab8546b7740b1a7c46850ea3bf79 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 11 Jul 2025 00:29:53 -0700 Subject: [PATCH 23/47] added custom import function for raw json string --- .../src/Generated/TextAuthoringProject.cs | 136 ------------------ .../src/TextAuthoringProject.cs | 135 +++++++++++++++++ 2 files changed, 135 insertions(+), 136 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs index 7c9aa45b90ad..968fb196ed1f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs @@ -161,142 +161,6 @@ public virtual Response GetProjectDeletionStatus(string jobId, RequestContext co } } - /// - /// Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// - /// A raw JSON string representing the entire project to import. - /// This string should match the format of an exported Text Authoring project. - /// - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, string exportedProject, string format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); - - using RequestContent content = RequestContentHelper.FromObject(exportedProject); - RequestContext context = FromCancellationToken(cancellationToken); - return await ImportRawJsonAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); - } - - /// - /// Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// - /// A raw JSON string representing the entire project to import. - /// This string should match the format of an exported Text Authoring project. - /// - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, string exportedProject, string format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); - - using RequestContent content = RequestContentHelper.FromObject(exportedProject); - RequestContext context = FromCancellationToken(cancellationToken); - return ImportRawJson(waitUntil, projectName, content, format, context); - } - - /// - /// [Protocol Method] Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs index 7444f0122fff..430348bd906d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Text; using System.Threading; using System.Threading.Tasks; using Autorest.CSharp.Core; @@ -60,6 +61,10 @@ namespace Azure.AI.Language.Text.Authoring [CodeGenSuppress("Export", typeof(WaitUntil), typeof(string), typeof(string), typeof(string), typeof(string), typeof(RequestContext))] [CodeGenSuppress("ImportAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] [CodeGenSuppress("Import", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] + [CodeGenSuppress("ImportRawJsonAsync", typeof(WaitUntil), typeof(string), typeof(string), typeof(String), typeof(CancellationToken))] + [CodeGenSuppress("ImportRawJson", typeof(WaitUntil), typeof(string), typeof(string), typeof(String), typeof(CancellationToken))] + [CodeGenSuppress("ImportRawJsonAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] + [CodeGenSuppress("ImportRawJson", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] [CodeGenSuppress("TrainAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(RequestContext))] [CodeGenSuppress("Train", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(RequestContext))] [CodeGenSuppress("CancelTrainingJobAsync", typeof(WaitUntil), typeof(string), typeof(string), typeof(RequestContext))] @@ -529,6 +534,136 @@ public virtual Operation Import(WaitUntil waitUntil, TextAuthoringExportedProjec return Import(waitUntil, content, format, context); } + /// + /// Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// + /// A raw JSON string representing the entire project to import. + /// This string should match the format of an exported Text Authoring project. + /// + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + public virtual async Task ImportAsync(WaitUntil waitUntil, string exportedProject, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); + Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + + using RequestContent content = RequestContent.Create(Encoding.UTF8.GetBytes(exportedProject)); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportRawJsonAsync(waitUntil, _projectName, content, format, context).ConfigureAwait(false); + } + + /// + /// Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// + /// A raw JSON string representing the entire project to import. + /// This string should match the format of an exported Text Authoring project. + /// + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + public virtual Operation Import(WaitUntil waitUntil, string exportedProject, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); + Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + + using RequestContent content = RequestContentHelper.FromObject(exportedProject); + RequestContext context = FromCancellationToken(cancellationToken); + return ImportRawJson(waitUntil, _projectName, content, format, context); + } + + /// + /// [Protocol Method] Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project using raw JSON string input. + /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. /// From be058f2e6b1758fa783b9a01f66da0e790747fdf Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 18 Jul 2025 13:47:10 -0700 Subject: [PATCH 24/47] add the tests and samples for importRawString --- .../samples/Sample2_TextAuthoring_Import.md | 55 +++++++++++- .../Sample2_TextAuthoring_ImportAsync.md | 55 +++++++++++- .../Samples/Sample2_TextAuthoring_Import.cs | 58 +++++++++++++ .../Sample2_TextAuthoring_ImportAsync.cs | 58 +++++++++++++ .../ImportAsync.json | 87 +++++++++++++------ .../ImportAsyncAsync.json | 56 ++++++------ .../ImportRawStringAsync.json | 78 +++++++++++++++++ .../ImportRawStringAsyncAsync.json | 78 +++++++++++++++++ .../tests/TextAuthoringClientLiveTest.cs | 61 ++++++++++++- 9 files changed, 525 insertions(+), 61 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsync.json create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsyncAsync.json diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index d331c7b255d1..0e4d8f28a38a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -15,7 +15,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c ## Import Project Data Synchronously -To import project data, call Import on the TextAnalysisAuthoring client. +To import project data synchronously, call Import on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_Import string projectName = "MyImportProject"; @@ -142,4 +142,55 @@ Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); ``` -To import project data synchronously, call Import on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. +## Import Project Data Using Raw JSON String Synchronously + +To import project data from a raw JSON string synchronously, call Import on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. + +```C# Snippet:Sample2_TextAuthoring_ImportRawString +string projectName = "MyImportRawStringProject"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +string rawJson = """ +{ + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } +} +"""; + +Operation operation = projectClient.Import( + waitUntil: WaitUntil.Started, + exportedProject: rawJson +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index cf8c63c1a701..73b8f376bbe5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -15,7 +15,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c ## Import Project Data Asynchronously -To import project data, call ImportAsync on the TextAnalysisAuthoring client. +To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_ImportAsync string projectName = "MyImportProjectAsync"; @@ -140,4 +140,55 @@ Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); ``` -To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. +## Import Project Data from Raw JSON String Asynchronously + +To import project data from a raw JSON string asynchronously, call ImportAsync on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. + +```C# Snippet:Sample2_TextAuthoring_ImportRawStringAsync +string projectName = "MyImportRawStringProjectAsync"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +string rawJson = """ +{ + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } +} +"""; + +Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Started, + exportedProject: rawJson +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index 7020743e093b..14489bf2c349 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -147,5 +147,63 @@ public void Import() Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); #endregion } + + [Test] + [SyncOnly] + public void ImportRawString() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_ImportRawString + string projectName = "MyImportRawStringProject"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + string rawJson = """ + { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } + } + """; + + Operation operation = projectClient.Import( + waitUntil: WaitUntil.Started, + exportedProject: rawJson + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs index 78500aafbee5..b4093aa56075 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs @@ -145,5 +145,63 @@ public async Task ImportAsync() Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); #endregion } + + [Test] + [AsyncOnly] + public async Task ImportRawStringAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_ImportRawStringAsync + string projectName = "MyImportRawStringProjectAsync"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + string rawJson = """ + { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } + } + """; + + Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Started, + exportedProject: rawJson + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json index 99892174a11c..d90181de52f5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json @@ -1,14 +1,14 @@ { "Entries": [ { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/:import?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Content-Length": "785", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -58,24 +58,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "11e81652-0c1a-4d6d-bd17-0f7971a3a29d", + "apim-request-id": "97a3dcbb-47bb-4f04-90ff-b74cd11c06a7", "Content-Length": "0", - "Date": "Tue, 03 Jun 2025 21:46:37 GMT", - "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", - "request-id": "11e81652-0c1a-4d6d-bd17-0f7971a3a29d", + "Date": "Fri, 18 Jul 2025 00:52:30 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000?api-version=2025-05-15-preview", + "request-id": "97a3dcbb-47bb-4f04-90ff-b74cd11c06a7", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "275", + "x-envoy-upstream-service-time": "555", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -83,30 +83,61 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "b4ee2040-896c-4a79-82d4-28cab870c1a4", + "apim-request-id": "c117dd31-6dde-4f32-97a5-7e0f516ce203", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 18 Jul 2025 00:52:30 GMT", + "request-id": "c117dd31-6dde-4f32-97a5-7e0f516ce203", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000", + "createdDateTime": "2025-07-18T00:52:30Z", + "lastUpdatedDateTime": "2025-07-18T00:52:30Z", + "expirationDateTime": "2025-07-25T00:52:30Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000?api-version=2025-05-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "052100ad-86b3-4d6d-9814-7f7e2f8ef3c2", "Content-Length": "216", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 03 Jun 2025 21:46:38 GMT", - "request-id": "b4ee2040-896c-4a79-82d4-28cab870c1a4", + "Date": "Fri, 18 Jul 2025 00:52:31 GMT", + "request-id": "052100ad-86b3-4d6d-9814-7f7e2f8ef3c2", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "42", + "x-envoy-upstream-service-time": "39", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000", - "createdDateTime": "2025-06-03T21:46:38Z", - "lastUpdatedDateTime": "2025-06-03T21:46:38Z", - "expirationDateTime": "2025-06-10T21:46:38Z", + "jobId": "d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000", + "createdDateTime": "2025-07-18T00:52:30Z", + "lastUpdatedDateTime": "2025-07-18T00:52:30Z", + "expirationDateTime": "2025-07-25T00:52:30Z", "status": "running" } }, { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -114,21 +145,21 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "ff2ab8f8-da2a-4f20-a5a7-15e69ebc1951", + "apim-request-id": "3d5bce61-b859-4b71-aeed-366609932fc6", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 03 Jun 2025 21:46:39 GMT", - "request-id": "ff2ab8f8-da2a-4f20-a5a7-15e69ebc1951", + "Date": "Fri, 18 Jul 2025 00:52:32 GMT", + "request-id": "3d5bce61-b859-4b71-aeed-366609932fc6", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "39", + "x-envoy-upstream-service-time": "124", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "2804b66f-fff1-4b47-b614-08c2a9d0713a_638845056000000000", - "createdDateTime": "2025-06-03T21:46:38Z", - "lastUpdatedDateTime": "2025-06-03T21:46:38Z", - "expirationDateTime": "2025-06-10T21:46:38Z", + "jobId": "d114cc40-fa6e-4b1a-be69-03af38790001_638883936000000000", + "createdDateTime": "2025-07-18T00:52:30Z", + "lastUpdatedDateTime": "2025-07-18T00:52:32Z", + "expirationDateTime": "2025-07-25T00:52:30Z", "status": "succeeded" } } @@ -136,6 +167,6 @@ "Variables": { "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "188152870" + "RandomSeed": "469951714" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json index e2f414538cc8..eec48438cbc9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json @@ -1,14 +1,14 @@ { "Entries": [ { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/:import?api-version=2025-05-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Content-Length": "785", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -58,24 +58,24 @@ "StatusCode": 202, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "c38a5fb6-13b0-431a-834b-37a9c472ba83", + "apim-request-id": "a997f644-7bb8-425e-93d3-6a18f99fb782", "Content-Length": "0", - "Date": "Tue, 03 Jun 2025 21:46:39 GMT", - "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", - "request-id": "c38a5fb6-13b0-431a-834b-37a9c472ba83", + "Date": "Fri, 18 Jul 2025 00:52:33 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/f4ef4f63-cfe6-4c8b-8500-ea5177b3e8d2_638883936000000000?api-version=2025-05-15-preview", + "request-id": "a997f644-7bb8-425e-93d3-6a18f99fb782", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "250", + "x-envoy-upstream-service-time": "189", "x-ms-region": "East US" }, "ResponseBody": null }, { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/f4ef4f63-cfe6-4c8b-8500-ea5177b3e8d2_638883936000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -83,30 +83,30 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "07f0cbdf-4833-44db-8d17-7cde665fb3ef", + "apim-request-id": "77407c2e-e922-4426-83fc-ba0e7604d4d7", "Content-Length": "219", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 03 Jun 2025 21:46:39 GMT", - "request-id": "07f0cbdf-4833-44db-8d17-7cde665fb3ef", + "Date": "Fri, 18 Jul 2025 00:52:33 GMT", + "request-id": "77407c2e-e922-4426-83fc-ba0e7604d4d7", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "29", + "x-envoy-upstream-service-time": "39", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000", - "createdDateTime": "2025-06-03T21:46:39Z", - "lastUpdatedDateTime": "2025-06-03T21:46:39Z", - "expirationDateTime": "2025-06-10T21:46:39Z", + "jobId": "f4ef4f63-cfe6-4c8b-8500-ea5177b3e8d2_638883936000000000", + "createdDateTime": "2025-07-18T00:52:33Z", + "lastUpdatedDateTime": "2025-07-18T00:52:33Z", + "expirationDateTime": "2025-07-25T00:52:33Z", "status": "notStarted" } }, { - "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000?api-version=2025-05-15-preview", + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject0717/import/jobs/f4ef4f63-cfe6-4c8b-8500-ea5177b3e8d2_638883936000000000?api-version=2025-05-15-preview", "RequestMethod": "GET", "RequestHeaders": { "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250603.1 (.NET 9.0.5; Microsoft Windows 10.0.26100)", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250717.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", "x-ms-client-request-id": "Sanitized", "x-ms-return-client-request-id": "true" }, @@ -114,21 +114,21 @@ "StatusCode": 200, "ResponseHeaders": { "Access-Control-Expose-Headers": "*", - "apim-request-id": "cfce9788-6f9f-411f-9874-ce84edd0df6c", + "apim-request-id": "862edfda-0e75-44e5-b74e-3b12397385a0", "Content-Length": "218", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 03 Jun 2025 21:46:40 GMT", - "request-id": "cfce9788-6f9f-411f-9874-ce84edd0df6c", + "Date": "Fri, 18 Jul 2025 00:52:34 GMT", + "request-id": "862edfda-0e75-44e5-b74e-3b12397385a0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "30", + "x-envoy-upstream-service-time": "37", "x-ms-region": "East US" }, "ResponseBody": { - "jobId": "13bd338c-e607-4eda-bcf9-e54d5684acf5_638845056000000000", - "createdDateTime": "2025-06-03T21:46:39Z", - "lastUpdatedDateTime": "2025-06-03T21:46:40Z", - "expirationDateTime": "2025-06-10T21:46:39Z", + "jobId": "f4ef4f63-cfe6-4c8b-8500-ea5177b3e8d2_638883936000000000", + "createdDateTime": "2025-07-18T00:52:33Z", + "lastUpdatedDateTime": "2025-07-18T00:52:34Z", + "expirationDateTime": "2025-07-25T00:52:33Z", "status": "succeeded" } } @@ -136,6 +136,6 @@ "Variables": { "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", "AZURE_TEXT_AUTHORING_KEY": "Sanitized", - "RandomSeed": "1980914448" + "RandomSeed": "129444462" } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsync.json new file mode 100644 index 000000000000..9f0ea6f80c2e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsync.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProjectRaw0718/:import?api-version=2025-05-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "1016", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250718.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { + "category": "Date" + }, + { + "category": "LenderName" + }, + { + "category": "LenderAddress" + } + ], + "documents": [ + { + "class": { + "category": "Date" + }, + "location": "01.txt", + "language": "en" + }, + { + "class": { + "category": "LenderName" + }, + "location": "02.txt", + "language": "en" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3544ea37-4662-4877-8685-1fb742258be4", + "Content-Length": "0", + "Date": "Fri, 18 Jul 2025 17:17:27 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProjectRaw0718/import/jobs/a4d37d9d-eae1-4540-ab0d-066dd2c08f91_638883936000000000?api-version=2025-05-15-preview", + "request-id": "3544ea37-4662-4877-8685-1fb742258be4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "149", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "247989509" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsyncAsync.json new file mode 100644 index 000000000000..17e2ad1d59be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportRawStringAsyncAsync.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProjectRaw0718/:import?api-version=2025-05-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "1016", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20250718.1 (.NET 9.0.7; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { + "category": "Date" + }, + { + "category": "LenderName" + }, + { + "category": "LenderAddress" + } + ], + "documents": [ + { + "class": { + "category": "Date" + }, + "location": "01.txt", + "language": "en" + }, + { + "class": { + "category": "LenderName" + }, + "location": "02.txt", + "language": "en" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "95b4f384-44da-4329-902e-a2d874323f83", + "Content-Length": "0", + "Date": "Fri, 18 Jul 2025 17:17:28 GMT", + "operation-location": "https://sdk-test-01.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProjectRaw0718/import/jobs/16b5cc6d-18ef-45dc-87cd-88f491f32e51_638883936000000000?api-version=2025-05-15-preview", + "request-id": "95b4f384-44da-4329-902e-a2d874323f83", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "337", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://sdk-test-01.cognitiveservices.azure.com/", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1610496894" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index e22b73e01942..c850f4f8cfc2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -56,7 +56,7 @@ public async Task GetProjectAsync() public async Task ImportAsync() { // Arrange - string projectName = "MyImportTextProject"; + string projectName = "MyImportTextProject0717"; var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", @@ -119,6 +119,65 @@ public async Task ImportAsync() Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); } + [RecordedTest] + public async Task ImportRawStringAsync() + { + // Arrange + string projectName = "MyImportTextProjectRaw0718"; + + string rawJson = """ + { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "single-class-example", + "language": "en", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "CustomSingleLabelClassification", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } + } + """; + + TextAuthoringProject projectClient = client.GetProject(projectName); + + // Act + Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Started, + exportedProject: rawJson + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(202, operation.GetRawResponse().Status); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + } + [RecordedTest] public async Task CreateProjectAsync() { From 9a3339a12e09651afc066bec769f271f3b548511 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 18 Jul 2025 14:29:19 -0700 Subject: [PATCH 25/47] Run the Export-API.ps1 --- .../api/Azure.AI.Language.QuestionAnswering.net8.0.cs | 4 +--- .../Azure.AI.Language.QuestionAnswering.netstandard2.0.cs | 4 +--- .../api/Azure.AI.Language.Text.Authoring.net8.0.cs | 6 ++++-- .../api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs | 6 ++++-- .../Custom/AzureAILanguageTextAuthoringContext.Custom.cs | 2 -- .../Azure.AI.Language.Text.Authoring/tsp-location.yaml | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.net8.0.cs index 94d0ceec6c34..3a7490b7ca64 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.net8.0.cs @@ -39,9 +39,7 @@ internal AnswersResult() { } } public partial class AzureAILanguageQuestionAnsweringContext : System.ClientModel.Primitives.ModelReaderWriterContext { - internal AzureAILanguageQuestionAnsweringContext() { } - public static Azure.AI.Language.QuestionAnswering.AzureAILanguageQuestionAnsweringContext Default { get { throw null; } } - protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + public AzureAILanguageQuestionAnsweringContext() { } } public partial class KnowledgeBaseAnswer { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs index 8cd7910505dc..a32b3e384a14 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs @@ -39,9 +39,7 @@ internal AnswersResult() { } } public partial class AzureAILanguageQuestionAnsweringContext : System.ClientModel.Primitives.ModelReaderWriterContext { - internal AzureAILanguageQuestionAnsweringContext() { } - public static Azure.AI.Language.QuestionAnswering.AzureAILanguageQuestionAnsweringContext Default { get { throw null; } } - protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + public AzureAILanguageQuestionAnsweringContext() { } } public partial class KnowledgeBaseAnswer { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs index b747453d8254..183f055135bd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs @@ -45,7 +45,6 @@ namespace Azure.AI.Language.Text.Authoring [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.SingleLabelClassificationEvalSummary))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesDetails))] - [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedDeploymentResource))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentMetadata))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentsMetadata))] @@ -97,7 +96,6 @@ namespace Azure.AI.Language.Text.Authoring [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringTrainingState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesDetails))] - [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextSentimentEvalSummary))] public partial class AzureAILanguageTextAuthoringContext : System.ClientModel.Primitives.ModelReaderWriterContext { @@ -1543,8 +1541,12 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs index a163fb15e943..f2030383d332 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs @@ -45,7 +45,6 @@ namespace Azure.AI.Language.Text.Authoring [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.SingleLabelClassificationEvalSummary))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.SpanSentimentEvalSummary))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesDetails))] - [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignDeploymentResourcesState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedDeploymentResource))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentMetadata))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringAssignedProjectDeploymentsMetadata))] @@ -97,7 +96,6 @@ namespace Azure.AI.Language.Text.Authoring [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringTrainingJobResult))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringTrainingState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesDetails))] - [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextAuthoringUnassignDeploymentResourcesState))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.AI.Language.Text.Authoring.TextSentimentEvalSummary))] public partial class AzureAILanguageTextAuthoringContext : System.ClientModel.Primitives.ModelReaderWriterContext { @@ -1543,8 +1541,12 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Custom/AzureAILanguageTextAuthoringContext.Custom.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Custom/AzureAILanguageTextAuthoringContext.Custom.cs index 0914e3ecfc0a..58c3924958f3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Custom/AzureAILanguageTextAuthoringContext.Custom.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Custom/AzureAILanguageTextAuthoringContext.Custom.cs @@ -51,7 +51,6 @@ namespace Azure.AI.Language.Text.Authoring; [ModelReaderWriterBuildable(typeof(SingleLabelClassificationEvalSummary))] [ModelReaderWriterBuildable(typeof(SpanSentimentEvalSummary))] [ModelReaderWriterBuildable(typeof(TextAuthoringAssignDeploymentResourcesDetails))] -[ModelReaderWriterBuildable(typeof(TextAuthoringAssignDeploymentResourcesState))] [ModelReaderWriterBuildable(typeof(TextAuthoringAssignedDeploymentResource))] [ModelReaderWriterBuildable(typeof(TextAuthoringAssignedProjectDeploymentMetadata))] [ModelReaderWriterBuildable(typeof(TextAuthoringAssignedProjectDeploymentsMetadata))] @@ -103,7 +102,6 @@ namespace Azure.AI.Language.Text.Authoring; [ModelReaderWriterBuildable(typeof(TextAuthoringTrainingJobResult))] [ModelReaderWriterBuildable(typeof(TextAuthoringTrainingState))] [ModelReaderWriterBuildable(typeof(TextAuthoringUnassignDeploymentResourcesDetails))] -[ModelReaderWriterBuildable(typeof(TextAuthoringUnassignDeploymentResourcesState))] [ModelReaderWriterBuildable(typeof(TextSentimentEvalSummary))] [ModelReaderWriterBuildable(typeof(UnknownTextAuthoringDocumentEvalResult))] [ModelReaderWriterBuildable(typeof(UnknownTextAuthoringEvalSummary))] diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index 6244f05a61f6..25065a6a159d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 115496f0376d61aec2c19c22d7e4b6dacd35a9f6 +commit: 5aff21521cee26a365806b2a2da3e9cdc2abab58 repo: Azure/azure-rest-api-specs From 65c17d8527f095480a446855685ab27b62b7128c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 18 Jul 2025 15:23:57 -0700 Subject: [PATCH 26/47] add import raw json string to change log --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index 7ba319f84dea..8075b1dd862b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features Added +- Added import feature for raw json string. - Added support for Custom Text Authoring API Versions - 2025-05-15-preview From eab0b040ccd65df5058115096bd57f86e59a169c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Sun, 20 Jul 2025 15:51:52 -0700 Subject: [PATCH 27/47] modify the release date in change log --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index 8075b1dd862b..d87b1badc2b7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2025-07-21) ### Features Added From fd75531f0ea20a133158a033859d9c2a7fd91abe Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 13:44:15 -0700 Subject: [PATCH 28/47] Remove commented-out code in tests --- .../tests/TextAuthoringClientLiveTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index c850f4f8cfc2..76347ed145e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -42,7 +42,6 @@ public async Task GetProjectAsync() Assert.IsNotNull(projectMetadata.CreatedOn); Assert.IsNotNull(projectMetadata.LastModifiedOn); Assert.IsNotNull(projectMetadata.StorageInputContainerName); - //Assert.IsNotNull(projectMetadata.StorageAccountResourceId); Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); Console.WriteLine($"Language: {projectMetadata.Language}"); From 49f74fcb27e460908dc84facd13bebbe11bb3f6c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 14:13:55 -0700 Subject: [PATCH 29/47] updated the commit id --- .../Azure.AI.Language.Text.Authoring/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index 25065a6a159d..1cad9473a253 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 5aff21521cee26a365806b2a2da3e9cdc2abab58 +commit: 0b4fa7854c30d7ac75405bc8ec804e195e3058da repo: Azure/azure-rest-api-specs From 21c278e6d0129d5600c569ced94b701008f4796c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 14:15:30 -0700 Subject: [PATCH 30/47] change the date of release to 07-24 --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index d87b1badc2b7..a069dcb5cfbf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.2 (2025-07-21) +## 1.0.0-beta.2 (2025-07-24) ### Features Added From 5068a35fa5a61a8e506061923e3e55af1180875e Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 16:56:12 -0700 Subject: [PATCH 31/47] udpate the sample links from amber to main --- .../README.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index e6ce7b2e5150..cd4b3a135ec4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -150,46 +150,46 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples -You can familiarize yourself with different APIs using [Samples](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). - -* [Create a New Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) -* [Create a New Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) -* [Import a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) -* [Import a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) -* [Export a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) -* [Export a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) -* [Get Project Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) -* [Get Project Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) -* [Delete a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) -* [Delete a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) -* [Train a Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) -* [Train a Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) -* [Cancel Training Job (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) -* [Cancel Training Job (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) -* [Get Model Evaluation Summary (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) -* [Get Model Evaluation Summary (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) -* [Get Model Evaluation Results (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) -* [Get Model Evaluation Results (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) -* [Load Snapshot (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) -* [Load Snapshot (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) -* [Delete a Trained Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) -* [Delete a Trained Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) -* [Swap Deployments (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) -* [Swap Deployments (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) -* [Delete a Deployment (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) -* [Delete a Deployment (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) -* [Deploy a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) -* [Deploy a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) -* [Get Deployment Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) -* [Get Deployment Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) -* [Assign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) -* [Assign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) -* [Get Deployment Resources Assignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) -* [Get Deployment Resources Assignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) -* [Unassign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) -* [Unassign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) -* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) -* [Get Deployment Resources Unassignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). + +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) +* [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) +* [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) +* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) +* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) +* [Get Deployment Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Get Deployment Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) +* [Assign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Assign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) +* [Get Deployment Resources Assignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Get Deployment Resources Assignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) +* [Unassign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Unassign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) +* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) +* [Get Deployment Resources Unassignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) ## Troubleshooting From 15547059f822954a34e3b54c67a8cd14a4c2120c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 17:00:06 -0700 Subject: [PATCH 32/47] update the api version in readme --- .../Azure.AI.Language.Text.Authoring/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index cd4b3a135ec4..79360398a52b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -38,8 +38,8 @@ dotnet add package Azure.AI.Language.Text.Authoring --prerelease |SDK version |Supported API version of service |-------------|------------------------------------------------------------------------------ -|1.0.0-beta.1 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview (default) -|1.0.0-beta.2 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview, 2025-05-15-preview (default) +|1.0.0-beta.1 | 2023-04-01, 2023-04-15-preview, 2024-11-15-preview (default) +|1.0.0-beta.2 | 2023-04-01, 2023-04-15-preview, 2024-11-15-preview, 2025-05-15-preview (default) ### Prerequisites From c8620c6ae73536cccfcb17f7b0ca83323a3615b1 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 21:33:29 -0700 Subject: [PATCH 33/47] updated the sample links in samples/README from amber to main --- .../samples/README.md | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md index af0a1722fb53..5ad9fb7bc99f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md @@ -15,41 +15,41 @@ Azure Text Authoring is part of the Azure Cognitive Service for Language, a clou ## Common Scenarios Samples -* [Create a New Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) -* [Create a New Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) -* [Import a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) -* [Import a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) -* [Export a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) -* [Export a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) -* [Get Project Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) -* [Get Project Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) -* [Delete a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) -* [Delete a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) -* [Train a Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) -* [Train a Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) -* [Cancel Training Job (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) -* [Cancel Training Job (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) -* [Get Model Evaluation Summary (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) -* [Get Model Evaluation Summary (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) -* [Get Model Evaluation Results (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) -* [Get Model Evaluation Results (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) -* [Load Snapshot (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) -* [Load Snapshot (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) -* [Delete a Trained Model (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) -* [Delete a Trained Model (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) -* [Swap Deployments (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) -* [Swap Deployments (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) -* [Delete a Deployment (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) -* [Delete a Deployment (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) -* [Deploy a Project (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) -* [Deploy a Project (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) -* [Get Deployment Details (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) -* [Get Deployment Details (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) -* [Assign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) -* [Assign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) -* [Get Deployment Resources Assignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) -* [Get Deployment Resources Assignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) -* [Unassign Deployment Resources (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) -* [Unassign Deployment Resources (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) -* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) -* [Get Deployment Resources Unassignment Status (Async)](https://github.com/amber-ccc/azure-sdk-for-net/blob/amber/create_text_authoring_sdk_preview_20250515/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) +* [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) +* [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) +* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) +* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) +* [Get Deployment Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Get Deployment Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) +* [Assign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Assign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) +* [Get Deployment Resources Assignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Get Deployment Resources Assignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) +* [Unassign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Unassign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) +* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) +* [Get Deployment Resources Unassignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) From 539ec625b45100b4769d4d63475062fcef5514df Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 22:16:28 -0700 Subject: [PATCH 34/47] udpate all projectname, modellable, deployname to placeholder in samples --- .../samples/Sample10_TextAuthoring_LoadSnapshot.md | 4 ++-- .../samples/Sample10_TextAuthoring_LoadSnapshotAsync.md | 4 ++-- .../samples/Sample11_TextAuthoring_DeleteTrainedModel.md | 4 ++-- .../Sample11_TextAuthoring_DeleteTrainedModelAsync.md | 4 ++-- .../samples/Sample12_TextAuthoring_SwapDeployments.md | 6 +++--- .../samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md | 6 +++--- .../samples/Sample13_TextAuthoring_DeleteDeployment.md | 4 ++-- .../samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md | 4 ++-- .../samples/Sample14_TextAuthoring_DeployProject.md | 6 +++--- .../samples/Sample14_TextAuthoring_DeployProjectAsync.md | 6 +++--- .../samples/Sample15_TextAuthoring_GetDeployment.md | 4 ++-- .../samples/Sample15_TextAuthoring_GetDeploymentAsync.md | 4 ++-- .../Sample16_TextAuthoring_AssignDeploymentResources.md | 2 +- ...Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md | 2 +- ...le17_TextAuthoring_GetAssignDeploymentResourcesStatus.md | 2 +- ...TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md | 2 +- .../Sample18_TextAuthoring_UnassignDeploymentResources.md | 2 +- ...mple18_TextAuthoring_UnassignDeploymentResourcesAsync.md | 2 +- ...19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md | 2 +- ...xtAuthoring_GetUnassignDeploymentResourcesStatusAsync.md | 2 +- .../samples/Sample1_TextAuthoring_CreateProject.md | 2 +- .../samples/Sample1_TextAuthoring_CreateProjectAsync.md | 2 +- .../samples/Sample2_TextAuthoring_Import.md | 4 ++-- .../samples/Sample2_TextAuthoring_ImportAsync.md | 4 ++-- .../samples/Sample3_TextAuthoring_Export.md | 2 +- .../samples/Sample3_TextAuthoring_ExportAsync.md | 2 +- .../samples/Sample4_TextAuthoring_GetProject.md | 2 +- .../samples/Sample4_TextAuthoring_GetProjectAsync.md | 2 +- .../samples/Sample5_TextAuthoring_DeleteProject.md | 2 +- .../samples/Sample5_TextAuthoring_DeleteProjectAsync.md | 2 +- .../samples/Sample6_TextAuthoring_Train.md | 4 ++-- .../samples/Sample6_TextAuthoring_TrainAsync.md | 4 ++-- .../samples/Sample7_TextAuthoring_CancelTrainingJob.md | 2 +- .../samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md | 2 +- .../Sample8_TextAuthoring_GetModelEvaluationSummary.md | 4 ++-- .../Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResults.md | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md | 4 ++-- .../tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs | 4 ++-- .../Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs | 4 ++-- .../Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs | 4 ++-- .../Sample11_TextAuthoring_DeleteTrainedModelAsync.cs | 4 ++-- .../tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs | 6 +++--- .../Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs | 6 +++--- .../Samples/Sample13_TextAuthoring_DeleteDeployment.cs | 4 ++-- .../Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs | 4 ++-- .../tests/Samples/Sample14_TextAuthoring_DeployProject.cs | 6 +++--- .../Samples/Sample14_TextAuthoring_DeployProjectAsync.cs | 6 +++--- .../tests/Samples/Sample15_TextAuthoring_GetDeployment.cs | 4 ++-- .../Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs | 4 ++-- .../Sample16_TextAuthoring_AssignDeploymentResources.cs | 2 +- ...Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs | 2 +- ...le17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs | 2 +- ...TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs | 2 +- .../Sample18_TextAuthoring_UnassignDeploymentResources.cs | 2 +- ...mple18_TextAuthoring_UnassignDeploymentResourcesAsync.cs | 2 +- ...19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs | 2 +- ...xtAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs | 2 +- .../tests/Samples/Sample1_TextAuthoring_CreateProject.cs | 2 +- .../Samples/Sample1_TextAuthoring_CreateProjectAsync.cs | 2 +- .../tests/Samples/Sample2_TextAuthoring_Import.cs | 4 ++-- .../tests/Samples/Sample2_TextAuthoring_ImportAsync.cs | 4 ++-- .../tests/Samples/Sample3_TextAuthoring_Export.cs | 2 +- .../tests/Samples/Sample3_TextAuthoring_ExportAsync.cs | 2 +- .../tests/Samples/Sample4_TextAuthoring_GetProject.cs | 2 +- .../tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs | 2 +- .../tests/Samples/Sample5_TextAuthoring_DeleteProject.cs | 2 +- .../Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs | 2 +- .../tests/Samples/Sample6_TextAuthoring_Train.cs | 4 ++-- .../tests/Samples/Sample6_TextAuthoring_TrainAsync.cs | 4 ++-- .../Samples/Sample7_TextAuthoring_CancelTrainingJob.cs | 2 +- .../Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs | 2 +- .../Sample8_TextAuthoring_GetModelEvaluationSummary.cs | 4 ++-- .../Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResults.cs | 4 ++-- .../Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs | 4 ++-- 76 files changed, 124 insertions(+), 124 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index 01ac82f46319..68cac5fb5bd6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshot on the TextAnalysisAuthoring client. ```C# Snippet:Sample10_TextAuthoring_LoadSnapshot -string projectName = "MySnapshotProject"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = trainedModelClient.LoadSnapshot( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index 2936d872f622..7669fd0ceb90 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample10_TextAuthoring_LoadSnapshotAsync -string projectName = "MySnapshotProjectAsync"; -string trainedModelLabel = "model1"; // Replace with your actual model label. +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = await trainedModelClient.LoadSnapshotAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index c7e34b3b411e..2219b19f7860 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModel on the TextAnalysisAuthoring client. ```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModel -string projectName = "MyModelProject"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = trainedModelClient.DeleteTrainedModel(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index ff702fa144e0..2acbd31284d1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync -string projectName = "MyModelProjectAsync"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = await trainedModelClient.DeleteTrainedModelAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 206eb9506d39..f493061a3a38 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -18,9 +18,9 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. ```C# Snippet:Sample12_TextAuthoring_SwapDeployments -string projectName = "MySwapProject"; -string firstDeploymentName = "Deployment1"; -string secondDeploymentName = "Deployment2"; +string projectName = "{projectName}"; +string firstDeploymentName = "{deploymentName1}"; +string secondDeploymentName = "{deploymentName2}"; TextAuthoringProject porjectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index a6c78d6d1f01..042fff708f04 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -18,9 +18,9 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync -string projectName = "MySwapProjectAsync"; -string firstDeploymentName = "Deployment1"; -string secondDeploymentName = "Deployment2"; +string projectName = "{projectName}"; +string firstDeploymentName = "{deploymentName1}"; +string secondDeploymentName = "{deploymentName2}"; TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index 08e610a33f4f..27ca1363da32 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeployment on the TextAnalysisAuthoring client. ```C# Snippet:Sample13_TextAuthoring_DeleteDeployment -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = deploymentClient.DeleteDeployment( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index 537127fcb908..de26877b8ce4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = await deploymentClient.DeleteDeploymentAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index 8f95b41d78be..002664af1585 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -18,11 +18,11 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProject -string projectName = "MyDeploymentProject"; -string deploymentName = "Deployment1"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); -var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); Operation operation = deploymentClient.DeployProject( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index 357a57696cc6..22d7707cc480 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -18,11 +18,11 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); Operation operation = await deploymentClient.DeployProjectAsync( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index c92f888f448b..2e251037bb8e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve deployment details, call `GetDeployment` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. ```C# Snippet:Sample15_TextAuthoring_GetDeployment -string projectName = "MyDeploymentProject"; -string deploymentName = "MyDeployment"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Response response = deploymentClient.GetDeployment(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 06e2ac749859..487e3072b847 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. ```C# Snippet:Sample15_TextAuthoring_GetDeploymentAsync -string projectName = "MyDeploymentProjectAsync"; -string deploymentName = "Deployment1"; +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Response response = await deploymentClient.GetDeploymentAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index d44ccdf9496b..dd8997458204 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To assign deployment resources, call `AssignDeploymentResources` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. ```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResources -string projectName = "MyResourceProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index 3044efda0e46..ec4b8cbe93e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To assign deployment resources, call `AssignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. ```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync -string projectName = "MyResourceProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index be62fa0cf841..902173f17641 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatus` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. ```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus -string projectName = "MyResourceProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index 2b220d209ee0..4185664c979a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. ```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync -string projectName = "MyResourceProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 5cd831075f4b..16db14a6a98c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To unassign deployment resources, call `UnassignDeploymentResources` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. ```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResources -string projectName = "MyResourceProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index 44b77682e329..e000491a9454 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To unassign deployment resources, call `UnassignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. ```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync -string projectName = "MyResourceProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index bb6976443ea2..77b13648a877 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatus` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. ```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus -string projectName = "MyResourceProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index e794f720699e..58975dc608a9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. ```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync -string projectName = "MyResourceProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index a0221f598649..f399d221ba01 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To create a new project, call CreateProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample1_TextAuthoring_CreateProject -string projectName = "MyNewProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index 653737e9f85d..b4e192f345be 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample1_TextAuthoring_CreateProjectAsync -string projectName = "MyNewProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 0e4d8f28a38a..781f9c47f1c7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To import project data synchronously, call Import on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_Import -string projectName = "MyImportProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", @@ -147,7 +147,7 @@ Console.WriteLine($"Import completed with status: {operation.GetRawResponse().St To import project data from a raw JSON string synchronously, call Import on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_ImportRawString -string projectName = "MyImportRawStringProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string rawJson = """ diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index 73b8f376bbe5..3514729f156b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_ImportAsync -string projectName = "MyImportProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomEntityRecognition", @@ -145,7 +145,7 @@ Console.WriteLine($"Import completed with status: {operation.GetRawResponse().St To import project data from a raw JSON string asynchronously, call ImportAsync on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. ```C# Snippet:Sample2_TextAuthoring_ImportRawStringAsync -string projectName = "MyImportRawStringProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string rawJson = """ diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index c7b428248359..4ca33a2867b3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -17,7 +17,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To export project data, call `Export` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. ```C# Snippet:Sample3_TextAuthoring_Export -string projectName = "MyExportedProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.Export( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index 8c091d0a3fad..ef897000ec66 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. ```C# Snippet:Sample3_TextAuthoring_ExportAsync -string projectName = "MyExportedProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.ExportAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index 133b9e224d19..c9b8ac483021 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -15,7 +15,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve metadata of a project, call GetProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample4_TextAuthoring_GetProject -string projectName = "MyTextProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Response response = projectClient.GetProject(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index 6e8b795ac4f6..f112f9747b96 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample4_TextAuthoring_GetProjectAsync -string projectName = "MyTextProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Response response = await projectClient.GetProjectAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index e3e0330e9e29..65d433424134 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProject on the TextAnalysisAuthoring client. ```C# Snippet:Sample5_TextAuthoring_DeleteProject -string projectName = "MyProjectToDelete"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.DeleteProject( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index b7db0ef8b9cf..f61998742dcd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample5_TextAuthoring_DeleteProjectAsync -string projectName = "MyProjectToDeleteAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.DeleteProjectAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index e4458d1a8247..2d478489f155 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -18,11 +18,11 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call Train on the TextAnalysisAuthoring client. ```C# Snippet:Sample6_TextAuthoring_Train -string projectName = "MyTrainingProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobDetails = new TextAuthoringTrainingJobDetails( - modelLabel: "model1", + modelLabel: "{modelLabel}", trainingConfigVersion: "latest" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index 7f064d21809b..f8a0bc9561fe 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -18,11 +18,11 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To train a project, call TrainAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample6_TextAuthoring_TrainAsync -string projectName = "MyTrainingProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobConfig = new TextAuthoringTrainingJobDetails( - modelLabel: "model1", + modelLabel: "{modelLabel}", trainingConfigVersion: "latest" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 679a51e65f97..09f3d24842c6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring client. ```C# Snippet:Sample7_TextAuthoring_CancelTrainingJob -string projectName = "MyTrainingProject"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 9c7e2fcb6085..829d7f4cd017 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -18,7 +18,7 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync -string projectName = "MyTrainingProjectAsync"; +string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index a9dee87b257a..be83c874ec64 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummary on the TextAnalysisAuthoring client. ```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary -string projectName = "MyEvaluationProject"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index 9a189b3d3fe9..a96e5503a4df 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. ```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync -string projectName = "MyEvaluationProjectAsync"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index ba55859c93e8..214f07eb188f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve model evaluation results, call `GetModelEvaluationResults` on the `TextAuthoringTrainedModel` client. The method returns a `Pageable` that allows you to enumerate the evaluation results for each document. ```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResults -string projectName = "MyEvaluationProject"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index 3e29bebe0b8f..21bb521ba38e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -18,8 +18,8 @@ TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, c To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. ```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync -string projectName = "MyEvaluationProjectAsync"; -string trainedModelLabel = "model1"; +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs index 06b2db986057..6476e9679ffa 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs @@ -22,8 +22,8 @@ public void LoadSnapshot() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample10_TextAuthoring_LoadSnapshot - string projectName = "MySnapshotProject"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = trainedModelClient.LoadSnapshot( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs index 8398d664ba6c..d1873c83e45a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs @@ -23,8 +23,8 @@ public async Task LoadSnapshotAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample10_TextAuthoring_LoadSnapshotAsync - string projectName = "MySnapshotProjectAsync"; - string trainedModelLabel = "model1"; // Replace with your actual model label. + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Operation operation = await trainedModelClient.LoadSnapshotAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs index 03742709abd5..f1cd674d4087 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs @@ -22,8 +22,8 @@ public void DeleteTrainedModel() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample11_TextAuthoring_DeleteTrainedModel - string projectName = "MyModelProject"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = trainedModelClient.DeleteTrainedModel(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs index 78c301fa703b..f58b1c784abf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs @@ -23,8 +23,8 @@ public async Task DeleteTrainedModelAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync - string projectName = "MyModelProjectAsync"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); Response response = await trainedModelClient.DeleteTrainedModelAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index be928f777c85..1118880fd545 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -22,9 +22,9 @@ public void SwapDeployments() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample12_TextAuthoring_SwapDeployments - string projectName = "MySwapProject"; - string firstDeploymentName = "Deployment1"; - string secondDeploymentName = "Deployment2"; + string projectName = "{projectName}"; + string firstDeploymentName = "{deploymentName1}"; + string secondDeploymentName = "{deploymentName2}"; TextAuthoringProject porjectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs index 9154fa8e5eb3..69e221ac287e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs @@ -23,9 +23,9 @@ public async Task SwapDeploymentsAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync - string projectName = "MySwapProjectAsync"; - string firstDeploymentName = "Deployment1"; - string secondDeploymentName = "Deployment2"; + string projectName = "{projectName}"; + string firstDeploymentName = "{deploymentName1}"; + string secondDeploymentName = "{deploymentName2}"; TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs index 0979539a46ac..e09ced843d9d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs @@ -22,8 +22,8 @@ public void DeleteDeployment() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample13_TextAuthoring_DeleteDeployment - string projectName = "MyDeploymentProject"; - string deploymentName = "Deployment1"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = deploymentClient.DeleteDeployment( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs index 898193ddfcc7..bdba23eae1b3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs @@ -23,8 +23,8 @@ public async Task DeleteDeploymentAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync - string projectName = "MyDeploymentProjectAsync"; - string deploymentName = "Deployment1"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Operation operation = await deploymentClient.DeleteDeploymentAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs index 62a1e5a61e72..64e7cacac30d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs @@ -22,11 +22,11 @@ public void DeployProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample14_TextAuthoring_DeployProject - string projectName = "MyDeploymentProject"; - string deploymentName = "Deployment1"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var deploymentDetails = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); Operation operation = deploymentClient.DeployProject( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs index d969924e22a8..b103986d3666 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs @@ -23,11 +23,11 @@ public async Task DeployProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "MyDeploymentProjectAsync"; - string deploymentName = "Deployment1"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); Operation operation = await deploymentClient.DeployProjectAsync( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs index 69127ee00dd9..582bc95421ff 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -22,8 +22,8 @@ public void GetDeployment() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample15_TextAuthoring_GetDeployment - string projectName = "MyDeploymentProject"; - string deploymentName = "MyDeployment"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Response response = deploymentClient.GetDeployment(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs index f8a95d139d20..00b9dbf4241a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs @@ -23,8 +23,8 @@ public async Task GetDeploymentAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample15_TextAuthoring_GetDeploymentAsync - string projectName = "MyDeploymentProjectAsync"; - string deploymentName = "Deployment1"; + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); Response response = await deploymentClient.GetDeploymentAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index d9aa751cddf3..39c7aa9a2748 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -23,7 +23,7 @@ public void AssignDeploymentResources() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample16_TextAuthoring_AssignDeploymentResources - string projectName = "MyResourceProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs index 0580a48b7ee0..82db0c2ba053 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs @@ -24,7 +24,7 @@ public async Task AssignDeploymentResourcesAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync - string projectName = "MyResourceProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index e0ef8cabf878..0f0f1bf96e55 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -24,7 +24,7 @@ public void GetAssignDeploymentResourcesStatus() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus - string projectName = "MyResourceProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs index 7b2e0166e330..aaed53270082 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs @@ -26,7 +26,7 @@ public async Task GetAssignDeploymentResourcesStatusAsync() var client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync - string projectName = "MyResourceProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs index 22dcdcd705db..7120d478f5f9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -23,7 +23,7 @@ public void UnassignDeploymentResources() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResources - string projectName = "MyResourceProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs index 3bab828caa7b..1aa466802675 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs @@ -24,7 +24,7 @@ public async Task UnassignDeploymentResourcesAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync - string projectName = "MyResourceProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs index be5c21ae5d28..26a510c23e8c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -24,7 +24,7 @@ public void GetUnassignDeploymentResourcesStatus() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus - string projectName = "MyResourceProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs index 8c25564cf083..8601558dc295 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs @@ -25,7 +25,7 @@ public async Task GetUnassignDeploymentResourcesStatusAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync - string projectName = "MyResourceProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); // Prepare the details for unassigning resources diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index 3a21b25ea938..a1e60438486a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -22,7 +22,7 @@ public void CreateProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample1_TextAuthoring_CreateProject - string projectName = "MyNewProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs index 33373ccbc0ba..581f88e9dfe9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs @@ -23,7 +23,7 @@ public async Task CreateProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample1_TextAuthoring_CreateProjectAsync - string projectName = "MyNewProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( projectKind: "customMultiLabelClassification", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index 14489bf2c349..7ed95f2cc25e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -23,7 +23,7 @@ public void Import() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_Import - string projectName = "MyImportProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomSingleLabelClassification", @@ -157,7 +157,7 @@ public void ImportRawString() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_ImportRawString - string projectName = "MyImportRawStringProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string rawJson = """ diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs index b4093aa56075..d3e507c858af 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs @@ -23,7 +23,7 @@ public async Task ImportAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_ImportAsync - string projectName = "MyImportProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( projectKind: "CustomEntityRecognition", @@ -155,7 +155,7 @@ public async Task ImportRawStringAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample2_TextAuthoring_ImportRawStringAsync - string projectName = "MyImportRawStringProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string rawJson = """ diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs index 8b6a09d0ac65..92319b7797e4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -23,7 +23,7 @@ public void Export() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample3_TextAuthoring_Export - string projectName = "MyExportedProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.Export( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs index d58e20ed61ee..2af4dfcdfce4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs @@ -23,7 +23,7 @@ public async Task ExportAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample3_TextAuthoring_ExportAsync - string projectName = "MyExportedProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.ExportAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs index 896a23ac2a79..b0bb747c67f6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs @@ -22,7 +22,7 @@ public void GetProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample4_TextAuthoring_GetProject - string projectName = "MyTextProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Response response = projectClient.GetProject(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs index 12cf8f88a132..ca849dabf4d0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs @@ -23,7 +23,7 @@ public async Task GetProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample4_TextAuthoring_GetProjectAsync - string projectName = "MyTextProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Response response = await projectClient.GetProjectAsync(); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs index bdd55fc0dda3..73c442d75a0a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs @@ -22,7 +22,7 @@ public void DeleteProject() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample5_TextAuthoring_DeleteProject - string projectName = "MyProjectToDelete"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = projectClient.DeleteProject( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs index e5c7151bc1ef..ec3415a45e68 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs @@ -23,7 +23,7 @@ public async Task DeleteProjectAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample5_TextAuthoring_DeleteProjectAsync - string projectName = "MyProjectToDeleteAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); Operation operation = await projectClient.DeleteProjectAsync( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs index 29b0f09ecc6f..c2e8d32fec8d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs @@ -22,11 +22,11 @@ public void Train() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample6_TextAuthoring_Train - string projectName = "MyTrainingProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobDetails = new TextAuthoringTrainingJobDetails( - modelLabel: "model1", + modelLabel: "{modelLabel}", trainingConfigVersion: "latest" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs index c55e01f19849..3dc87a39138b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs @@ -23,11 +23,11 @@ public async Task TrainAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample6_TextAuthoring_TrainAsync - string projectName = "MyTrainingProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var trainingJobConfig = new TextAuthoringTrainingJobDetails( - modelLabel: "model1", + modelLabel: "{modelLabel}", trainingConfigVersion: "latest" ) { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index 8f8ef4bfd854..d721bafa5518 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -22,7 +22,7 @@ public void CancelTrainingJob() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample7_TextAuthoring_CancelTrainingJob - string projectName = "MyTrainingProject"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs index ee60a355ac16..d4334154509d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs @@ -23,7 +23,7 @@ public async Task CancelTrainingJobAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync - string projectName = "MyTrainingProjectAsync"; + string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); string jobId = "training-job-id"; // Replace with an actual job ID. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs index af38fe506619..4171ae7aaa11 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs @@ -22,8 +22,8 @@ public void GetModelEvaluationSummary() #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummary - string projectName = "MyEvaluationProject"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs index c3832d6b8166..e48c0ac6bde1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs @@ -22,8 +22,8 @@ public async Task GetModelEvaluationSummaryAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync - string projectName = "MyEvaluationProjectAsync"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); // Get the evaluation summary for the trained model diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs index 012b2ec9d4e2..f90b0431bae5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs @@ -22,8 +22,8 @@ public void GetModelEvaluationResults() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResults - string projectName = "MyEvaluationProject"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs index 0e8025d812f5..debcc49c6b21 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs @@ -23,8 +23,8 @@ public async Task GetModelEvaluationResultsAsync() TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync - string projectName = "MyEvaluationProjectAsync"; - string trainedModelLabel = "model1"; + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); From 966ab8b15a9a3ccee9481ee0e950a67cef6ae47e Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 22:24:07 -0700 Subject: [PATCH 35/47] fix a typo --- .../samples/Sample12_TextAuthoring_SwapDeployments.md | 4 ++-- .../tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index f493061a3a38..88f8d27904ce 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -21,14 +21,14 @@ To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. string projectName = "{projectName}"; string firstDeploymentName = "{deploymentName1}"; string secondDeploymentName = "{deploymentName2}"; -TextAuthoringProject porjectClient = client.GetProject(projectName); +TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( firstDeploymentName: firstDeploymentName, secondDeploymentName: secondDeploymentName ); -Operation operation = porjectClient.SwapDeployments( +Operation operation = projectClient.SwapDeployments( waitUntil: WaitUntil.Completed, details: swapDetails ); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index 1118880fd545..88e681a33d75 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -25,14 +25,14 @@ public void SwapDeployments() string projectName = "{projectName}"; string firstDeploymentName = "{deploymentName1}"; string secondDeploymentName = "{deploymentName2}"; - TextAuthoringProject porjectClient = client.GetProject(projectName); + TextAuthoringProject projectClient = client.GetProject(projectName); var swapDetails = new TextAuthoringSwapDeploymentsDetails( firstDeploymentName: firstDeploymentName, secondDeploymentName: secondDeploymentName ); - Operation operation = porjectClient.SwapDeployments( + Operation operation = projectClient.SwapDeployments( waitUntil: WaitUntil.Completed, details: swapDetails ); From bd9b2193ac555ab9302bd7e942868d78be0365f1 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Tue, 22 Jul 2025 22:26:31 -0700 Subject: [PATCH 36/47] udpate the specific version snippet to 20250515preview(latest version) --- .../Azure.AI.Language.Text.Authoring/README.md | 4 ++-- .../samples/Sample10_TextAuthoring_LoadSnapshot.md | 2 +- .../samples/Sample10_TextAuthoring_LoadSnapshotAsync.md | 2 +- .../samples/Sample11_TextAuthoring_DeleteTrainedModel.md | 2 +- .../samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md | 2 +- .../samples/Sample12_TextAuthoring_SwapDeployments.md | 2 +- .../samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md | 2 +- .../samples/Sample13_TextAuthoring_DeleteDeployment.md | 2 +- .../samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md | 2 +- .../samples/Sample14_TextAuthoring_DeployProject.md | 2 +- .../samples/Sample14_TextAuthoring_DeployProjectAsync.md | 2 +- .../samples/Sample15_TextAuthoring_GetDeployment.md | 2 +- .../samples/Sample15_TextAuthoring_GetDeploymentAsync.md | 2 +- .../samples/Sample1_TextAuthoring_CreateProject.md | 2 +- .../samples/Sample1_TextAuthoring_CreateProjectAsync.md | 2 +- .../samples/Sample2_TextAuthoring_Import.md | 2 +- .../samples/Sample2_TextAuthoring_ImportAsync.md | 2 +- .../samples/Sample3_TextAuthoring_Export.md | 2 +- .../samples/Sample3_TextAuthoring_ExportAsync.md | 2 +- .../samples/Sample4_TextAuthoring_GetProject.md | 2 +- .../samples/Sample4_TextAuthoring_GetProjectAsync.md | 2 +- .../samples/Sample5_TextAuthoring_DeleteProject.md | 2 +- .../samples/Sample5_TextAuthoring_DeleteProjectAsync.md | 2 +- .../samples/Sample6_TextAuthoring_Train.md | 2 +- .../samples/Sample6_TextAuthoring_TrainAsync.md | 2 +- .../samples/Sample7_TextAuthoring_CancelTrainingJob.md | 2 +- .../samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md | 2 +- .../Sample8_TextAuthoring_GetModelEvaluationSummary.md | 2 +- .../Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md | 2 +- .../Sample9_TextAuthoring_GetModelEvaluationResults.md | 2 +- .../Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md | 2 +- .../tests/Samples/CreateClient.cs | 2 +- 32 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 79360398a52b..23a7ae15565c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -73,7 +73,7 @@ With your endpoint and API key, you can instantiate a TextAnalysisAuthoringClien ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` @@ -117,7 +117,7 @@ For example: ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index 68cac5fb5bd6..cebfdc7d2ea1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index 7669fd0ceb90..308c346d5b36 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 2219b19f7860..3a50f3d96be3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index 2acbd31284d1..d24f3ac55231 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 88f8d27904ce..174aa64f6400 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index 042fff708f04..bebae2f5ecda 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index 27ca1363da32..727604b3491d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index de26877b8ce4..e399034ee5b8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index 002664af1585..f92ce037dd7d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index 22d7707cc480..5910cb40ca4a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index 2e251037bb8e..1848578b4299 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 487e3072b847..119fd1e2af4b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index f399d221ba01..e3d34616a636 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index b4e192f345be..12fc2b546159 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 781f9c47f1c7..82efb983241b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index 3514729f156b..7f8e69d1c31d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index 4ca33a2867b3..0a9aa42cafa6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index ef897000ec66..549ce5737c96 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index c9b8ac483021..48f23d44ddba 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -7,7 +7,7 @@ To create an AuthoringClient, you will need the service endpoint and credentials ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index f112f9747b96..66051d9b837a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index 65d433424134..43cf0888dfac 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index f61998742dcd..45e58b4d2af9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index 2d478489f155..7eda00ea62fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index f8a0bc9561fe..b8400277b583 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 09f3d24842c6..6c96352441df 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 829d7f4cd017..0b117c85fc04 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index be83c874ec64..a28313880687 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index a96e5503a4df..f9460f27d449 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 214f07eb188f..09dfe5247821 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index 21bb521ba38e..a181ca0e9192 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -9,7 +9,7 @@ To create an `AuthoringClient`, you will need the service endpoint and credentia ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs index c41d915c7f46..8e1f4a6a17fd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs @@ -26,7 +26,7 @@ public void CreateAuthoringClientForSpecificApiVersion() endpoint = TestEnvironment.Endpoint; credential = new(TestEnvironment.ApiKey); #endif - TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); + TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); #endregion } From 6e94253794d2bc57cb0f1cce4d87e7ea928e06c1 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 00:25:00 -0700 Subject: [PATCH 37/47] update key and AAD for each sample --- .../samples/Sample10_TextAuthoring_LoadSnapshot.md | 7 +++++-- .../Sample10_TextAuthoring_LoadSnapshotAsync.md | 7 +++++-- .../Sample11_TextAuthoring_DeleteTrainedModel.md | 7 +++++-- .../Sample11_TextAuthoring_DeleteTrainedModelAsync.md | 7 +++++-- .../samples/Sample12_TextAuthoring_SwapDeployments.md | 7 +++++-- .../Sample12_TextAuthoring_SwapDeploymentsAsync.md | 7 +++++-- .../samples/Sample13_TextAuthoring_DeleteDeployment.md | 7 +++++-- .../Sample13_TextAuthoring_DeleteDeploymentAsync.md | 7 +++++-- .../samples/Sample14_TextAuthoring_DeployProject.md | 7 +++++-- .../Sample14_TextAuthoring_DeployProjectAsync.md | 7 +++++-- .../samples/Sample15_TextAuthoring_GetDeployment.md | 7 +++++-- .../Sample15_TextAuthoring_GetDeploymentAsync.md | 7 +++++-- ...Sample16_TextAuthoring_AssignDeploymentResources.md | 10 +++------- ...e16_TextAuthoring_AssignDeploymentResourcesAsync.md | 10 +++------- ...TextAuthoring_GetAssignDeploymentResourcesStatus.md | 10 +++------- ...uthoring_GetAssignDeploymentResourcesStatusAsync.md | 10 +++------- ...mple18_TextAuthoring_UnassignDeploymentResources.md | 10 +++------- ...8_TextAuthoring_UnassignDeploymentResourcesAsync.md | 10 +++------- ...xtAuthoring_GetUnassignDeploymentResourcesStatus.md | 10 +++------- ...horing_GetUnassignDeploymentResourcesStatusAsync.md | 10 +++------- .../samples/Sample1_TextAuthoring_CreateProject.md | 7 +++++-- .../Sample1_TextAuthoring_CreateProjectAsync.md | 7 +++++-- .../samples/Sample2_TextAuthoring_Import.md | 7 +++++-- .../samples/Sample2_TextAuthoring_ImportAsync.md | 7 +++++-- .../samples/Sample3_TextAuthoring_Export.md | 7 +++++-- .../samples/Sample3_TextAuthoring_ExportAsync.md | 7 +++++-- .../samples/Sample4_TextAuthoring_GetProject.md | 8 ++++++-- .../samples/Sample4_TextAuthoring_GetProjectAsync.md | 7 +++++-- .../samples/Sample5_TextAuthoring_DeleteProject.md | 7 +++++-- .../Sample5_TextAuthoring_DeleteProjectAsync.md | 7 +++++-- .../samples/Sample6_TextAuthoring_Train.md | 7 +++++-- .../samples/Sample6_TextAuthoring_TrainAsync.md | 7 +++++-- .../samples/Sample7_TextAuthoring_CancelTrainingJob.md | 7 +++++-- .../Sample7_TextAuthoring_CancelTrainingJobAsync.md | 7 +++++-- .../Sample8_TextAuthoring_GetModelEvaluationSummary.md | 7 +++++-- ...le8_TextAuthoring_GetModelEvaluationSummaryAsync.md | 7 +++++-- .../Sample9_TextAuthoring_GetModelEvaluationResults.md | 7 +++++-- ...le9_TextAuthoring_GetModelEvaluationResultsAsync.md | 7 +++++-- 38 files changed, 175 insertions(+), 116 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index cebfdc7d2ea1..048edb5bc088 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -2,9 +2,9 @@ This sample demonstrates how to load a snapshot synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Load a Snapshot Synchronously To load a snapshot, call LoadSnapshot on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md index 308c346d5b36..ea397b0908cd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to load a snapshot asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Load a Snapshot Asynchronously To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 3a50f3d96be3..5dac5d21e512 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Trained Model Synchronously To delete a trained model, call DeleteTrainedModel on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md index d24f3ac55231..4007f4f75b0c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Trained Model Asynchronously To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 174aa64f6400..3a23bcef87de 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -2,9 +2,9 @@ This sample demonstrates how to swap deployments synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Swap Deployments Synchronously To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md index bebae2f5ecda..f8159cf8f090 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to swap deployments asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Swap Deployments Asynchronously To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index 727604b3491d..acdb69f22fe9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a deployment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Deployment Synchronously To delete a deployment, call DeleteDeployment on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md index e399034ee5b8..da0a3c8e7ca3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a deployment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Deployment Asynchronously To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index f92ce037dd7d..f9dd9589672d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -2,9 +2,9 @@ This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Deploy a Project Synchronously To deploy a project, call DeployProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md index 5910cb40ca4a..6737c57d82ae 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Deploy a Project Asynchronously To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index 1848578b4299..285423690728 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve deployment details synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Deployment Details Synchronously To retrieve deployment details, call `GetDeployment` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md index 119fd1e2af4b..efd86dad5d8c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve deployment details asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Deployment Details Asynchronously To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index dd8997458204..aa91c0bc677e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -2,15 +2,11 @@ This sample demonstrates how to assign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Assign Deployment Resources Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index ec4b8cbe93e3..c60966604966 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -2,15 +2,11 @@ This sample demonstrates how to assign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Assign Deployment Resources Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index 902173f17641..c486db01532d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -2,15 +2,11 @@ This sample demonstrates how to retrieve the status of deployment resources assignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Retrieve Deployment Resources Assignment Status Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index 4185664c979a..4a9b1b080e1d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -2,15 +2,11 @@ This sample demonstrates how to retrieve the status of deployment resources assignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Retrieve Deployment Resources Assignment Status Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index 16db14a6a98c..e005d55b5163 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -2,15 +2,11 @@ This sample demonstrates how to unassign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Unassign Deployment Resources Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md index e000491a9454..15a9e423cfe4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md @@ -2,15 +2,11 @@ This sample demonstrates how to unassign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Unassign Deployment Resources Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index 77b13648a877..b500cd04a8da 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -2,15 +2,11 @@ This sample demonstrates how to retrieve the status of deployment resources unassignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Retrieve Deployment Resources Unassignment Status Synchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md index 58975dc608a9..b09a443539a4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md @@ -2,15 +2,11 @@ This sample demonstrates how to retrieve the status of deployment resources unassignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` using AAD Authentication +## Create a TextAnalysisAuthoringClient using AAD Authentication -To create a `AuthoringClient`, use the service endpoint of a custom subdomain Language resource and authenticate with `DefaultAzureCredential`. +This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. -```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential -Uri endpoint = new Uri("{endpoint}");; -DefaultAzureCredential credential = new DefaultAzureCredential(); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); -``` +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). ## Retrieve Deployment Resources Unassignment Status Asynchronously diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index e3d34616a636..7bfb30eba2b5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -2,9 +2,9 @@ This sample demonstrates how to create a new project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Create a Project Synchronously To create a new project, call CreateProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index 12fc2b546159..ebe156a4c828 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to create a new project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Create a Project Asynchronously To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 82efb983241b..33bfef28a10b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -2,9 +2,9 @@ This sample demonstrates how to import project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Import Project Data Synchronously To import project data synchronously, call Import on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index 7f8e69d1c31d..a598fc3cf31a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to import project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Import Project Data Asynchronously To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index 0a9aa42cafa6..ddd75bc146f0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -2,9 +2,9 @@ This sample demonstrates how to export project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Export Project Data Synchronously To export project data, call `Export` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md index 549ce5737c96..475a6c4344c2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to export project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Export Project Data Asynchronously To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index 48f23d44ddba..e096d2952410 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -1,8 +1,9 @@ # Retrieving Project Metadata Synchronously in Azure AI Language This sample demonstrates how to retrieve metadata of a project synchronously using the Azure.AI.Language.Text.Authoring SDK. -## Create an AuthoringClient -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. +## Create a TextAnalysisAuthoringClient + +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -11,6 +12,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Project Metadata Synchronously To retrieve metadata of a project, call GetProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md index 66051d9b837a..541e8c7b87c1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve metadata of a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Project Metadata Asynchronously To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index 43cf0888dfac..b8620bda80e7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Project Synchronously To delete a project, call DeleteProject on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md index 45e58b4d2af9..4ad542104416 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to delete a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Delete a Project Asynchronously To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index 7eda00ea62fc..9ab4d9487a93 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -2,9 +2,9 @@ This sample demonstrates how to train a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Train a Project Synchronously To train a project, call Train on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md index b8400277b583..07b81e2ecb7f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to train a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Train a Project Asynchronously To train a project, call TrainAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 6c96352441df..4f16a71efe91 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -2,9 +2,9 @@ This sample demonstrates how to cancel a training job synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Cancel a Training Job Synchronously To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 0b117c85fc04..8dfa628f242f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to cancel a training job asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Cancel a Training Job Asynchronously To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index a28313880687..2f301703c7c9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve the evaluation summary of a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Get Model Evaluation Summary Synchronously To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummary on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md index f9460f27d449..4320988d4e7e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve the evaluation summary of a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Get Model Evaluation Summary Asynchronously To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 09dfe5247821..736000cdb5b0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve model evaluation results synchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Model Evaluation Results Synchronously To retrieve model evaluation results, call `GetModelEvaluationResults` on the `TextAuthoringTrainedModel` client. The method returns a `Pageable` that allows you to enumerate the evaluation results for each document. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md index a181ca0e9192..1f77af0246d4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md @@ -2,9 +2,9 @@ This sample demonstrates how to retrieve model evaluation results asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. -## Create an `AuthoringClient` +## Create a TextAnalysisAuthoringClient -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. +To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. ```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion Uri endpoint = new Uri("{endpoint}"); @@ -13,6 +13,9 @@ TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOpti TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); ``` +Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). + ## Retrieve Model Evaluation Results Asynchronously To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. From 2db1bcdd4aff9c336500ac486daf43164c2344a2 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 09:49:28 -0700 Subject: [PATCH 38/47] add azureOpenAI bug fix in change log --- .../Azure.AI.Language.Text.Authoring/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md index a069dcb5cfbf..bf0a05520ad6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bugs Fixed - Merged TextAuthoringUnassignDeploymentResourcesState and TextAuthoringAssignDeploymentResourcesState into one class TextAuthoringDeploymentResourcesState +- Fixed "azureOpenAI" to "AzureOpenAI" for DataGenerationConnectionInfoKind ### Other Changes From d910858d4e63c4faed6b0002f44ab5d8785a3ed5 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 10:19:48 -0700 Subject: [PATCH 39/47] modified more values to placeholder in samples --- ...16_TextAuthoring_AssignDeploymentResources.md | 6 +++--- ...xtAuthoring_AssignDeploymentResourcesAsync.md | 6 +++--- ...thoring_GetAssignDeploymentResourcesStatus.md | 6 +++--- ...ng_GetAssignDeploymentResourcesStatusAsync.md | 6 +++--- .../Sample1_TextAuthoring_CreateProject.md | 6 +++--- .../Sample1_TextAuthoring_CreateProjectAsync.md | 6 +++--- .../samples/Sample2_TextAuthoring_Import.md | 16 ++++++++-------- .../samples/Sample2_TextAuthoring_ImportAsync.md | 14 +++++++------- .../Sample7_TextAuthoring_CancelTrainingJob.md | 2 +- ...mple7_TextAuthoring_CancelTrainingJobAsync.md | 2 +- ...16_TextAuthoring_AssignDeploymentResources.cs | 6 +++--- ...xtAuthoring_AssignDeploymentResourcesAsync.cs | 6 +++--- ...thoring_GetAssignDeploymentResourcesStatus.cs | 6 +++--- ...ng_GetAssignDeploymentResourcesStatusAsync.cs | 6 +++--- .../Sample1_TextAuthoring_CreateProject.cs | 6 +++--- .../Sample1_TextAuthoring_CreateProjectAsync.cs | 6 +++--- .../Samples/Sample2_TextAuthoring_Import.cs | 16 ++++++++-------- .../Samples/Sample2_TextAuthoring_ImportAsync.cs | 14 +++++++------- .../Sample7_TextAuthoring_CancelTrainingJob.cs | 2 +- ...mple7_TextAuthoring_CancelTrainingJobAsync.cs | 2 +- 20 files changed, 70 insertions(+), 70 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index aa91c0bc677e..c104cd407311 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -17,9 +17,9 @@ string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md index c60966604966..fd1cce7a977c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md @@ -17,9 +17,9 @@ string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index c486db01532d..f458c72eac59 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -17,9 +17,9 @@ string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md index 4a9b1b080e1d..683c8833a40c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md @@ -17,9 +17,9 @@ string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index 7bfb30eba2b5..4da360fa7505 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -24,9 +24,9 @@ To create a new project, call CreateProject on the TextAnalysisAuthoring client. string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "customMultiLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Project description for a Custom Entity Recognition project", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md index ebe156a4c828..29c4d18c588d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md @@ -24,9 +24,9 @@ To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring cl string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "customMultiLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Project description for a Custom Entity Recognition project", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 33bfef28a10b..fcc937ab49e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -24,9 +24,9 @@ To import project data synchronously, call Import on the TextAnalysisAuthoring c string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "CustomSingleLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Sample dataset for Custom Entity Recognition", @@ -127,7 +127,7 @@ var projectAssets = new ExportedCustomEntityRecognitionProjectAsset }; var exportedProject = new TextAuthoringExportedProject( - projectFileVersion: "2022-05-01", + projectFileVersion: "2025-05-15-preview", stringIndexType: StringIndexType.Utf16CodeUnit, metadata: projectMetadata ) @@ -158,15 +158,15 @@ string rawJson = """ "projectFileVersion": "2025-05-15-preview", "stringIndexType": "Utf16CodeUnit", "metadata": { - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "single-class-example", - "language": "en", + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", "multilingual": false, "settings": {} }, "assets": { - "projectKind": "CustomSingleLabelClassification", + "projectKind": "{projectKind}", "classes": [ { "category": "Date" }, { "category": "LenderName" }, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md index a598fc3cf31a..f281c370160b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -24,9 +24,9 @@ To import project data asynchronously, call ImportAsync on the TextAnalysisAutho string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "CustomEntityRecognition", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Sample dataset for Custom Entity Recognition", @@ -156,15 +156,15 @@ string rawJson = """ "projectFileVersion": "2025-05-15-preview", "stringIndexType": "Utf16CodeUnit", "metadata": { - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "single-class-example", - "language": "en", + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", "multilingual": false, "settings": {} }, "assets": { - "projectKind": "CustomSingleLabelClassification", + "projectKind": "{projectKind}", "classes": [ { "category": "Date" }, { "category": "LenderName" }, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 4f16a71efe91..902b7ee84966 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -24,7 +24,7 @@ To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring cl string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); -string jobId = "training-job-id"; // Replace with an actual job ID. +string jobId = "{jobId}"; // Replace with an actual job ID. Operation operation = projectClient.CancelTrainingJob( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md index 8dfa628f242f..a943e0968a20 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md @@ -24,7 +24,7 @@ To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthori string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); -string jobId = "training-job-id"; // Replace with an actual job ID. +string jobId = "{jobId}"; // Replace with an actual job ID. Operation operation = await projectClient.CancelTrainingJobAsync( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index 39c7aa9a2748..5b4c54280f41 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -27,9 +27,9 @@ public void AssignDeploymentResources() TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs index 82db0c2ba053..ddbcbef4640a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs @@ -28,9 +28,9 @@ public async Task AssignDeploymentResourcesAsync() TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index 0f0f1bf96e55..1cb5615807e6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -28,9 +28,9 @@ public void GetAssignDeploymentResourcesStatus() TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs index aaed53270082..51adcd776ac6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs @@ -30,9 +30,9 @@ public async Task GetAssignDeploymentResourcesStatusAsync() TextAuthoringProject projectClient = client.GetProject(projectName); var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account", - customDomain: "my-custom-domain", - region: "my-region" + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" ); var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index a1e60438486a..1d68cd904839 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -25,9 +25,9 @@ public void CreateProject() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "customMultiLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Project description for a Custom Entity Recognition project", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs index 581f88e9dfe9..f4f9a07ac6ed 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs @@ -26,9 +26,9 @@ public async Task CreateProjectAsync() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "customMultiLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Project description for a Custom Entity Recognition project", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index 7ed95f2cc25e..c430d4dc7aca 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -26,9 +26,9 @@ public void Import() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "CustomSingleLabelClassification", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Sample dataset for Custom Entity Recognition", @@ -129,7 +129,7 @@ public void Import() }; var exportedProject = new TextAuthoringExportedProject( - projectFileVersion: "2022-05-01", + projectFileVersion: "2025-05-15-preview", stringIndexType: StringIndexType.Utf16CodeUnit, metadata: projectMetadata ) @@ -165,15 +165,15 @@ public void ImportRawString() "projectFileVersion": "2025-05-15-preview", "stringIndexType": "Utf16CodeUnit", "metadata": { - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "single-class-example", - "language": "en", + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", "multilingual": false, "settings": {} }, "assets": { - "projectKind": "CustomSingleLabelClassification", + "projectKind": "{projectKind}", "classes": [ { "category": "Date" }, { "category": "LenderName" }, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs index d3e507c858af..7464ee7d8faf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs @@ -26,9 +26,9 @@ public async Task ImportAsync() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "CustomEntityRecognition", - storageInputContainerName: "test-data", - language: "en" + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" ) { Description = "Sample dataset for Custom Entity Recognition", @@ -163,15 +163,15 @@ public async Task ImportRawStringAsync() "projectFileVersion": "2025-05-15-preview", "stringIndexType": "Utf16CodeUnit", "metadata": { - "projectKind": "CustomSingleLabelClassification", - "storageInputContainerName": "single-class-example", - "language": "en", + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", "multilingual": false, "settings": {} }, "assets": { - "projectKind": "CustomSingleLabelClassification", + "projectKind": "{projectKind}", "classes": [ { "category": "Date" }, { "category": "LenderName" }, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index d721bafa5518..7b20645c4f78 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -25,7 +25,7 @@ public void CancelTrainingJob() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); - string jobId = "training-job-id"; // Replace with an actual job ID. + string jobId = "{jobId}"; // Replace with an actual job ID. Operation operation = projectClient.CancelTrainingJob( waitUntil: WaitUntil.Completed, diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs index d4334154509d..7135c301f8b6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs @@ -26,7 +26,7 @@ public async Task CancelTrainingJobAsync() string projectName = "{projectName}"; TextAuthoringProject projectClient = client.GetProject(projectName); - string jobId = "training-job-id"; // Replace with an actual job ID. + string jobId = "{jobId}"; // Replace with an actual job ID. Operation operation = await projectClient.CancelTrainingJobAsync( waitUntil: WaitUntil.Completed, From bd6cbcb15cfcdc12471ceba5e1f1dc088c4c1f2c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 10:55:11 -0700 Subject: [PATCH 40/47] move sync and async samples to one file --- .../Sample10_TextAuthoring_LoadSnapshot.md | 22 +- ...ample10_TextAuthoring_LoadSnapshotAsync.md | 37 ---- ...mple11_TextAuthoring_DeleteTrainedModel.md | 18 +- ...1_TextAuthoring_DeleteTrainedModelAsync.md | 33 --- .../Sample12_TextAuthoring_SwapDeployments.md | 28 ++- ...le12_TextAuthoring_SwapDeploymentsAsync.md | 43 ---- ...Sample13_TextAuthoring_DeleteDeployment.md | 20 +- ...e13_TextAuthoring_DeleteDeploymentAsync.md | 35 --- .../Sample14_TextAuthoring_DeployProject.md | 23 +- ...mple14_TextAuthoring_DeployProjectAsync.md | 38 ---- .../Sample15_TextAuthoring_GetDeployment.md | 23 +- ...mple15_TextAuthoring_GetDeploymentAsync.md | 38 ---- ...TextAuthoring_AssignDeploymentResources.md | 28 ++- ...uthoring_AssignDeploymentResourcesAsync.md | 35 --- ...ring_GetAssignDeploymentResourcesStatus.md | 40 +++- ...GetAssignDeploymentResourcesStatusAsync.md | 47 ---- ...xtAuthoring_UnassignDeploymentResources.md | 27 ++- ...horing_UnassignDeploymentResourcesAsync.md | 32 --- ...ng_GetUnassignDeploymentResourcesStatus.md | 49 ++++- ...tUnassignDeploymentResourcesStatusAsync.md | 54 ----- .../Sample1_TextAuthoring_CreateProject.md | 26 ++- ...ample1_TextAuthoring_CreateProjectAsync.md | 41 ---- .../samples/Sample2_TextAuthoring_Import.md | 182 ++++++++++++++- .../Sample2_TextAuthoring_ImportAsync.md | 197 ----------------- .../samples/Sample3_TextAuthoring_Export.md | 22 +- .../Sample3_TextAuthoring_ExportAsync.md | 37 ---- .../Sample4_TextAuthoring_GetProject.md | 22 +- .../Sample4_TextAuthoring_GetProjectAsync.md | 37 ---- .../Sample5_TextAuthoring_DeleteProject.md | 21 +- ...ample5_TextAuthoring_DeleteProjectAsync.md | 36 --- .../samples/Sample6_TextAuthoring_Train.md | 35 ++- .../Sample6_TextAuthoring_TrainAsync.md | 50 ----- ...Sample7_TextAuthoring_CancelTrainingJob.md | 24 +- ...e7_TextAuthoring_CancelTrainingJobAsync.md | 39 ---- ...TextAuthoring_GetModelEvaluationSummary.md | 74 ++++++- ...uthoring_GetModelEvaluationSummaryAsync.md | 89 -------- ...TextAuthoring_GetModelEvaluationResults.md | 33 ++- ...uthoring_GetModelEvaluationResultsAsync.md | 48 ---- .../Sample10_TextAuthoring_LoadSnapshot.cs | 25 +++ ...ample10_TextAuthoring_LoadSnapshotAsync.cs | 42 ---- ...mple11_TextAuthoring_DeleteTrainedModel.cs | 21 ++ ...1_TextAuthoring_DeleteTrainedModelAsync.cs | 38 ---- .../Sample12_TextAuthoring_SwapDeployments.cs | 31 +++ ...le12_TextAuthoring_SwapDeploymentsAsync.cs | 48 ---- ...Sample13_TextAuthoring_DeleteDeployment.cs | 23 ++ ...e13_TextAuthoring_DeleteDeploymentAsync.cs | 40 ---- .../Sample14_TextAuthoring_DeployProject.cs | 26 +++ ...mple14_TextAuthoring_DeployProjectAsync.cs | 43 ---- .../Sample15_TextAuthoring_GetDeployment.cs | 26 +++ ...mple15_TextAuthoring_GetDeploymentAsync.cs | 43 ---- ...TextAuthoring_AssignDeploymentResources.cs | 31 +++ ...uthoring_AssignDeploymentResourcesAsync.cs | 49 ----- ...ring_GetAssignDeploymentResourcesStatus.cs | 43 ++++ ...GetAssignDeploymentResourcesStatusAsync.cs | 63 ------ ...xtAuthoring_UnassignDeploymentResources.cs | 32 ++- ...horing_UnassignDeploymentResourcesAsync.cs | 48 ---- ...ng_GetUnassignDeploymentResourcesStatus.cs | 52 ++++- ...tUnassignDeploymentResourcesStatusAsync.cs | 69 ------ .../Sample1_TextAuthoring_CreateProject.cs | 29 +++ ...ample1_TextAuthoring_CreateProjectAsync.cs | 46 ---- .../Samples/Sample2_TextAuthoring_Import.cs | 190 ++++++++++++++++ .../Sample2_TextAuthoring_ImportAsync.cs | 207 ------------------ .../Samples/Sample3_TextAuthoring_Export.cs | 25 +++ .../Sample3_TextAuthoring_ExportAsync.cs | 42 ---- .../Sample4_TextAuthoring_GetProject.cs | 23 ++ .../Sample4_TextAuthoring_GetProjectAsync.cs | 40 ---- .../Sample5_TextAuthoring_DeleteProject.cs | 24 ++ ...ample5_TextAuthoring_DeleteProjectAsync.cs | 41 ---- .../Samples/Sample6_TextAuthoring_Train.cs | 38 ++++ .../Sample6_TextAuthoring_TrainAsync.cs | 55 ----- ...Sample7_TextAuthoring_CancelTrainingJob.cs | 27 +++ ...e7_TextAuthoring_CancelTrainingJobAsync.cs | 44 ---- ...TextAuthoring_GetModelEvaluationSummary.cs | 75 +++++++ ...uthoring_GetModelEvaluationSummaryAsync.cs | 91 -------- ...TextAuthoring_GetModelEvaluationResults.cs | 36 +++ ...uthoring_GetModelEvaluationResultsAsync.cs | 53 ----- 76 files changed, 1471 insertions(+), 2091 deletions(-) delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md index 048edb5bc088..c29891ab3016 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md @@ -1,4 +1,4 @@ -# Loading a Snapshot Synchronously in Azure AI Language +# Loading a Snapshot in Azure AI Language This sample demonstrates how to load a snapshot synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -35,3 +35,23 @@ Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawRes ``` To load a snapshot, the LoadSnapshot method sends a request with the project name and trained model label. The method returns an Operation object indicating the status of the snapshot loading. + +## Load a Snapshot Asynchronously + +To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample10_TextAuthoring_LoadSnapshotAsync +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + +Operation operation = await trainedModelClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); +``` + +To load a snapshot, the LoadSnapshotAsync method sends a request with the project name and trained model label. The method returns an Operation object indicating the status of the snapshot loading. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md deleted file mode 100644 index ea397b0908cd..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md +++ /dev/null @@ -1,37 +0,0 @@ -# Loading a Snapshot Asynchronously in Azure AI Language - -This sample demonstrates how to load a snapshot asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Load a Snapshot Asynchronously - -To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample10_TextAuthoring_LoadSnapshotAsync -string projectName = "{projectName}"; -string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. -TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - -Operation operation = await trainedModelClient.LoadSnapshotAsync( - waitUntil: WaitUntil.Completed -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); -``` - -To load a snapshot, the LoadSnapshotAsync method sends a request with the project name and trained model label. The method returns an Operation object indicating the status of the snapshot loading. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md index 5dac5d21e512..d1edde279cb3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md @@ -1,4 +1,4 @@ -# Deleting a Trained Model Synchronously in Azure AI Language +# Deleting a Trained Model in Azure AI Language This sample demonstrates how to delete a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -31,3 +31,19 @@ Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); ``` To delete a trained model, the DeleteTrainedModel method sends a request with the project name and the model label. The method returns a Response object indicating the deletion status. + +## Delete a Trained Model Asynchronously + +To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + +Response response = await trainedModelClient.DeleteTrainedModelAsync(); + +Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); +``` + +To delete a trained model, the DeleteTrainedModelAsync method sends a request with the project name and the model label. The method returns a Response object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md deleted file mode 100644 index 4007f4f75b0c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md +++ /dev/null @@ -1,33 +0,0 @@ -# Deleting a Trained Model Asynchronously in Azure AI Language - -This sample demonstrates how to delete a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Delete a Trained Model Asynchronously - -To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync -string projectName = "{projectName}"; -string trainedModelLabel = "{modelLabel}"; -TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - -Response response = await trainedModelClient.DeleteTrainedModelAsync(); - -Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); -``` - -To delete a trained model, the DeleteTrainedModelAsync method sends a request with the project name and the model label. The method returns a Response object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md index 3a23bcef87de..ee214e8e1102 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md @@ -1,4 +1,4 @@ -# Swapping Deployments Synchronously in Azure AI Language +# Swapping Deployments in Azure AI Language This sample demonstrates how to swap deployments synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -40,3 +40,29 @@ Console.WriteLine($"Swap operation completed with status: {operation.GetRawRespo ``` To swap deployments, the SwapDeployments method sends a request with the project name and the deployment swap configuration. The method returns an Operation object indicating the swap status. + +## Swap Deployments Asynchronously + +To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync +string projectName = "{projectName}"; +string firstDeploymentName = "{deploymentName1}"; +string secondDeploymentName = "{deploymentName2}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +var swapDetails = new TextAuthoringSwapDeploymentsDetails +( + firstDeploymentName: firstDeploymentName, + secondDeploymentName: secondDeploymentName + ); + +Operation operation = await projectClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + details: swapDetails +); + +Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); +``` + +To swap deployments, the SwapDeploymentsAsync method sends a request with the project name and the deployment swap configuration. The method returns an Operation object indicating the swap status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md deleted file mode 100644 index f8159cf8f090..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md +++ /dev/null @@ -1,43 +0,0 @@ -# Swapping Deployments Asynchronously in Azure AI Language - -This sample demonstrates how to swap deployments asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Swap Deployments Asynchronously - -To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync -string projectName = "{projectName}"; -string firstDeploymentName = "{deploymentName1}"; -string secondDeploymentName = "{deploymentName2}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -var swapDetails = new TextAuthoringSwapDeploymentsDetails -( - firstDeploymentName: firstDeploymentName, - secondDeploymentName: secondDeploymentName - ); - -Operation operation = await projectClient.SwapDeploymentsAsync( - waitUntil: WaitUntil.Completed, - details: swapDetails -); - -Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); -``` - -To swap deployments, the SwapDeploymentsAsync method sends a request with the project name and the deployment swap configuration. The method returns an Operation object indicating the swap status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md index acdb69f22fe9..b7595fa05e5d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md @@ -1,4 +1,4 @@ -# Deleting a Deployment Synchronously in Azure AI Language +# Deleting a Deployment in Azure AI Language This sample demonstrates how to delete a deployment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -33,3 +33,21 @@ Console.WriteLine($"Deployment deletion completed with status: {operation.GetRaw ``` To delete a deployment, the DeleteDeployment method sends a request with the project name and deployment name. The method returns an Operation object indicating the deletion status. + +## Delete a Deployment Asynchronously + +To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +Operation operation = await deploymentClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed +); + +Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a deployment, the DeleteDeploymentAsync method sends a request with the project name and deployment name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md deleted file mode 100644 index da0a3c8e7ca3..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md +++ /dev/null @@ -1,35 +0,0 @@ -# Deleting a Deployment Asynchronously in Azure AI Language - -This sample demonstrates how to delete a deployment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Delete a Deployment Asynchronously - -To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync -string projectName = "{projectName}"; -string deploymentName = "{deploymentName}"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - -Operation operation = await deploymentClient.DeleteDeploymentAsync( - waitUntil: WaitUntil.Completed -); - -Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); -``` - -To delete a deployment, the DeleteDeploymentAsync method sends a request with the project name and deployment name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md index f9dd9589672d..edc7002994c3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md @@ -1,4 +1,4 @@ -# Deploying a Project Synchronously in Azure AI Language +# Deploying a Project in Azure AI Language This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -36,3 +36,24 @@ Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Sta ``` 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. + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); + +Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md deleted file mode 100644 index 6737c57d82ae..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md +++ /dev/null @@ -1,38 +0,0 @@ -# Deploying a Project Asynchronously in Azure AI Language - -This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Deploy a Project Asynchronously - -To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample14_TextAuthoring_DeployProjectAsync -string projectName = "{projectName}"; -string deploymentName = "{deploymentName}"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - -var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); - -Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig -); - -Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); -``` - -To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md index 285423690728..ed0658d8be0e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md @@ -1,4 +1,4 @@ -# Retrieving Deployment Details Synchronously in Azure AI Language +# Retrieving Deployment Details in Azure AI Language This sample demonstrates how to retrieve deployment details synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -36,3 +36,24 @@ Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); ``` + +## Retrieve Deployment Details Asynchronously + +To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. + +```C# Snippet:Sample15_TextAuthoring_GetDeploymentAsync +string projectName = "{projectName}"; +string deploymentName = "{deploymentName}"; +TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + +Response response = await deploymentClient.GetDeploymentAsync(); + +TextAuthoringProjectDeployment deployment = response.Value; + +Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); +Console.WriteLine($"Model Id: {deployment.ModelId}"); +Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); +Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); +Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); +Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md deleted file mode 100644 index efd86dad5d8c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md +++ /dev/null @@ -1,38 +0,0 @@ -# Retrieving Deployment Details Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve deployment details asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Retrieve Deployment Details Asynchronously - -To retrieve deployment details, call `GetDeploymentAsync` on the `TextAuthoringDeployment` client. The method returns a `Response` containing the deployment details. - -```C# Snippet:Sample15_TextAuthoring_GetDeploymentAsync -string projectName = "{projectName}"; -string deploymentName = "{deploymentName}"; -TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - -Response response = await deploymentClient.GetDeploymentAsync(); - -TextAuthoringProjectDeployment deployment = response.Value; - -Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); -Console.WriteLine($"Model Id: {deployment.ModelId}"); -Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); -Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); -Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); -Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md index c104cd407311..fde6216b5f31 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md @@ -1,4 +1,4 @@ -# Assigning Deployment Resources Synchronously in Azure AI Language +# Assigning Deployment Resources in Azure AI Language This sample demonstrates how to assign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -33,3 +33,29 @@ Operation operation = projectClient.AssignDeploymentResources( Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); ``` + +## Assign Deployment Resources Asynchronously + +To assign deployment resources, call `AssignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. + +```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" +); + +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } +); + +Operation operation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Completed, + details: assignDetails +); + +Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md deleted file mode 100644 index fd1cce7a977c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md +++ /dev/null @@ -1,35 +0,0 @@ -# Assigning Deployment Resources Asynchronously in Azure AI Language - -This sample demonstrates how to assign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient using AAD Authentication - -This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. - -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Assign Deployment Resources Asynchronously - -To assign deployment resources, call `AssignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the assignment status. - -```C# Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", - customDomain: "{customDomain}", - region: "{Region}" -); - -var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( - new List { resourceMetadata } -); - -Operation operation = await projectClient.AssignDeploymentResourcesAsync( - waitUntil: WaitUntil.Completed, - details: assignDetails -); - -Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md index f458c72eac59..33f776184bec 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md @@ -1,4 +1,4 @@ -# Retrieving Deployment Resources Assignment Status Synchronously in Azure AI Language +# Retrieving Deployment Resources Assignment Status in Azure AI Language This sample demonstrates how to retrieve the status of deployment resources assignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -45,3 +45,41 @@ Response statusResponse = projectClient.G Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); ``` + +## Retrieve Deployment Resources Assignment Status Asynchronously + +To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. + +```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" +); + +var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } +); + +// Submit assignment operation +Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: assignDetails +); + +string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + +// Extract only the jobId part from the URL +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Job ID: {jobId}"); + +// Call status API +Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); + +Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md deleted file mode 100644 index 683c8833a40c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md +++ /dev/null @@ -1,47 +0,0 @@ -# Retrieving Deployment Resources Assignment Status Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve the status of deployment resources assignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient using AAD Authentication - -This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. - -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Retrieve Deployment Resources Assignment Status Asynchronously - -To retrieve the status of deployment resources assignment, call `GetAssignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the assignment status. - -```C# Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", - customDomain: "{customDomain}", - region: "{Region}" -); - -var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( - new List { resourceMetadata } -); - -// Submit assignment operation -Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( - waitUntil: WaitUntil.Started, - details: assignDetails -); - -string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) - ? location - : throw new InvalidOperationException("Operation-Location header not found."); - -// Extract only the jobId part from the URL -string jobId = new Uri(location).Segments.Last().Split('?')[0]; -Console.WriteLine($"Job ID: {jobId}"); - -// Call status API -Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); - -Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md index e005d55b5163..2135ed18c3a5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md @@ -1,4 +1,4 @@ -# Unassigning Deployment Resources Synchronously in Azure AI Language +# Unassigning Deployment Resources in Azure AI Language This sample demonstrates how to unassign deployment resources synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -19,7 +19,7 @@ TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( new List { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" } ); @@ -30,3 +30,26 @@ Operation operation = projectClient.UnassignDeploymentResources( Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); ``` + +## Unassign Deployment Resources Asynchronously + +To unassign deployment resources, call `UnassignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. + +```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" + } +); + +Operation operation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Completed, + details: unassignDetails +); + +Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md deleted file mode 100644 index 15a9e423cfe4..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md +++ /dev/null @@ -1,32 +0,0 @@ -# Unassigning Deployment Resources Asynchronously in Azure AI Language - -This sample demonstrates how to unassign deployment resources asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient using AAD Authentication - -This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. - -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Unassign Deployment Resources Asynchronously - -To unassign deployment resources, call `UnassignDeploymentResourcesAsync` on the `TextAuthoringProject` client. The method returns an `Operation` object containing the unassignment status. - -```C# Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( - new List - { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" - } -); - -Operation operation = await projectClient.UnassignDeploymentResourcesAsync( - waitUntil: WaitUntil.Completed, - details: unassignDetails -); - -Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md index b500cd04a8da..ba26c2b324ab 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md @@ -1,4 +1,4 @@ -# Retrieving Deployment Resources Unassignment Status Synchronously in Azure AI Language +# Retrieving Deployment Resources Unassignment Status in Azure AI Language This sample demonstrates how to retrieve the status of deployment resources unassignment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -20,7 +20,7 @@ TextAuthoringProject projectClient = client.GetProject(projectName); var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( new[] { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" } ); @@ -52,3 +52,48 @@ if (response.Value.Errors != null && response.Value.Errors.Any()) } } ``` + +## Retrieve Deployment Resources Unassignment Status Asynchronously + +To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. + +```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +// Prepare the details for unassigning resources +var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" + } +); + +// Submit the unassign operation and get the job ID +Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: unassignDetails +); + +string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + +string jobId = new Uri(location).Segments.Last().Split('?')[0]; +Console.WriteLine($"Unassign Job ID: {jobId}"); + +// Call the API to get unassign job status +Response response = + await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); + +Console.WriteLine($"Job Status: {response.Value.Status}"); + +if (response.Value.Errors != null && response.Value.Errors.Any()) +{ + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } +} +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md deleted file mode 100644 index b09a443539a4..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md +++ /dev/null @@ -1,54 +0,0 @@ -# Retrieving Deployment Resources Unassignment Status Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve the status of deployment resources unassignment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient using AAD Authentication - -This operation is supported only via AAD authentication and requires the caller to be assigned the Cognitive Service Language Owner role for this assigned resource. - -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Retrieve Deployment Resources Unassignment Status Asynchronously - -To retrieve the status of deployment resources unassignment, call `GetUnassignDeploymentResourcesStatusAsync` on the `TextAuthoringProject` client. The method returns a `Response` containing the unassignment status. - -```C# Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -// Prepare the details for unassigning resources -var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( - new[] - { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" - } -); - -// Submit the unassign operation and get the job ID -Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( - waitUntil: WaitUntil.Started, - details: unassignDetails -); - -string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) - ? location - : throw new InvalidOperationException("Operation-Location header not found."); - -string jobId = new Uri(location).Segments.Last().Split('?')[0]; -Console.WriteLine($"Unassign Job ID: {jobId}"); - -// Call the API to get unassign job status -Response response = - await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); - -Console.WriteLine($"Job Status: {response.Value.Status}"); - -if (response.Value.Errors != null && response.Value.Errors.Any()) -{ - Console.WriteLine("Errors:"); - foreach (var error in response.Value.Errors) - { - Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); - } -} -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md index 4da360fa7505..cb6044c7abf9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md @@ -1,4 +1,4 @@ -# Creating a Project Synchronously in Azure AI Language +# Creating a Project in Azure AI Language This sample demonstrates how to create a new project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -35,3 +35,27 @@ var projectData = new TextAuthoringCreateProjectDetails( ``` To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. + +## Create a Project Asynchronously + +To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample1_TextAuthoring_CreateProjectAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); +var projectData = new TextAuthoringCreateProjectDetails( + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" +) +{ + Description = "Project description for a Custom Entity Recognition project", + Multilingual = true +}; + +Response response = await projectClient.CreateProjectAsync(projectData); + +Console.WriteLine($"Project created with status: {response.Status}"); +``` + +To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md deleted file mode 100644 index 29c4d18c588d..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md +++ /dev/null @@ -1,41 +0,0 @@ -# Creating a Project Asynchronously in Azure AI Language - -This sample demonstrates how to create a new project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Create a Project Asynchronously - -To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample1_TextAuthoring_CreateProjectAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); -var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "{projectKind}", - storageInputContainerName: "{storageInputContainerName}", - language: "{language}" -) -{ - Description = "Project description for a Custom Entity Recognition project", - Multilingual = true -}; - -Response response = await projectClient.CreateProjectAsync(projectData); - -Console.WriteLine($"Project created with status: {response.Status}"); -``` - -To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index fcc937ab49e3..5a8d536f51f4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -1,4 +1,4 @@ -# Importing Project Data Synchronously in Azure AI Language +# Importing Project Data in Azure AI Language This sample demonstrates how to import project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -197,3 +197,183 @@ string operationLocation = operation.GetRawResponse().Headers.TryGetValue("opera Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); ``` + +## Import Project Data Asynchronously + +To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. + +```C# Snippet:Sample2_TextAuthoring_ImportAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); +var projectMetadata = new TextAuthoringCreateProjectDetails( + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" +) +{ + Description = "Sample dataset for Custom Entity Recognition", + Multilingual = false +}; + +var projectAssets = new ExportedCustomEntityRecognitionProjectAsset +{ + Entities = + { + new TextAuthoringExportedEntity + { + Category= "Date" + }, + new TextAuthoringExportedEntity + { + Category= "LenderName" + }, + new TextAuthoringExportedEntity + { + Category= "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } +}; + +var exportedProject = new TextAuthoringExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) +{ + Assets = projectAssets +}; + +Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Completed, + body: exportedProject +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` + +## Import Project Data from Raw JSON String Asynchronously + +To import project data from a raw JSON string asynchronously, call ImportAsync on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. + +```C# Snippet:Sample2_TextAuthoring_ImportRawStringAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +string rawJson = """ +{ + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "{projectKind}", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } +} +"""; + +Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Started, + exportedProject: rawJson +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md deleted file mode 100644 index f281c370160b..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md +++ /dev/null @@ -1,197 +0,0 @@ -# Importing Project Data Asynchronously in Azure AI Language - -This sample demonstrates how to import project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Import Project Data Asynchronously - -To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. - -```C# Snippet:Sample2_TextAuthoring_ImportAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); -var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "{projectKind}", - storageInputContainerName: "{storageInputContainerName}", - language: "{language}" -) -{ - Description = "Sample dataset for Custom Entity Recognition", - Multilingual = false -}; - -var projectAssets = new ExportedCustomEntityRecognitionProjectAsset -{ - Entities = - { - new TextAuthoringExportedEntity - { - Category= "Date" - }, - new TextAuthoringExportedEntity - { - Category= "LenderName" - }, - new TextAuthoringExportedEntity - { - Category= "LenderAddress" - } - }, - Documents = - { - new ExportedCustomEntityRecognitionDocument - { - Location = "01.txt", - Language = "en-us", - Dataset = "Train", - Entities = - { - new ExportedDocumentEntityRegion - { - RegionOffset = 0, - RegionLength = 1793, - Labels = - { - new ExportedDocumentEntityLabel - { - Category = "Date", - Offset = 5, - Length = 9 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderName", - Offset = 273, - Length = 14 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderAddress", - Offset = 314, - Length = 15 - } - } - } - } - }, - new ExportedCustomEntityRecognitionDocument - { - Location = "02.txt", - Language = "en-us", - Dataset = "Train", - Entities = - { - new ExportedDocumentEntityRegion - { - RegionOffset = 0, - RegionLength = 1804, - Labels = - { - new ExportedDocumentEntityLabel - { - Category = "Date", - Offset = 5, - Length = 10 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderName", - Offset = 284, - Length = 10 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderAddress", - Offset = 321, - Length = 20 - } - } - } - } - } - } -}; - -var exportedProject = new TextAuthoringExportedProject( - projectFileVersion: "2022-05-01", - stringIndexType: StringIndexType.Utf16CodeUnit, - metadata: projectMetadata) -{ - Assets = projectAssets -}; - -Operation operation = await projectClient.ImportAsync( - waitUntil: WaitUntil.Completed, - body: exportedProject -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); -``` - -## Import Project Data from Raw JSON String Asynchronously - -To import project data from a raw JSON string asynchronously, call ImportAsync on the TextAuthoringProject client. The method accepts a raw JSON string and returns an Operation object, allowing you to track the import's status and results. - -```C# Snippet:Sample2_TextAuthoring_ImportRawStringAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -string rawJson = """ -{ - "projectFileVersion": "2025-05-15-preview", - "stringIndexType": "Utf16CodeUnit", - "metadata": { - "projectKind": "{projectKind}", - "storageInputContainerName": "{storageInputContainerName}", - "language": "{language}", - "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", - "multilingual": false, - "settings": {} - }, - "assets": { - "projectKind": "{projectKind}", - "classes": [ - { "category": "Date" }, - { "category": "LenderName" }, - { "category": "LenderAddress" } - ], - "documents": [ - { - "class": { "category": "Date" }, - "location": "01.txt", - "language": "en" - }, - { - "class": { "category": "LenderName" }, - "location": "02.txt", - "language": "en" - } - ] - } -} -"""; - -Operation operation = await projectClient.ImportAsync( - waitUntil: WaitUntil.Started, - exportedProject: rawJson -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md index ddd75bc146f0..c01866ccd190 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md @@ -1,4 +1,4 @@ -# Exporting Project Data Synchronously in Azure AI Language +# Exporting Project Data in Azure AI Language This sample demonstrates how to export project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -34,3 +34,23 @@ Console.WriteLine($"Operation Location: {operationLocation}"); Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); ``` + +## Export Project Data Asynchronously + +To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. + +```C# Snippet:Sample3_TextAuthoring_ExportAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +Operation operation = await projectClient.ExportAsync( + waitUntil: WaitUntil.Completed, + stringIndexType: StringIndexType.Utf16CodeUnit +); + +// Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md deleted file mode 100644 index 475a6c4344c2..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md +++ /dev/null @@ -1,37 +0,0 @@ -# Exporting Project Data Asynchronously in Azure AI Language - -This sample demonstrates how to export project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Export Project Data Asynchronously - -To export project data, call `ExportAsync` on the `TextAuthoringProject` client. The method returns an `Operation` that allows you to track the status of the export operation. You can also extract the `operation-location` header from the raw response to get the URL of the operation. - -```C# Snippet:Sample3_TextAuthoring_ExportAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -Operation operation = await projectClient.ExportAsync( - waitUntil: WaitUntil.Completed, - stringIndexType: StringIndexType.Utf16CodeUnit -); - -// Extract the operation-location header -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); - -Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md index e096d2952410..b5ab3354056c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md @@ -1,4 +1,4 @@ -# Retrieving Project Metadata Synchronously in Azure AI Language +# Retrieving Project Metadata in Azure AI Language This sample demonstrates how to retrieve metadata of a project synchronously using the Azure.AI.Language.Text.Authoring SDK. ## Create a TextAnalysisAuthoringClient @@ -33,3 +33,23 @@ Console.WriteLine($"Description: {projectMetadata.Description}"); ``` To retrieve project metadata synchronously, call GetProject on the TextAnalysisAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. + +## Retrieve Project Metadata Asynchronously + +To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample4_TextAuthoring_GetProjectAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +Response response = await projectClient.GetProjectAsync(); +TextAuthoringProjectMetadata projectMetadata = response.Value; + +Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); +Console.WriteLine($"Language: {projectMetadata.Language}"); +Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}"); +Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); +Console.WriteLine($"Description: {projectMetadata.Description}"); +``` + +To retrieve project metadata asynchronously, call GetProjectAsync on the TextAnalysisAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md deleted file mode 100644 index 541e8c7b87c1..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md +++ /dev/null @@ -1,37 +0,0 @@ -# Retrieving Project Metadata Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve metadata of a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Retrieve Project Metadata Asynchronously - -To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample4_TextAuthoring_GetProjectAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -Response response = await projectClient.GetProjectAsync(); -TextAuthoringProjectMetadata projectMetadata = response.Value; - -Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); -Console.WriteLine($"Language: {projectMetadata.Language}"); -Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}"); -Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); -Console.WriteLine($"Description: {projectMetadata.Description}"); -``` - -To retrieve project metadata asynchronously, call GetProjectAsync on the TextAnalysisAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md index b8620bda80e7..d31b982bee77 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md @@ -1,4 +1,4 @@ -# Deleting a Project Synchronously in Azure AI Language +# Deleting a Project in Azure AI Language This sample demonstrates how to delete a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -34,3 +34,22 @@ Console.WriteLine($"Project deletion completed with status: {operation.GetRawRes ``` To delete a project, the DeleteProject method sends a request with the project name. The method returns an Operation object indicating the deletion status. + +## Delete a Project Asynchronously + +To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample5_TextAuthoring_DeleteProjectAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +Operation operation = await projectClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a project, the DeleteProjectAsync method sends a request with the project name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md deleted file mode 100644 index 4ad542104416..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md +++ /dev/null @@ -1,36 +0,0 @@ -# Deleting a Project Asynchronously in Azure AI Language - -This sample demonstrates how to delete a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Delete a Project Asynchronously - -To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample5_TextAuthoring_DeleteProjectAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -Operation operation = await projectClient.DeleteProjectAsync( - waitUntil: WaitUntil.Completed -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); -``` - -To delete a project, the DeleteProjectAsync method sends a request with the project name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md index 9ab4d9487a93..5839b930591a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md @@ -1,4 +1,4 @@ -# Training a Project Synchronously in Azure AI Language +# Training a Project in Azure AI Language This sample demonstrates how to train a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -48,3 +48,36 @@ Console.WriteLine($"Training completed with status: {operation.GetRawResponse(). ``` To train a project, the Train method sends a request with the necessary training job configuration. The method returns an Operation object indicating the training status. + +## Train a Project Asynchronously + +To train a project, call TrainAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample6_TextAuthoring_TrainAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +var trainingJobConfig = new TextAuthoringTrainingJobDetails( + modelLabel: "{modelLabel}", + trainingConfigVersion: "latest" +) +{ + EvaluationOptions = new TextAuthoringEvaluationDetails + { + Kind = TextAuthoringEvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } +}; + +Operation operation = await projectClient.TrainAsync( + waitUntil: WaitUntil.Completed, + details: trainingJobConfig +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); +``` + +To train a project, the TrainAsync method sends a request with the necessary training job configuration. The method returns an Operation object indicating the training status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md deleted file mode 100644 index 07b81e2ecb7f..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md +++ /dev/null @@ -1,50 +0,0 @@ -# Training a Project Asynchronously in Azure AI Language - -This sample demonstrates how to train a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Train a Project Asynchronously - -To train a project, call TrainAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample6_TextAuthoring_TrainAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -var trainingJobConfig = new TextAuthoringTrainingJobDetails( - modelLabel: "{modelLabel}", - trainingConfigVersion: "latest" -) -{ - EvaluationOptions = new TextAuthoringEvaluationDetails - { - Kind = TextAuthoringEvaluationKind.Percentage, - TestingSplitPercentage = 20, - TrainingSplitPercentage = 80 - } -}; - -Operation operation = await projectClient.TrainAsync( - waitUntil: WaitUntil.Completed, - details: trainingJobConfig -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); -``` - -To train a project, the TrainAsync method sends a request with the necessary training job configuration. The method returns an Operation object indicating the training status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md index 902b7ee84966..691c6e835580 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md @@ -1,4 +1,4 @@ -# Canceling a Training Job Synchronously in Azure AI Language +# Canceling a Training Job in Azure AI Language This sample demonstrates how to cancel a training job synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -37,3 +37,25 @@ Console.WriteLine($"Training job cancellation completed with status: {operation. ``` To cancel a training job, the CancelTrainingJob method sends a request with the project name and the job ID. The method returns an Operation object indicating the cancellation status. + +## Cancel a Training Job Asynchronously + +To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync +string projectName = "{projectName}"; +TextAuthoringProject projectClient = client.GetProject(projectName); + +string jobId = "{jobId}"; // Replace with an actual job ID. + +Operation operation = await projectClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + jobId: jobId +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); +``` + +To cancel a training job, the CancelTrainingJobAsync method sends a request with the project name and the job ID. The method returns an Operation object indicating the cancellation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md deleted file mode 100644 index a943e0968a20..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md +++ /dev/null @@ -1,39 +0,0 @@ -# Canceling a Training Job Asynchronously in Azure AI Language - -This sample demonstrates how to cancel a training job asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Cancel a Training Job Asynchronously - -To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync -string projectName = "{projectName}"; -TextAuthoringProject projectClient = client.GetProject(projectName); - -string jobId = "{jobId}"; // Replace with an actual job ID. - -Operation operation = await projectClient.CancelTrainingJobAsync( - waitUntil: WaitUntil.Completed, - jobId: jobId -); - -string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; -Console.WriteLine($"Operation Location: {operationLocation}"); -Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); -``` - -To cancel a training job, the CancelTrainingJobAsync method sends a request with the project name and the job ID. The method returns an Operation object indicating the cancellation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md index 2f301703c7c9..66d2b7738435 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md @@ -1,4 +1,4 @@ -# Retrieving Model Evaluation Summary Synchronously in Azure AI Language +# Retrieving Model Evaluation Summary in Azure AI Language This sample demonstrates how to retrieve the evaluation summary of a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -87,3 +87,75 @@ else ``` To retrieve a model evaluation summary, the GetModelEvaluationSummary method sends a request with the project name and the model label. It returns a specific EvaluationSummary object containing metrics such as F1 score, precision, recall, and class-specific metrics. + +## Get Model Evaluation Summary Asynchronously + +To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + +// Get the evaluation summary for the trained model +Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); + +TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; + +// Cast to the specific evaluation summary type for custom single label classification +if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) +{ + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) + { + Console.WriteLine($"Row: {row.Key}"); + foreach (var col in row.Value.AdditionalProperties) + { + try + { + // Deserialize BinaryData properly + var cell = col.Value.ToObject(new JsonObjectSerializer()); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); + } + catch (Exception ex) + { + Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); + } + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } +} +else +{ + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); +} +``` + +To retrieve a model evaluation summary, the GetModelEvaluationSummaryAsync method sends a request with the project name and the model label. It returns a specific EvaluationSummary object containing metrics such as F1 score, precision, recall, and class-specific metrics. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md deleted file mode 100644 index 4320988d4e7e..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md +++ /dev/null @@ -1,89 +0,0 @@ -# Retrieving Model Evaluation Summary Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve the evaluation summary of a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Get Model Evaluation Summary Asynchronously - -To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. - -```C# Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync -string projectName = "{projectName}"; -string trainedModelLabel = "{modelLabel}"; -TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - -// Get the evaluation summary for the trained model -Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); - -TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; - -// Cast to the specific evaluation summary type for custom single label classification -if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) -{ - Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); - Console.WriteLine($"Evaluation Options: "); - Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); - Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); - Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); - - Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); - Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); - Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); - Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); - Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); - Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); - - // Print confusion matrix - Console.WriteLine("Confusion Matrix:"); - foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) - { - Console.WriteLine($"Row: {row.Key}"); - foreach (var col in row.Value.AdditionalProperties) - { - try - { - // Deserialize BinaryData properly - var cell = col.Value.ToObject(new JsonObjectSerializer()); - Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); - } - catch (Exception ex) - { - Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); - } - } - } - - // Print class-specific metrics - Console.WriteLine("Class-Specific Metrics:"); - foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) - { - Console.WriteLine($"Class: {kvp.Key}"); - Console.WriteLine($" F1: {kvp.Value.F1}"); - Console.WriteLine($" Precision: {kvp.Value.Precision}"); - Console.WriteLine($" Recall: {kvp.Value.Recall}"); - Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); - Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); - Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); - Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); - } -} -else -{ - Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); -} -``` - -To retrieve a model evaluation summary, the GetModelEvaluationSummaryAsync method sends a request with the project name and the model label. It returns a specific EvaluationSummary object containing metrics such as F1 score, precision, recall, and class-specific metrics. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md index 736000cdb5b0..8532e114fae3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md @@ -1,4 +1,4 @@ -# Retrieving Model Evaluation Results Synchronously in Azure AI Language +# Retrieving Model Evaluation Results in Azure AI Language This sample demonstrates how to retrieve model evaluation results synchronously using the `Azure.AI.Language.Text.Authoring` SDK. @@ -46,3 +46,34 @@ foreach (TextAuthoringDocumentEvalResult result in results) // Add handling for other result types as needed } ``` + +## Retrieve Model Evaluation Results Asynchronously + +To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. + +```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync +string projectName = "{projectName}"; +string trainedModelLabel = "{modelLabel}"; +StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + +TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + +AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( + stringIndexType: stringIndexType +); + +await foreach (TextAuthoringDocumentEvalResult result in results) +{ + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); + + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) + { + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); + } + // Add handling for other result types as needed +} +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md deleted file mode 100644 index 1f77af0246d4..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md +++ /dev/null @@ -1,48 +0,0 @@ -# Retrieving Model Evaluation Results Asynchronously in Azure AI Language - -This sample demonstrates how to retrieve model evaluation results asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. - -## Create a TextAnalysisAuthoringClient - -To create a `TextAnalysisAuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `TextAnalysisAuthoringClientOptions` instance. - -```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion -Uri endpoint = new Uri("{endpoint}"); -AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); -TextAnalysisAuthoringClientOptions options = new TextAnalysisAuthoringClientOptions(TextAnalysisAuthoringClientOptions.ServiceVersion.V2025_05_15_Preview); -TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential, options); -``` - -Or you can also create a `TextAnalysisAuthoringClient` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. -For details on how to set up AAD authentication, refer to the [Create a client using AAD](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md#create-a-client-using-azure-active-directory-authentication). - -## Retrieve Model Evaluation Results Asynchronously - -To retrieve model evaluation results, call `GetModelEvaluationResultsAsync` on the `TextAuthoringTrainedModel` client. The method returns an `AsyncPageable` that allows you to enumerate the evaluation results for each document asynchronously. - -```C# Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync -string projectName = "{projectName}"; -string trainedModelLabel = "{modelLabel}"; -StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; - -TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - -AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( - stringIndexType: stringIndexType -); - -await foreach (TextAuthoringDocumentEvalResult result in results) -{ - Console.WriteLine($"Document Location: {result.Location}"); - Console.WriteLine($"Language: {result.Language}"); - - // Example: handle single-label classification results - if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) - { - var classification = singleLabelResult.CustomSingleLabelClassificationResult; - Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); - Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); - } - // Add handling for other result types as needed -} -``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs index 6476e9679ffa..075ba19c7d52 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs @@ -37,5 +37,30 @@ public void LoadSnapshot() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); } + + [Test] + [AsyncOnly] + public async Task LoadSnapshotAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample10_TextAuthoring_LoadSnapshotAsync + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + Operation operation = await trainedModelClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs deleted file mode 100644 index d1873c83e45a..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshotAsync.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample10_TextAuthoring_LoadSnapshotAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task LoadSnapshotAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample10_TextAuthoring_LoadSnapshotAsync - string projectName = "{projectName}"; - string trainedModelLabel = "{modelLabel}"; // Replace with your actual model label. - TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - - Operation operation = await trainedModelClient.LoadSnapshotAsync( - waitUntil: WaitUntil.Completed - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs index f1cd674d4087..42fa42489f97 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs @@ -33,5 +33,26 @@ public void DeleteTrainedModel() Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); } + + [Test] + [AsyncOnly] + public async Task DeleteTrainedModelAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + Response response = await trainedModelClient.DeleteTrainedModelAsync(); + + Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); + #endregion + + Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs deleted file mode 100644 index f58b1c784abf..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample11_TextAuthoring_DeleteTrainedModelAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task DeleteTrainedModelAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample11_TextAuthoring_DeleteTrainedModelAsync - string projectName = "{projectName}"; - string trainedModelLabel = "{modelLabel}"; - TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - - Response response = await trainedModelClient.DeleteTrainedModelAsync(); - - Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); - #endregion - - Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index 88e681a33d75..f1f07ade1d4f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -42,5 +42,36 @@ public void SwapDeployments() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); } + + [Test] + [AsyncOnly] + public async Task SwapDeploymentsAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync + string projectName = "{projectName}"; + string firstDeploymentName = "{deploymentName1}"; + string secondDeploymentName = "{deploymentName2}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + var swapDetails = new TextAuthoringSwapDeploymentsDetails + ( + firstDeploymentName: firstDeploymentName, + secondDeploymentName: secondDeploymentName + ); + + Operation operation = await projectClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + details: swapDetails + ); + + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs deleted file mode 100644 index 69e221ac287e..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeploymentsAsync.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample12_TextAuthoring_SwapDeploymentsAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task SwapDeploymentsAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample12_TextAuthoring_SwapDeploymentsAsync - string projectName = "{projectName}"; - string firstDeploymentName = "{deploymentName1}"; - string secondDeploymentName = "{deploymentName2}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - var swapDetails = new TextAuthoringSwapDeploymentsDetails - ( - firstDeploymentName: firstDeploymentName, - secondDeploymentName: secondDeploymentName - ); - - Operation operation = await projectClient.SwapDeploymentsAsync( - waitUntil: WaitUntil.Completed, - details: swapDetails - ); - - Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs index e09ced843d9d..6c42b568e02e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs @@ -35,5 +35,28 @@ public void DeleteDeployment() Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); } + + [Test] + [AsyncOnly] + public async Task DeleteDeploymentAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + Operation operation = await deploymentClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed + ); + + Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs deleted file mode 100644 index bdba23eae1b3..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeploymentAsync.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample13_TextAuthoring_DeleteDeploymentAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task DeleteDeploymentAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample13_TextAuthoring_DeleteDeploymentAsync - string projectName = "{projectName}"; - string deploymentName = "{deploymentName}"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - - Operation operation = await deploymentClient.DeleteDeploymentAsync( - waitUntil: WaitUntil.Completed - ); - - Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs index 64e7cacac30d..934dfc145beb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs @@ -38,5 +38,31 @@ public void DeployProject() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); } + + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample14_TextAuthoring_DeployProjectAsync + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); + + Operation operation = await deploymentClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + details: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs deleted file mode 100644 index b103986d3666..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProjectAsync.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample14_TextAuthoring_DeployProjectAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task DeployProjectAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample14_TextAuthoring_DeployProjectAsync - string projectName = "{projectName}"; - string deploymentName = "{deploymentName}"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - - var deploymentConfig = new TextAuthoringCreateDeploymentDetails(trainedModelLabel: "{modelLabel}"); - - Operation operation = await deploymentClient.DeployProjectAsync( - waitUntil: WaitUntil.Completed, - details: deploymentConfig - ); - - Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs index 582bc95421ff..181201004dce 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -38,5 +38,31 @@ public void GetDeployment() Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); #endregion } + + [Test] + [AsyncOnly] + public async Task GetDeploymentAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample15_TextAuthoring_GetDeploymentAsync + string projectName = "{projectName}"; + string deploymentName = "{deploymentName}"; + TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); + + Response response = await deploymentClient.GetDeploymentAsync(); + + TextAuthoringProjectDeployment deployment = response.Value; + + Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); + Console.WriteLine($"Model Id: {deployment.ModelId}"); + Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); + Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); + Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); + Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs deleted file mode 100644 index 00b9dbf4241a..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeploymentAsync.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample15_TextAuthoring_GetDeploymentAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetDeploymentAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample15_TextAuthoring_GetDeploymentAsync - string projectName = "{projectName}"; - string deploymentName = "{deploymentName}"; - TextAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName); - - Response response = await deploymentClient.GetDeploymentAsync(); - - TextAuthoringProjectDeployment deployment = response.Value; - - Console.WriteLine($"Deployment Name: {deployment.DeploymentName}"); - Console.WriteLine($"Model Id: {deployment.ModelId}"); - Console.WriteLine($"Last Trained On: {deployment.LastTrainedOn}"); - Console.WriteLine($"Last Deployed On: {deployment.LastDeployedOn}"); - Console.WriteLine($"Deployment Expired On: {deployment.DeploymentExpiredOn}"); - Console.WriteLine($"Model Training Config Version: {deployment.ModelTrainingConfigVersion}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index 5b4c54280f41..65c0de4a8657 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -44,5 +44,36 @@ public void AssignDeploymentResources() Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); #endregion } + + [Test] + [AsyncOnly] + public async Task AssignDeploymentResourcesAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" + ); + + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } + ); + + Operation operation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Completed, + details: assignDetails + ); + + Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs deleted file mode 100644 index ddbcbef4640a..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample16_TextAuthoring_AssignDeploymentResourcesAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task AssignDeploymentResourcesAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample16_TextAuthoring_AssignDeploymentResourcesAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", - customDomain: "{customDomain}", - region: "{Region}" - ); - - var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( - new List { resourceMetadata } - ); - - Operation operation = await projectClient.AssignDeploymentResourcesAsync( - waitUntil: WaitUntil.Completed, - details: assignDetails - ); - - Console.WriteLine($"Deployment resources assigned with status: {operation.GetRawResponse().Status}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index 1cb5615807e6..f3e8161301c2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -57,5 +57,48 @@ public void GetAssignDeploymentResourcesStatus() Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); #endregion } + + [Test] + [AsyncOnly] + public async Task GetAssignDeploymentResourcesStatusAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + DefaultAzureCredential credential = new DefaultAzureCredential(); + var client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + var resourceMetadata = new TextAuthoringResourceMetadata( + azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", + customDomain: "{customDomain}", + region: "{Region}" + ); + + var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( + new List { resourceMetadata } + ); + + // Submit assignment operation + Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: assignDetails + ); + + string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + + // Extract only the jobId part from the URL + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Job ID: {jobId}"); + + // Call status API + Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); + + Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs deleted file mode 100644 index 51adcd776ac6..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetAssignDeploymentResourcesStatusAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - DefaultAzureCredential credential = new DefaultAzureCredential(); - var client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - var resourceMetadata = new TextAuthoringResourceMetadata( - azureResourceId: "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}", - customDomain: "{customDomain}", - region: "{Region}" - ); - - var assignDetails = new TextAuthoringAssignDeploymentResourcesDetails( - new List { resourceMetadata } - ); - - // Submit assignment operation - Operation assignOperation = await projectClient.AssignDeploymentResourcesAsync( - waitUntil: WaitUntil.Started, - details: assignDetails - ); - - string operationLocation = assignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) - ? location - : throw new InvalidOperationException("Operation-Location header not found."); - - // Extract only the jobId part from the URL - string jobId = new Uri(location).Segments.Last().Split('?')[0]; - Console.WriteLine($"Job ID: {jobId}"); - - // Call status API - Response statusResponse = await projectClient.GetAssignDeploymentResourcesStatusAsync(jobId); - - Console.WriteLine($"Deployment assignment status: {statusResponse.Value.Status}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs index 7120d478f5f9..1e1285d58f4f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -29,7 +29,7 @@ public void UnassignDeploymentResources() var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( new List { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" } ); @@ -43,5 +43,35 @@ public void UnassignDeploymentResources() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful unassignment of deployment resources."); } + + [Test] + [AsyncOnly] + public async Task UnassignDeploymentResourcesAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new List + { + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" + } + ); + + Operation operation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Completed, + details: unassignDetails + ); + + Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful unassignment of deployment resources."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs deleted file mode 100644 index 1aa466802675..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample18_TextAuthoring_UnassignDeploymentResourcesAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task UnassignDeploymentResourcesAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample18_TextAuthoring_UnassignDeploymentResourcesAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( - new List - { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" - } - ); - - Operation operation = await projectClient.UnassignDeploymentResourcesAsync( - waitUntil: WaitUntil.Completed, - details: unassignDetails - ); - - Console.WriteLine($"Unassign operation completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful unassignment of deployment resources."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs index 26a510c23e8c..6c0da92210f8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -31,7 +31,7 @@ public void GetUnassignDeploymentResourcesStatus() var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( new[] { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" } ); @@ -66,5 +66,55 @@ public void GetUnassignDeploymentResourcesStatus() Assert.AreEqual("Succeeded", response.Value.Status, "Expected the unassign operation to succeed."); } + + [Test] + [AsyncOnly] + public async Task GetUnassignDeploymentResourcesStatusAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + DefaultAzureCredential credential = new DefaultAzureCredential(); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + // Prepare the details for unassigning resources + var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( + new[] + { + "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.CognitiveServices/accounts/{sampleAccount}" + } + ); + + // Submit the unassign operation and get the job ID + Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( + waitUntil: WaitUntil.Started, + details: unassignDetails + ); + + string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) + ? location + : throw new InvalidOperationException("Operation-Location header not found."); + + string jobId = new Uri(location).Segments.Last().Split('?')[0]; + Console.WriteLine($"Unassign Job ID: {jobId}"); + + // Call the API to get unassign job status + Response response = + await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); + + Console.WriteLine($"Job Status: {response.Value.Status}"); + + if (response.Value.Errors != null && response.Value.Errors.Any()) + { + Console.WriteLine("Errors:"); + foreach (var error in response.Value.Errors) + { + Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); + } + } + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs deleted file mode 100644 index 8601558dc295..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Linq; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetUnassignDeploymentResourcesStatusAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - DefaultAzureCredential credential = new DefaultAzureCredential(); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - // Prepare the details for unassigning resources - var unassignDetails = new TextAuthoringUnassignDeploymentResourcesDetails( - new[] - { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/my-cognitive-account" - } - ); - - // Submit the unassign operation and get the job ID - Operation unassignOperation = await projectClient.UnassignDeploymentResourcesAsync( - waitUntil: WaitUntil.Started, - details: unassignDetails - ); - - string operationLocation = unassignOperation.GetRawResponse().Headers.TryGetValue("Operation-Location", out var location) - ? location - : throw new InvalidOperationException("Operation-Location header not found."); - - string jobId = new Uri(location).Segments.Last().Split('?')[0]; - Console.WriteLine($"Unassign Job ID: {jobId}"); - - // Call the API to get unassign job status - Response response = - await projectClient.GetUnassignDeploymentResourcesStatusAsync(jobId); - - Console.WriteLine($"Job Status: {response.Value.Status}"); - - if (response.Value.Errors != null && response.Value.Errors.Any()) - { - Console.WriteLine("Errors:"); - foreach (var error in response.Value.Errors) - { - Console.WriteLine($"- Code: {error.Code}, Message: {error.Message}"); - } - } - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index 1d68cd904839..7c48e80e5665 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -41,5 +41,34 @@ public void CreateProject() Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); } + + [Test] + [AsyncOnly] + public async Task CreateProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample1_TextAuthoring_CreateProjectAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + var projectData = new TextAuthoringCreateProjectDetails( + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" + ) + { + Description = "Project description for a Custom Entity Recognition project", + Multilingual = true + }; + + Response response = await projectClient.CreateProjectAsync(projectData); + + Console.WriteLine($"Project created with status: {response.Status}"); + #endregion + + Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs deleted file mode 100644 index f4f9a07ac6ed..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProjectAsync.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample1_TextAuthoring_CreateProjectAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task CreateProjectAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample1_TextAuthoring_CreateProjectAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - var projectData = new TextAuthoringCreateProjectDetails( - projectKind: "{projectKind}", - storageInputContainerName: "{storageInputContainerName}", - language: "{language}" - ) - { - Description = "Project description for a Custom Entity Recognition project", - Multilingual = true - }; - - Response response = await projectClient.CreateProjectAsync(projectData); - - Console.WriteLine($"Project created with status: {response.Status}"); - #endregion - - Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index c430d4dc7aca..b4648e97e632 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -205,5 +205,195 @@ public void ImportRawString() Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); #endregion } + + [Test] + [AsyncOnly] + public async Task ImportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_ImportAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + var projectMetadata = new TextAuthoringCreateProjectDetails( + projectKind: "{projectKind}", + storageInputContainerName: "{storageInputContainerName}", + language: "{language}" + ) + { + Description = "Sample dataset for Custom Entity Recognition", + Multilingual = false + }; + + var projectAssets = new ExportedCustomEntityRecognitionProjectAsset + { + Entities = + { + new TextAuthoringExportedEntity + { + Category= "Date" + }, + new TextAuthoringExportedEntity + { + Category= "LenderName" + }, + new TextAuthoringExportedEntity + { + Category= "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } + }; + + var exportedProject = new TextAuthoringExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) + { + Assets = projectAssets + }; + + Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Completed, + body: exportedProject + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + + [Test] + [AsyncOnly] + public async Task ImportRawStringAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample2_TextAuthoring_ImportRawStringAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + string rawJson = """ + { + "projectFileVersion": "2025-05-15-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "{projectKind}", + "storageInputContainerName": "{storageInputContainerName}", + "language": "{language}", + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "multilingual": false, + "settings": {} + }, + "assets": { + "projectKind": "{projectKind}", + "classes": [ + { "category": "Date" }, + { "category": "LenderName" }, + { "category": "LenderAddress" } + ], + "documents": [ + { + "class": { "category": "Date" }, + "location": "01.txt", + "language": "en" + }, + { + "class": { "category": "LenderName" }, + "location": "02.txt", + "language": "en" + } + ] + } + } + """; + + Operation operation = await projectClient.ImportAsync( + waitUntil: WaitUntil.Started, + exportedProject: rawJson + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs deleted file mode 100644 index 7464ee7d8faf..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample2_TextAuthoring_ImportAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task ImportAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample2_TextAuthoring_ImportAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - var projectMetadata = new TextAuthoringCreateProjectDetails( - projectKind: "{projectKind}", - storageInputContainerName: "{storageInputContainerName}", - language: "{language}" - ) - { - Description = "Sample dataset for Custom Entity Recognition", - Multilingual = false - }; - - var projectAssets = new ExportedCustomEntityRecognitionProjectAsset - { - Entities = - { - new TextAuthoringExportedEntity - { - Category= "Date" - }, - new TextAuthoringExportedEntity - { - Category= "LenderName" - }, - new TextAuthoringExportedEntity - { - Category= "LenderAddress" - } - }, - Documents = - { - new ExportedCustomEntityRecognitionDocument - { - Location = "01.txt", - Language = "en-us", - Dataset = "Train", - Entities = - { - new ExportedDocumentEntityRegion - { - RegionOffset = 0, - RegionLength = 1793, - Labels = - { - new ExportedDocumentEntityLabel - { - Category = "Date", - Offset = 5, - Length = 9 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderName", - Offset = 273, - Length = 14 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderAddress", - Offset = 314, - Length = 15 - } - } - } - } - }, - new ExportedCustomEntityRecognitionDocument - { - Location = "02.txt", - Language = "en-us", - Dataset = "Train", - Entities = - { - new ExportedDocumentEntityRegion - { - RegionOffset = 0, - RegionLength = 1804, - Labels = - { - new ExportedDocumentEntityLabel - { - Category = "Date", - Offset = 5, - Length = 10 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderName", - Offset = 284, - Length = 10 - }, - new ExportedDocumentEntityLabel - { - Category = "LenderAddress", - Offset = 321, - Length = 20 - } - } - } - } - } - } - }; - - var exportedProject = new TextAuthoringExportedProject( - projectFileVersion: "2022-05-01", - stringIndexType: StringIndexType.Utf16CodeUnit, - metadata: projectMetadata) - { - Assets = projectAssets - }; - - Operation operation = await projectClient.ImportAsync( - waitUntil: WaitUntil.Completed, - body: exportedProject - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); - #endregion - } - - [Test] - [AsyncOnly] - public async Task ImportRawStringAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample2_TextAuthoring_ImportRawStringAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - string rawJson = """ - { - "projectFileVersion": "2025-05-15-preview", - "stringIndexType": "Utf16CodeUnit", - "metadata": { - "projectKind": "{projectKind}", - "storageInputContainerName": "{storageInputContainerName}", - "language": "{language}", - "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", - "multilingual": false, - "settings": {} - }, - "assets": { - "projectKind": "{projectKind}", - "classes": [ - { "category": "Date" }, - { "category": "LenderName" }, - { "category": "LenderAddress" } - ], - "documents": [ - { - "class": { "category": "Date" }, - "location": "01.txt", - "language": "en" - }, - { - "class": { "category": "LenderName" }, - "location": "02.txt", - "language": "en" - } - ] - } - } - """; - - Operation operation = await projectClient.ImportAsync( - waitUntil: WaitUntil.Started, - exportedProject: rawJson - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs index 92319b7797e4..df1dc719d337 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -38,5 +38,30 @@ public void Export() Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); #endregion } + + [Test] + [AsyncOnly] + public async Task ExportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample3_TextAuthoring_ExportAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + Operation operation = await projectClient.ExportAsync( + waitUntil: WaitUntil.Completed, + stringIndexType: StringIndexType.Utf16CodeUnit + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs deleted file mode 100644 index 2af4dfcdfce4..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_ExportAsync.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample3_TextAuthoring_ExportAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task ExportAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample3_TextAuthoring_ExportAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - Operation operation = await projectClient.ExportAsync( - waitUntil: WaitUntil.Completed, - stringIndexType: StringIndexType.Utf16CodeUnit - ); - - // Extract the operation-location header - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - - Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs index b0bb747c67f6..b3e864769fa5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs @@ -35,5 +35,28 @@ public void GetProject() Console.WriteLine($"Description: {projectMetadata.Description}"); #endregion } + + [Test] + [AsyncOnly] + public async Task GetProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample4_TextAuthoring_GetProjectAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + Response response = await projectClient.GetProjectAsync(); + TextAuthoringProjectMetadata projectMetadata = response.Value; + + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs deleted file mode 100644 index ca849dabf4d0..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProjectAsync.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample4_TextAuthoring_GetProjectAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetProjectAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample4_TextAuthoring_GetProjectAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - Response response = await projectClient.GetProjectAsync(); - TextAuthoringProjectMetadata projectMetadata = response.Value; - - Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); - Console.WriteLine($"Language: {projectMetadata.Language}"); - Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}"); - Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}"); - Console.WriteLine($"Description: {projectMetadata.Description}"); - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs index 73c442d75a0a..467f05ebcfdb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs @@ -36,5 +36,29 @@ public void DeleteProject() Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); } + + [Test] + [AsyncOnly] + public async Task DeleteProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample5_TextAuthoring_DeleteProjectAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + Operation operation = await projectClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs deleted file mode 100644 index ec3415a45e68..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProjectAsync.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample5_TextAuthoring_DeleteProjectAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task DeleteProjectAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample5_TextAuthoring_DeleteProjectAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - Operation operation = await projectClient.DeleteProjectAsync( - waitUntil: WaitUntil.Completed - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs index c2e8d32fec8d..80fa52e5e530 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs @@ -50,5 +50,43 @@ public void Train() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); } + + [Test] + [AsyncOnly] + public async Task TrainAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample6_TextAuthoring_TrainAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + var trainingJobConfig = new TextAuthoringTrainingJobDetails( + modelLabel: "{modelLabel}", + trainingConfigVersion: "latest" + ) + { + EvaluationOptions = new TextAuthoringEvaluationDetails + { + Kind = TextAuthoringEvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + Operation operation = await projectClient.TrainAsync( + waitUntil: WaitUntil.Completed, + details: trainingJobConfig + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs deleted file mode 100644 index 3dc87a39138b..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_TrainAsync.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample6_TextAuthoring_TrainAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task TrainAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample6_TextAuthoring_TrainAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - var trainingJobConfig = new TextAuthoringTrainingJobDetails( - modelLabel: "{modelLabel}", - trainingConfigVersion: "latest" - ) - { - EvaluationOptions = new TextAuthoringEvaluationDetails - { - Kind = TextAuthoringEvaluationKind.Percentage, - TestingSplitPercentage = 20, - TrainingSplitPercentage = 80 - } - }; - - Operation operation = await projectClient.TrainAsync( - waitUntil: WaitUntil.Completed, - details: trainingJobConfig - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index 7b20645c4f78..4d3ae636c674 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -39,5 +39,32 @@ public void CancelTrainingJob() Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); } + + [Test] + [AsyncOnly] + public async Task CancelTrainingJobAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync + string projectName = "{projectName}"; + TextAuthoringProject projectClient = client.GetProject(projectName); + + string jobId = "{jobId}"; // Replace with an actual job ID. + + Operation operation = await projectClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + jobId: jobId + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs deleted file mode 100644 index 7135c301f8b6..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJobAsync.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample7_TextAuthoring_CancelTrainingJobAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task CancelTrainingJobAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample7_TextAuthoring_CancelTrainingJobAsync - string projectName = "{projectName}"; - TextAuthoringProject projectClient = client.GetProject(projectName); - - string jobId = "{jobId}"; // Replace with an actual job ID. - - Operation operation = await projectClient.CancelTrainingJobAsync( - waitUntil: WaitUntil.Completed, - jobId: jobId - ); - - string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; - Console.WriteLine($"Operation Location: {operationLocation}"); - Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); - #endregion - - Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs index 4171ae7aaa11..f6ae8daae8b4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs @@ -87,5 +87,80 @@ public void GetModelEvaluationSummary() } #endregion } + + [Test] + [AsyncOnly] + public async Task GetModelEvaluationSummaryAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + // Get the evaluation summary for the trained model + Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); + + TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Cast to the specific evaluation summary type for custom single label classification + if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) + { + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) + { + Console.WriteLine($"Row: {row.Key}"); + foreach (var col in row.Value.AdditionalProperties) + { + try + { + // Deserialize BinaryData properly + var cell = col.Value.ToObject(new JsonObjectSerializer()); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); + } + catch (Exception ex) + { + Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); + } + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + } + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs deleted file mode 100644 index e48c0ac6bde1..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; -using System.Text.Json; -using Azure.Core.Serialization; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample8_TextAuthoring_GetModelEvaluationSummaryAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetModelEvaluationSummaryAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample8_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync - string projectName = "{projectName}"; - string trainedModelLabel = "{modelLabel}"; - TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - - // Get the evaluation summary for the trained model - Response evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync(); - - TextAuthoringEvalSummary evaluationSummary = evaluationSummaryResponse.Value; - - // Cast to the specific evaluation summary type for custom single label classification - if (evaluationSummary is CustomSingleLabelClassificationEvalSummary singleLabelSummary) - { - Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); - Console.WriteLine($"Evaluation Options: "); - Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); - Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); - Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); - - Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); - Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); - Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); - Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); - Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); - Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); - - // Print confusion matrix - Console.WriteLine("Confusion Matrix:"); - foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix) - { - Console.WriteLine($"Row: {row.Key}"); - foreach (var col in row.Value.AdditionalProperties) - { - try - { - // Deserialize BinaryData properly - var cell = col.Value.ToObject(new JsonObjectSerializer()); - Console.WriteLine($" Column: {col.Key}, Normalized Value: {cell.NormalizedValue}, Raw Value: {cell.RawValue}"); - } - catch (Exception ex) - { - Console.WriteLine($" Error deserializing column {col.Key}: {ex.Message}"); - } - } - } - - // Print class-specific metrics - Console.WriteLine("Class-Specific Metrics:"); - foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) - { - Console.WriteLine($"Class: {kvp.Key}"); - Console.WriteLine($" F1: {kvp.Value.F1}"); - Console.WriteLine($" Precision: {kvp.Value.Precision}"); - Console.WriteLine($" Recall: {kvp.Value.Recall}"); - Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); - Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); - Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); - Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); - } - } - else - { - Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); - } - #endregion - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs index f90b0431bae5..235d9cba21b4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs @@ -48,5 +48,41 @@ public void GetModelEvaluationResults() } #endregion } + + [Test] + [AsyncOnly] + public async Task GetModelEvaluationResultsAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); + + #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync + string projectName = "{projectName}"; + string trainedModelLabel = "{modelLabel}"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + + TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); + + AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( + stringIndexType: stringIndexType + ); + + await foreach (TextAuthoringDocumentEvalResult result in results) + { + Console.WriteLine($"Document Location: {result.Location}"); + Console.WriteLine($"Language: {result.Language}"); + + // Example: handle single-label classification results + if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) + { + var classification = singleLabelResult.CustomSingleLabelClassificationResult; + Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); + Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); + } + // Add handling for other result types as needed + } + #endregion + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs deleted file mode 100644 index debcc49c6b21..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Tests.Samples -{ - public partial class Sample9_TextAuthoring_GetModelEvaluationResultsAsync : SamplesBase - { - [Test] - [AsyncOnly] - public async Task GetModelEvaluationResultsAsync() - { - Uri endpoint = TestEnvironment.Endpoint; - AzureKeyCredential credential = new(TestEnvironment.ApiKey); - TextAnalysisAuthoringClient client = new TextAnalysisAuthoringClient(endpoint, credential); - - #region Snippet:Sample9_TextAuthoring_GetModelEvaluationResultsAsync - string projectName = "{projectName}"; - string trainedModelLabel = "{modelLabel}"; - StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; - - TextAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel); - - AsyncPageable results = trainedModelClient.GetModelEvaluationResultsAsync( - stringIndexType: stringIndexType - ); - - await foreach (TextAuthoringDocumentEvalResult result in results) - { - Console.WriteLine($"Document Location: {result.Location}"); - Console.WriteLine($"Language: {result.Language}"); - - // Example: handle single-label classification results - if (result is CustomSingleLabelClassificationDocumentEvalResult singleLabelResult) - { - var classification = singleLabelResult.CustomSingleLabelClassificationResult; - Console.WriteLine($"Expected Class: {classification.ExpectedClass}"); - Console.WriteLine($"Predicted Class: {classification.PredictedClass}"); - } - // Add handling for other result types as needed - } - #endregion - } - } -} From e7ed1d31f1c0159251babc50cdd20e4a6808c84f Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 11:40:25 -0700 Subject: [PATCH 41/47] removed all the async sample links from readme --- .../README.md | 57 +++++++------------ .../samples/README.md | 57 +++++++------------ 2 files changed, 38 insertions(+), 76 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 23a7ae15565c..cdeb5c39f8ff 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -152,44 +152,25 @@ We guarantee that all client instance methods are thread-safe and independent of You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). -* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) -* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) -* [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) -* [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) -* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) -* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) -* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) -* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) -* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) -* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) -* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) -* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) -* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) -* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) -* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) -* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) -* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) -* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) -* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) -* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) -* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) -* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) -* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) -* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) -* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) -* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) -* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) -* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) -* [Get Deployment Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) -* [Get Deployment Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) -* [Assign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) -* [Assign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) -* [Get Deployment Resources Assignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) -* [Get Deployment Resources Assignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) -* [Unassign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) -* [Unassign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) -* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) -* [Get Deployment Resources Unassignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) +* [Create a New Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Import a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Export a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Get Project Details](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Delete a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Train a Model](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Cancel Training Job](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Get Model Evaluation Summary](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Results](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Load Snapshot](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Delete a Trained Model](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Swap Deployments](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Delete a Deployment](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Deploy a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Get Deployment Details](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Assign Deployment Resources](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Get Deployment Resources Assignment Status](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Unassign Deployment Resources](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Get Deployment Resources Unassignment Status](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) ## Troubleshooting diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md index 5ad9fb7bc99f..69dd72785f6e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md @@ -15,41 +15,22 @@ Azure Text Authoring is part of the Azure Cognitive Service for Language, a clou ## Common Scenarios Samples -* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) -* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProjectAsync.md) -* [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) -* [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) -* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) -* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_ExportAsync.md) -* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) -* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProjectAsync.md) -* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) -* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProjectAsync.md) -* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) -* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_TrainAsync.md) -* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) -* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJobAsync.md) -* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) -* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummaryAsync.md) -* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) -* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResultsAsync.md) -* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) -* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshotAsync.md) -* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) -* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModelAsync.md) -* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) -* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeploymentsAsync.md) -* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) -* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeploymentAsync.md) -* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) -* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProjectAsync.md) -* [Get Deployment Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) -* [Get Deployment Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeploymentAsync.md) -* [Assign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) -* [Assign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResourcesAsync.md) -* [Get Deployment Resources Assignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) -* [Get Deployment Resources Assignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatusAsync.md) -* [Unassign Deployment Resources (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) -* [Unassign Deployment Resources (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResourcesAsync.md) -* [Get Deployment Resources Unassignment Status (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) -* [Get Deployment Resources Unassignment Status (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatusAsync.md) +* [Create a New Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_CreateProject.md) +* [Import a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Export a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_Export.md) +* [Get Project Details](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_GetProject.md) +* [Delete a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_DeleteProject.md) +* [Train a Model](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_Train.md) +* [Cancel Training Job](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_CancelTrainingJob.md) +* [Get Model Evaluation Summary](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Results](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_GetModelEvaluationResults.md) +* [Load Snapshot](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_LoadSnapshot.md) +* [Delete a Trained Model](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_DeleteTrainedModel.md) +* [Swap Deployments](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_SwapDeployments.md) +* [Delete a Deployment](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample13_TextAuthoring_DeleteDeployment.md) +* [Deploy a Project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample14_TextAuthoring_DeployProject.md) +* [Get Deployment Details](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample15_TextAuthoring_GetDeployment.md) +* [Assign Deployment Resources](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample16_TextAuthoring_AssignDeploymentResources.md) +* [Get Deployment Resources Assignment Status](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.md) +* [Unassign Deployment Resources](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample18_TextAuthoring_UnassignDeploymentResources.md) +* [Get Deployment Resources Unassignment Status](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.md) From a95d0be7be4c7664c340a653ce09c4a83463c7cc Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 12:04:02 -0700 Subject: [PATCH 42/47] add using System.Threading.Tasks in each test --- .../tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs | 1 + .../Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs | 1 + .../tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs | 1 + .../tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs | 1 + .../tests/Samples/Sample14_TextAuthoring_DeployProject.cs | 1 + .../tests/Samples/Sample15_TextAuthoring_GetDeployment.cs | 1 + .../Sample16_TextAuthoring_AssignDeploymentResources.cs | 1 + ...ple17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs | 5 +---- .../Sample18_TextAuthoring_UnassignDeploymentResources.cs | 1 + ...e19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs | 1 + .../tests/Samples/Sample1_TextAuthoring_CreateProject.cs | 1 + .../tests/Samples/Sample2_TextAuthoring_Import.cs | 1 + .../tests/Samples/Sample3_TextAuthoring_Export.cs | 1 + .../tests/Samples/Sample4_TextAuthoring_GetProject.cs | 1 + .../tests/Samples/Sample5_TextAuthoring_DeleteProject.cs | 1 + .../tests/Samples/Sample6_TextAuthoring_Train.cs | 1 + .../tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs | 1 + .../Sample8_TextAuthoring_GetModelEvaluationSummary.cs | 1 + .../Sample9_TextAuthoring_GetModelEvaluationResults.cs | 1 + 19 files changed, 19 insertions(+), 4 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs index 075ba19c7d52..a9c06ba16eb7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_LoadSnapshot.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs index 42fa42489f97..2b941ab436b7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_DeleteTrainedModel.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs index f1f07ade1d4f..15250d449491 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_SwapDeployments.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs index 6c42b568e02e..21126eab4066 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample13_TextAuthoring_DeleteDeployment.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs index 934dfc145beb..73ede2816907 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample14_TextAuthoring_DeployProject.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs index 181201004dce..b30395547685 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample15_TextAuthoring_GetDeployment.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs index 65c0de4a8657..1fa0cabcf1f9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample16_TextAuthoring_AssignDeploymentResources.cs @@ -8,6 +8,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs index f3e8161301c2..c67635993c0a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample17_TextAuthoring_GetAssignDeploymentResourcesStatus.cs @@ -4,11 +4,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Azure; -using Azure.AI.Language.Text.Authoring; -using Azure.AI.Language.Text.Authoring.Tests; -using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs index 1e1285d58f4f..ee4d2e036157 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample18_TextAuthoring_UnassignDeploymentResources.cs @@ -9,6 +9,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs index 6c0da92210f8..c3268a65b3c5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample19_TextAuthoring_GetUnassignDeploymentResourcesStatus.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs index 7c48e80e5665..9833d4cc3c2e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_CreateProject.cs @@ -7,6 +7,7 @@ using Azure.AI.Language.Text.Authoring.Tests; using Azure.Core; using Azure.Core.TestFramework; +using System.Threading.Tasks; using NUnit.Framework; namespace Azure.AI.Language.Text.Authoring.Tests.Samples diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index b4648e97e632..969b61bb357c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -9,6 +9,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs index df1dc719d337..a7f4d4689ddb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_Export.cs @@ -9,6 +9,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs index b3e864769fa5..220e4d0c318e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_GetProject.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs index 467f05ebcfdb..9bb7e52148a7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_DeleteProject.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs index 80fa52e5e530..1db27d7b324f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_Train.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs index 4d3ae636c674..40d4de0459f9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_CancelTrainingJob.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs index f6ae8daae8b4..612b77eaa57b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_GetModelEvaluationSummary.cs @@ -7,6 +7,7 @@ using Azure.Core.Serialization; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs index 235d9cba21b4..45e66c75655d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_GetModelEvaluationResults.cs @@ -8,6 +8,7 @@ using Azure.Core; using Azure.Core.TestFramework; using NUnit.Framework; +using System.Threading.Tasks; namespace Azure.AI.Language.Text.Authoring.Tests.Samples { From 2d0e8f030e5079875aa522fd26e77e4be8a50c12 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 14:02:37 -0700 Subject: [PATCH 43/47] update property name to projectJson for importRawJson --- .../samples/Sample2_TextAuthoring_Import.md | 4 ++-- .../src/TextAuthoringProject.cs | 16 ++++++++-------- .../Samples/Sample2_TextAuthoring_Import.cs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md index 5a8d536f51f4..ccb348d2c006 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -190,7 +190,7 @@ string rawJson = """ Operation operation = projectClient.Import( waitUntil: WaitUntil.Started, - exportedProject: rawJson + projectJson: rawJson ); string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; @@ -370,7 +370,7 @@ string rawJson = """ Operation operation = await projectClient.ImportAsync( waitUntil: WaitUntil.Started, - exportedProject: rawJson + projectJson: rawJson ); string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs index 430348bd906d..7f8e9220a285 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs @@ -539,18 +539,18 @@ public virtual Operation Import(WaitUntil waitUntil, TextAuthoringExportedProjec /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// + /// /// A raw JSON string representing the entire project to import. /// This string should match the format of an exported Text Authoring project. /// /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. /// The cancellation token to use. - public virtual async Task ImportAsync(WaitUntil waitUntil, string exportedProject, string format = null, CancellationToken cancellationToken = default) + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectJson, string format = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); - Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + Argument.AssertNotNullOrEmpty(projectJson, nameof(projectJson)); - using RequestContent content = RequestContent.Create(Encoding.UTF8.GetBytes(exportedProject)); + using RequestContent content = RequestContent.Create(Encoding.UTF8.GetBytes(projectJson)); RequestContext context = FromCancellationToken(cancellationToken); return await ImportRawJsonAsync(waitUntil, _projectName, content, format, context).ConfigureAwait(false); } @@ -560,18 +560,18 @@ public virtual async Task ImportAsync(WaitUntil waitUntil, string exp /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// + /// /// A raw JSON string representing the entire project to import. /// This string should match the format of an exported Text Authoring project. /// /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. /// The cancellation token to use. - public virtual Operation Import(WaitUntil waitUntil, string exportedProject, string format = null, CancellationToken cancellationToken = default) + public virtual Operation Import(WaitUntil waitUntil, string projectJson, string format = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(_projectName, nameof(_projectName)); - Argument.AssertNotNullOrEmpty(exportedProject, nameof(exportedProject)); + Argument.AssertNotNullOrEmpty(projectJson, nameof(projectJson)); - using RequestContent content = RequestContentHelper.FromObject(exportedProject); + using RequestContent content = RequestContentHelper.FromObject(projectJson); RequestContext context = FromCancellationToken(cancellationToken); return ImportRawJson(waitUntil, _projectName, content, format, context); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs index 969b61bb357c..e27e464bdf78 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -198,7 +198,7 @@ public void ImportRawString() Operation operation = projectClient.Import( waitUntil: WaitUntil.Started, - exportedProject: rawJson + projectJson: rawJson ); string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; @@ -388,7 +388,7 @@ public async Task ImportRawStringAsync() Operation operation = await projectClient.ImportAsync( waitUntil: WaitUntil.Started, - exportedProject: rawJson + projectJson: rawJson ); string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; From 73048e8fc6d4d21104495c297ddc5c0e928cc759 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 14:34:20 -0700 Subject: [PATCH 44/47] run Export-API.ps1 --- .../api/Azure.AI.Language.Text.Authoring.net8.0.cs | 4 ++-- .../api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs index 183f055135bd..a66fa1e245e9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs @@ -1541,10 +1541,10 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs index f2030383d332..1fe01cd06259 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs @@ -1541,10 +1541,10 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string exportedProject, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } From 59a4620977c1f00028f3355b3cf069942bfc0a03 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 15:25:00 -0700 Subject: [PATCH 45/47] updated exportedProject to rawjson in livetest --- .../tests/TextAuthoringClientLiveTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs index 76347ed145e3..ad66418bc95a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -164,7 +164,7 @@ public async Task ImportRawStringAsync() // Act Operation operation = await projectClient.ImportAsync( waitUntil: WaitUntil.Started, - exportedProject: rawJson + projectJson: rawJson ); // Assert From 017314b0e75caa535a6e282e58653b3225129956 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 20:15:33 -0700 Subject: [PATCH 46/47] added customized importRawJson feature --- .../src/Generated/TextAuthoringProject.cs | 23 ----- .../src/TextAuthoringProject.cs | 96 +------------------ .../tsp-location.yaml | 2 +- 3 files changed, 3 insertions(+), 118 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs index 968fb196ed1f..15db64dbfe81 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProject.cs @@ -334,29 +334,6 @@ internal HttpMessage CreateImportRequest(string projectName, RequestContent cont return message; } - internal HttpMessage CreateImportRawJsonRequest(string projectName, RequestContent content, string format, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:import", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (format != null) - { - request.Headers.Add("format", format); - } - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs index 7f8e9220a285..f95f3460fd3f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringProject.cs @@ -61,10 +61,6 @@ namespace Azure.AI.Language.Text.Authoring [CodeGenSuppress("Export", typeof(WaitUntil), typeof(string), typeof(string), typeof(string), typeof(string), typeof(RequestContext))] [CodeGenSuppress("ImportAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] [CodeGenSuppress("Import", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] - [CodeGenSuppress("ImportRawJsonAsync", typeof(WaitUntil), typeof(string), typeof(string), typeof(String), typeof(CancellationToken))] - [CodeGenSuppress("ImportRawJson", typeof(WaitUntil), typeof(string), typeof(string), typeof(String), typeof(CancellationToken))] - [CodeGenSuppress("ImportRawJsonAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] - [CodeGenSuppress("ImportRawJson", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(string), typeof(RequestContext))] [CodeGenSuppress("TrainAsync", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(RequestContext))] [CodeGenSuppress("Train", typeof(WaitUntil), typeof(string), typeof(RequestContent), typeof(RequestContext))] [CodeGenSuppress("CancelTrainingJobAsync", typeof(WaitUntil), typeof(string), typeof(string), typeof(RequestContext))] @@ -552,7 +548,7 @@ public virtual async Task ImportAsync(WaitUntil waitUntil, string pro using RequestContent content = RequestContent.Create(Encoding.UTF8.GetBytes(projectJson)); RequestContext context = FromCancellationToken(cancellationToken); - return await ImportRawJsonAsync(waitUntil, _projectName, content, format, context).ConfigureAwait(false); + return await ImportAsync(waitUntil, content, format, context).ConfigureAwait(false); } /// @@ -573,95 +569,7 @@ public virtual Operation Import(WaitUntil waitUntil, string projectJson, string using RequestContent content = RequestContentHelper.FromObject(projectJson); RequestContext context = FromCancellationToken(cancellationToken); - return ImportRawJson(waitUntil, _projectName, content, format, context); - } - - /// - /// [Protocol Method] Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - public virtual async Task ImportRawJsonAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to import a project using raw JSON string input. - /// This is an alternative to the structured import method, and is useful when importing directly from exported project files. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - public virtual Operation ImportRawJson(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAuthoringProject.ImportRawJson"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRawJsonRequest(projectName, content, format, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProject.ImportRawJson", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + return Import(waitUntil, content, format, context); } /// diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index 1cad9473a253..6195a39ac940 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 0b4fa7854c30d7ac75405bc8ec804e195e3058da +commit: 0f1c9e2f3e8fb8fcd824d89d5aeecffc157a05c3 repo: Azure/azure-rest-api-specs From ee6e2ac6f09638678e45ddf265f698d6c969f5e0 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 23 Jul 2025 20:25:21 -0700 Subject: [PATCH 47/47] run Export-API.ps1 --- .../api/Azure.AI.Language.Text.Authoring.net8.0.cs | 2 -- .../api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs index a66fa1e245e9..581964591a0f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs @@ -1545,8 +1545,6 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs index 1fe01cd06259..3f39042a0392 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs @@ -1545,8 +1545,6 @@ protected TextAuthoringProject() { } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectJson, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation ImportRawJson(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task ImportRawJsonAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, Azure.AI.Language.Text.Authoring.TextAuthoringSwapDeploymentsDetails details, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }