Skip to content

Commit

Permalink
modify client name of conversation authoring to align with text autho…
Browse files Browse the repository at this point in the history
…ring (#48583)

* modified the clientname to align with Text Authoring

* modifed the tests

* udpated exported api and updated snippets
  • Loading branch information
amber-ccc authored Mar 6, 2025
1 parent 09bceeb commit f0b4fa0
Show file tree
Hide file tree
Showing 159 changed files with 3,887 additions and 3,898 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ try
{
string invalidProjectName = "InvalidProject";
ConversationAuthoringProject projectClient = client.GetProject(invalidProjectName);
CreateProjectDetails projectData = new CreateProjectDetails(
ConversationAuthoringCreateProjectDetails projectData = new ConversationAuthoringCreateProjectDetails(
projectKind: "Conversation",
language: "invalid-lang"
)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To swap two deployments, call SwapDeployments on the `ConversationAuthoringDeplo
string projectName = "SampleProject";
string deploymentName1 = "deployment1";
string deploymentName2 = "deployment2";
SwapDeploymentsDetails swapDetails = new SwapDeploymentsDetails(deploymentName1, deploymentName2);
ConversationAuthoringSwapDeploymentsDetails swapDetails = new ConversationAuthoringSwapDeploymentsDetails(deploymentName1, deploymentName2);
ConversationAuthoringProject projectClient = client.GetProject(projectName);
Operation operation = projectClient.SwapDeployments(
waitUntil: WaitUntil.Completed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ string deploymentName1 = "deployment1";
string deploymentName2 = "deployment2";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

SwapDeploymentsDetails swapDetails = new SwapDeploymentsDetails(deploymentName1, deploymentName2);
ConversationAuthoringSwapDeploymentsDetails swapDetails = new ConversationAuthoringSwapDeploymentsDetails(deploymentName1, deploymentName2);

Operation operation = await projectClient.SwapDeploymentsAsync(
waitUntil: WaitUntil.Completed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ string deploymentName = "staging";

ConversationAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName);

CreateDeploymentDetails trainedModeDetails = new CreateDeploymentDetails("m1");
ConversationAuthoringCreateDeploymentDetails trainedModeDetails = new ConversationAuthoringCreateDeploymentDetails("m1");

Operation operation = deploymentClient.DeployProject(
waitUntil: WaitUntil.Completed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ string deploymentName = "staging";

ConversationAuthoringDeployment deploymentClient = client.GetDeployment(projectName, deploymentName);

CreateDeploymentDetails trainedModeDetails = new CreateDeploymentDetails("m1");
ConversationAuthoringCreateDeploymentDetails trainedModeDetails = new ConversationAuthoringCreateDeploymentDetails("m1");

Operation operation = await deploymentClient.DeployProjectAsync(
waitUntil: WaitUntil.Completed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To create a new project synchronously, call CreateProject on the `ConversationAu
```C# Snippet:Sample1_ConversationsAuthoring_CreateProject
string projectName = "MyNewProject";
ConversationAuthoringProject projectClient = client.GetProject(projectName);
CreateProjectDetails projectData = new CreateProjectDetails(
ConversationAuthoringCreateProjectDetails projectData = new ConversationAuthoringCreateProjectDetails(
projectKind: "Conversation",
language: "en-us"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To create a new project, call `CreateProjectAsync` on the `ConversationAuthoring
```C# Snippet:Sample1_ConversationsAuthoring_CreateProjectAsync
string projectName = "MyNewProjectAsync";
ConversationAuthoringProject projectClient = client.GetProject(projectName);
CreateProjectDetails projectData = new CreateProjectDetails(
ConversationAuthoringCreateProjectDetails projectData = new ConversationAuthoringCreateProjectDetails(
projectKind: "Conversation",
language: "en-us"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ To import a project synchronously, call Import on the ConversationAuthoringProje
string projectName = "MyImportedProject";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

CreateProjectDetails projectMetadata = new CreateProjectDetails(
ConversationAuthoringCreateProjectDetails projectMetadata = new ConversationAuthoringCreateProjectDetails(
projectKind: "Conversation",
language: "en"
)
{
Settings = new ProjectSettings(0.7F),
Settings = new ConversationAuthoringProjectSettings(0.7F),
Multilingual = true,
Description = "Trying out CLU with assets"
};
Expand Down Expand Up @@ -64,7 +64,7 @@ projectAssets.Utterances.Add(new ConversationExportedUtterance(
Dataset = "dataset1"
});

ExportedProject exportedProject = new ExportedProject(
ConversationAuthoringExportedProject exportedProject = new ConversationAuthoringExportedProject(
projectFileVersion: "2023-10-01",
stringIndexType: StringIndexType.Utf16CodeUnit,
metadata: projectMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ To import a project, call ImportAsync on the ConversationAuthoringProject client
string projectName = "MyImportedProjectAsync";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

CreateProjectDetails projectMetadata = new CreateProjectDetails(
ConversationAuthoringCreateProjectDetails projectMetadata = new ConversationAuthoringCreateProjectDetails(
projectKind: "Conversation",
language: "en"
)
{
Settings = new ProjectSettings(0.7F),
Settings = new ConversationAuthoringProjectSettings(0.7F),
Multilingual = true,
Description = "Trying out CLU with assets"
};
Expand Down Expand Up @@ -64,7 +64,7 @@ projectAssets.Utterances.Add(new ConversationExportedUtterance(
Dataset = "dataset1"
});

ExportedProject exportedProject = new ExportedProject(
ConversationAuthoringExportedProject exportedProject = new ConversationAuthoringExportedProject(
projectFileVersion: "2023-10-01",
stringIndexType: StringIndexType.Utf16CodeUnit,
metadata: projectMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ To retrieve metadata of a project, call GetProject on the `ConversationAuthoring
string projectName = "MySampleProject";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

Response<ProjectMetadata> response = projectClient.GetProject();
ProjectMetadata projectMetadata = response.Value;
Response<ConversationAuthoringProjectMetadata> response = projectClient.GetProject();
ConversationAuthoringProjectMetadata projectMetadata = response.Value;

Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}");
Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ To retrieve metadata of a project, call GetProjectAsync on the `ConversationAuth
string projectName = "MySampleProjectAsync";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

Response<ProjectMetadata> response = await projectClient.GetProjectAsync();
ProjectMetadata projectMetadata = response.Value;
Response<ConversationAuthoringProjectMetadata> response = await projectClient.GetProjectAsync();
ConversationAuthoringProjectMetadata projectMetadata = response.Value;

Console.WriteLine($"Created DateTime: {projectMetadata.CreatedOn}");
Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedOn}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ To train a model, call Train on the `ConversationAuthoringProject` client. The m
```C# Snippet:Sample6_ConversationsAuthoring_Train
string projectName = "MySampleProject";
ConversationAuthoringProject projectClient = client.GetProject(projectName);
TrainingJobDetails trainingJobDetails = new TrainingJobDetails(
ConversationAuthoringTrainingJobDetails trainingJobDetails = new ConversationAuthoringTrainingJobDetails(
modelLabel: "MyModel",
trainingMode: ConversationAuthoringTrainingMode.Standard
)
{
TrainingConfigVersion = "1.0",
EvaluationOptions = new EvaluationDetails
EvaluationOptions = new ConversationAuthoringEvaluationDetails
{
Kind = ConversationAuthoringEvaluationKind.Percentage,
TestingSplitPercentage = 20,
TrainingSplitPercentage = 80
}
};

Operation<TrainingJobResult> operation = projectClient.Train(
Operation<ConversationAuthoringTrainingJobResult> operation = projectClient.Train(
waitUntil: WaitUntil.Completed,
details: trainingJobDetails
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ To train a model asynchronously, call TrainAsync on the `ConversationAuthoringPr
string projectName = "MySampleProjectAsync";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

TrainingJobDetails trainingJobDetails = new TrainingJobDetails(
ConversationAuthoringTrainingJobDetails trainingJobDetails = new ConversationAuthoringTrainingJobDetails(
modelLabel: "MyModel",
trainingMode: ConversationAuthoringTrainingMode.Standard
)
{
TrainingConfigVersion = "1.0",
EvaluationOptions = new EvaluationDetails
EvaluationOptions = new ConversationAuthoringEvaluationDetails
{
Kind = ConversationAuthoringEvaluationKind.Percentage,
TestingSplitPercentage = 20,
TrainingSplitPercentage = 80
}
};

Operation<TrainingJobResult> operation = await projectClient.TrainAsync(
Operation<ConversationAuthoringTrainingJobResult> operation = await projectClient.TrainAsync(
waitUntil: WaitUntil.Completed,
details: trainingJobDetails
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ string projectName = "MyProject";
string jobId = "YourTrainingJobId";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

Operation<TrainingJobResult> cancelOperation = projectClient.CancelTrainingJob(
Operation<ConversationAuthoringTrainingJobResult> cancelOperation = projectClient.CancelTrainingJob(
waitUntil: WaitUntil.Completed,
jobId: jobId
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ string projectName = "MyProject";
string jobId = "YourTrainingJobId";
ConversationAuthoringProject projectClient = client.GetProject(projectName);

Operation<TrainingJobResult> cancelOperation = await projectClient.CancelTrainingJobAsync(
Operation<ConversationAuthoringTrainingJobResult> cancelOperation = await projectClient.CancelTrainingJobAsync(
waitUntil: WaitUntil.Completed,
jobId: jobId
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ string projectName = "MyProject";
string trainedModelLabel = "YourTrainedModelLabel";
ConversationAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel);

Response<EvaluationSummary> evaluationSummaryResponse = trainedModelClient.GetModelEvaluationSummary();
Response<ConversationAuthoringEvalSummary> evaluationSummaryResponse = trainedModelClient.GetModelEvaluationSummary();

// Print entities evaluation summary
EntitiesEvaluationSummary entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation;
Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}");
Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}");

// Print detailed metrics per entity
foreach (KeyValuePair<string, EntityEvaluationSummary> entity in entitiesEval.Entities)
foreach (KeyValuePair<string, ConversationAuthoringEntityEvalSummary> entity in entitiesEval.Entities)
{
Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}");
Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ string projectName = "MyProject";
string trainedModelLabel = "YourTrainedModelLabel";
ConversationAuthoringTrainedModel trainedModelClient = client.GetTrainedModel(projectName, trainedModelLabel);

Response<EvaluationSummary> evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync();
Response<ConversationAuthoringEvalSummary> evaluationSummaryResponse = await trainedModelClient.GetModelEvaluationSummaryAsync();

// Print entities evaluation summary
EntitiesEvaluationSummary entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation;
Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}");
Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}");

// Print detailed metrics per entity
foreach (KeyValuePair<string, EntityEvaluationSummary> entity in entitiesEval.Entities)
foreach (KeyValuePair<string, ConversationAuthoringEntityEvalSummary> entity in entitiesEval.Entities)
{
Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}");
Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ namespace Azure.AI.Language.Conversations.Authoring
{
//[CodeGenSuppress("AssignedDeploymentResource", typeof(AzureLocation))]
//[CodeGenSuppress("AssignedDeploymentResource", typeof(ResourceIdentifier), typeof(AzureLocation), typeof(IDictionary<string, BinaryData>))]
public partial class AssignedDeploymentResource
public partial class ConversationAuthoringAssignedDeploymentResource
{
/// <summary> The resource ID. </summary>
public ResourceIdentifier ResourceId { get; }

/// <summary> The resource region. </summary>
public AzureLocation Region { get; }

/// <summary> Initializes a new instance of <see cref="AssignedDeploymentResource"/>. </summary>
/// <summary> Initializes a new instance of <see cref="ConversationAuthoringAssignedDeploymentResource"/>. </summary>
/// <param name="region"> The resource region. </param>
/// <exception cref="ArgumentNullException"> <paramref name="region"/> is null. </exception>
internal AssignedDeploymentResource(string region)
internal ConversationAuthoringAssignedDeploymentResource(string region)
{
Argument.AssertNotNull(region, nameof(region));

Region = new AzureLocation(region);
}

/// <summary> Initializes a new instance of <see cref="AssignedDeploymentResource"/>. </summary>
/// <summary> Initializes a new instance of <see cref="ConversationAuthoringAssignedDeploymentResource"/>. </summary>
/// <param name="resourceId"> The resource ID. </param>
/// <param name="region"> The resource region. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal AssignedDeploymentResource(string resourceId, string region, IDictionary<string, BinaryData> serializedAdditionalRawData)
internal ConversationAuthoringAssignedDeploymentResource(string resourceId, string region, IDictionary<string, BinaryData> serializedAdditionalRawData)
{
ResourceId = new ResourceIdentifier(resourceId);
Region = new AzureLocation(region);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Threading;
using Azure.Core;
using Azure.AI.Language.Conversations.Authoring.Models;
using System.Threading.Tasks;
using System;
using Azure.Core.Pipeline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Azure.Core;

namespace Azure.AI.Language.Conversations.Authoring.Models
namespace Azure.AI.Language.Conversations.Authoring
{
/// <summary> Model factory for Conversations Authoring models. </summary>
[CodeGenModel("AILanguageConversationsAuthoringModelFactory")]
Expand Down
Loading

0 comments on commit f0b4fa0

Please sign in to comment.