Skip to content

[AutoPR Azure.AI.Language.Conversations] update the client name for Conversation Runtime 2025-05-15-preview #11836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisInput(new AIConversation[]
{
new AIConversation("order", InputModality.Text, "en", new ConversationalAIItem[]
{
new ConversationalAIItem("1", "user", "Hi!"),
new ConversationalAIItem("2", "bot", "Hello, how can I help you?"),
new ConversationalAIItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
new ConversationalAIItem("4", "bot", "Do you have any airline preference?"),
new ConversationalAIItem("5", "user", "No."),
new ConversationalAIItem("6", "user", "I like New York and Boston."),
new ConversationalAIItem("7", "user", "Actualy, change the destination to New York."),
new ConversationalAIItem("8", "user", "Wait, I do not like the food in New York."),
new ConversationalAIItem("9", "user", "Ok, change the destination back to Berlin.")
})
}), new AIConversationLanguageUnderstandingActionContent("project1", "deployment1")
{
StringIndexType = StringIndexType.Utf16CodeUnit,
});
Response<AnalyzeConversationActionResult> response = await client.AnalyzeConversationAsync(analyzeConversationInput);
]]></code>
This sample shows how to call AnalyzeConversationAsync.
<code><![CDATA[
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
{
StringIndexType = new StringIndexType("TextElement_V8"),
Expand Down Expand Up @@ -69,6 +95,32 @@ Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisInput(new AIConversation[]
{
new AIConversation("order", InputModality.Text, "en", new ConversationalAIItem[]
{
new ConversationalAIItem("1", "user", "Hi!"),
new ConversationalAIItem("2", "bot", "Hello, how can I help you?"),
new ConversationalAIItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
new ConversationalAIItem("4", "bot", "Do you have any airline preference?"),
new ConversationalAIItem("5", "user", "No."),
new ConversationalAIItem("6", "user", "I like New York and Boston."),
new ConversationalAIItem("7", "user", "Actualy, change the destination to New York."),
new ConversationalAIItem("8", "user", "Wait, I do not like the food in New York."),
new ConversationalAIItem("9", "user", "Ok, change the destination back to Berlin.")
})
}), new AIConversationLanguageUnderstandingActionContent("project1", "deployment1")
{
StringIndexType = StringIndexType.Utf16CodeUnit,
});
Response<AnalyzeConversationActionResult> response = client.AnalyzeConversation(analyzeConversationInput);
]]></code>
This sample shows how to call AnalyzeConversation.
<code><![CDATA[
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
{
StringIndexType = new StringIndexType("TextElement_V8"),
Expand Down Expand Up @@ -129,6 +181,96 @@ Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
kind = "ConversationalAI",
parameters = new
{
projectName = "project1",
deploymentName = "deployment1",
stringIndexType = "Utf16CodeUnit",
},
analysisInput = new
{
conversations = new object[]
{
new
{
id = "order",
language = "en",
modality = "text",
conversationItems = new object[]
{
new
{
participantId = "user",
id = "1",
text = "Hi!",
},
new
{
participantId = "bot",
id = "2",
text = "Hello, how can I help you?",
},
new
{
participantId = "user",
id = "3",
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
},
new
{
participantId = "bot",
id = "4",
text = "Do you have any airline preference?",
},
new
{
participantId = "user",
id = "5",
text = "No.",
},
new
{
participantId = "user",
id = "6",
text = "I like New York and Boston.",
},
new
{
participantId = "user",
id = "7",
text = "Actualy, change the destination to New York.",
},
new
{
participantId = "user",
id = "8",
text = "Wait, I do not like the food in New York.",
},
new
{
participantId = "user",
id = "9",
text = "Ok, change the destination back to Berlin.",
}
},
}
},
},
});
Response response = await client.AnalyzeConversationAsync(content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("kind").ToString());
]]></code>
This sample shows how to call AnalyzeConversationAsync and parse the result.
<code><![CDATA[
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
kind = "Conversation",
Expand Down Expand Up @@ -243,6 +385,96 @@ Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
kind = "ConversationalAI",
parameters = new
{
projectName = "project1",
deploymentName = "deployment1",
stringIndexType = "Utf16CodeUnit",
},
analysisInput = new
{
conversations = new object[]
{
new
{
id = "order",
language = "en",
modality = "text",
conversationItems = new object[]
{
new
{
participantId = "user",
id = "1",
text = "Hi!",
},
new
{
participantId = "bot",
id = "2",
text = "Hello, how can I help you?",
},
new
{
participantId = "user",
id = "3",
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
},
new
{
participantId = "bot",
id = "4",
text = "Do you have any airline preference?",
},
new
{
participantId = "user",
id = "5",
text = "No.",
},
new
{
participantId = "user",
id = "6",
text = "I like New York and Boston.",
},
new
{
participantId = "user",
id = "7",
text = "Actualy, change the destination to New York.",
},
new
{
participantId = "user",
id = "8",
text = "Wait, I do not like the food in New York.",
},
new
{
participantId = "user",
id = "9",
text = "Ok, change the destination back to Berlin.",
}
},
}
},
},
});
Response response = client.AnalyzeConversation(content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("kind").ToString());
]]></code>
This sample shows how to call AnalyzeConversation and parse the result.
<code><![CDATA[
Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
kind = "Conversation",
Expand Down
Loading