Skip to content
Closed
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

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 ConversationalAIAnalysisOptions(new ConversationInput[]
{
new TextConversation("order", "en", new TextConversationItem[]
{
new TextConversationItem("1", "user", "Hi!"),
new TextConversationItem("2", "bot", "Hello, how can I help you?"),
new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
new TextConversationItem("4", "bot", "Do you have any airline preference?"),
new TextConversationItem("5", "user", "No."),
new TextConversationItem("6", "user", "I like New York and Boston."),
new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
})
}), new ConversationalAITaskParameters("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 ConversationalAIAnalysisOptions(new ConversationInput[]
{
new TextConversation("order", "en", new TextConversationItem[]
{
new TextConversationItem("1", "user", "Hi!"),
new TextConversationItem("2", "bot", "Hello, how can I help you?"),
new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
new TextConversationItem("4", "bot", "Do you have any airline preference?"),
new TextConversationItem("5", "user", "No."),
new TextConversationItem("6", "user", "I like New York and Boston."),
new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
})
}), new ConversationalAITaskParameters("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

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

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

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

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

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

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

Loading