You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sample shows how to call AnalyzeConversationAsync.
33
+
<code><![CDATA[
34
+
Uri endpoint = new Uri("<endpoint>");
35
+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
36
+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
37
+
12
38
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
13
39
{
14
40
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -69,6 +95,32 @@ Uri endpoint = new Uri("<endpoint>");
69
95
AzureKeyCredential credential = new AzureKeyCredential("<key>");
70
96
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
71
97
98
+
AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisInput(new AIConversation[]
99
+
{
100
+
new AIConversation("order", InputModality.Text, "en", new ConversationalAIItem[]
101
+
{
102
+
new ConversationalAIItem("1", "user", "Hi!"),
103
+
new ConversationalAIItem("2", "bot", "Hello, how can I help you?"),
104
+
new ConversationalAIItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
105
+
new ConversationalAIItem("4", "bot", "Do you have any airline preference?"),
106
+
new ConversationalAIItem("5", "user", "No."),
107
+
new ConversationalAIItem("6", "user", "I like New York and Boston."),
108
+
new ConversationalAIItem("7", "user", "Actualy, change the destination to New York."),
109
+
new ConversationalAIItem("8", "user", "Wait, I do not like the food in New York."),
110
+
new ConversationalAIItem("9", "user", "Ok, change the destination back to Berlin.")
111
+
})
112
+
}), new ConversationalAIInputParameters("project1", "deployment1")
This sample shows how to call AnalyzeConversation.
119
+
<code><![CDATA[
120
+
Uri endpoint = new Uri("<endpoint>");
121
+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
122
+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
123
+
72
124
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
73
125
{
74
126
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -129,6 +181,96 @@ Uri endpoint = new Uri("<endpoint>");
129
181
AzureKeyCredential credential = new AzureKeyCredential("<key>");
130
182
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
131
183
184
+
using RequestContent content = RequestContent.Create(new
185
+
{
186
+
kind = "ConversationalAI",
187
+
parameters = new
188
+
{
189
+
projectName = "project1",
190
+
deploymentName = "deployment1",
191
+
stringIndexType = "Utf16CodeUnit",
192
+
},
193
+
analysisInput = new
194
+
{
195
+
conversations = new object[]
196
+
{
197
+
new
198
+
{
199
+
id = "order",
200
+
language = "en",
201
+
modality = "text",
202
+
conversationItems = new object[]
203
+
{
204
+
new
205
+
{
206
+
participantId = "user",
207
+
id = "1",
208
+
text = "Hi!",
209
+
},
210
+
new
211
+
{
212
+
participantId = "bot",
213
+
id = "2",
214
+
text = "Hello, how can I help you?",
215
+
},
216
+
new
217
+
{
218
+
participantId = "user",
219
+
id = "3",
220
+
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
221
+
},
222
+
new
223
+
{
224
+
participantId = "bot",
225
+
id = "4",
226
+
text = "Do you have any airline preference?",
227
+
},
228
+
new
229
+
{
230
+
participantId = "user",
231
+
id = "5",
232
+
text = "No.",
233
+
},
234
+
new
235
+
{
236
+
participantId = "user",
237
+
id = "6",
238
+
text = "I like New York and Boston.",
239
+
},
240
+
new
241
+
{
242
+
participantId = "user",
243
+
id = "7",
244
+
text = "Actualy, change the destination to New York.",
245
+
},
246
+
new
247
+
{
248
+
participantId = "user",
249
+
id = "8",
250
+
text = "Wait, I do not like the food in New York.",
251
+
},
252
+
new
253
+
{
254
+
participantId = "user",
255
+
id = "9",
256
+
text = "Ok, change the destination back to Berlin.",
0 commit comments