From f048838e8b0ac82abf5d9bb7ef27a8f063272578 Mon Sep 17 00:00:00 2001 From: Xiong Chen Date: Tue, 3 Jun 2025 14:21:39 -0700 Subject: [PATCH 01/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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)