Skip to content

Commit f4d2ad2

Browse files
author
SDKAuto
committed
CodeGen from PR 33086 in Azure/azure-rest-api-specs
Merge 5b916b1cab461d24bc6e001cd01bf4d3f87a7231 into 34cec471c9b9141a6ddf0b2a4813656f3351b4d4
1 parent 14999bb commit f4d2ad2

37 files changed

+3305
-152
lines changed

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs

Lines changed: 265 additions & 139 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ Uri endpoint = new Uri("<endpoint>");
99
AzureKeyCredential credential = new AzureKeyCredential("<key>");
1010
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
1111
12+
AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisOptions(new ConversationInput[]
13+
{
14+
new TextConversation("order", "en", new TextConversationItem[]
15+
{
16+
new TextConversationItem("1", "user", "Hi!"),
17+
new TextConversationItem("2", "bot", "Hello, how can I help you?"),
18+
new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
19+
new TextConversationItem("4", "bot", "Do you have any airline preference?"),
20+
new TextConversationItem("5", "user", "No."),
21+
new TextConversationItem("6", "user", "I like New York and Boston."),
22+
new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
23+
new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
24+
new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
25+
})
26+
}), new ConversationalAITaskParameters("project1", "deployment1")
27+
{
28+
StringIndexType = StringIndexType.Utf16CodeUnit,
29+
});
30+
Response<AnalyzeConversationActionResult> response = await client.AnalyzeConversationAsync(analyzeConversationInput);
31+
]]></code>
32+
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+
1238
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
1339
{
1440
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -69,6 +95,32 @@ Uri endpoint = new Uri("<endpoint>");
6995
AzureKeyCredential credential = new AzureKeyCredential("<key>");
7096
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
7197
98+
AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisOptions(new ConversationInput[]
99+
{
100+
new TextConversation("order", "en", new TextConversationItem[]
101+
{
102+
new TextConversationItem("1", "user", "Hi!"),
103+
new TextConversationItem("2", "bot", "Hello, how can I help you?"),
104+
new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
105+
new TextConversationItem("4", "bot", "Do you have any airline preference?"),
106+
new TextConversationItem("5", "user", "No."),
107+
new TextConversationItem("6", "user", "I like New York and Boston."),
108+
new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
109+
new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
110+
new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
111+
})
112+
}), new ConversationalAITaskParameters("project1", "deployment1")
113+
{
114+
StringIndexType = StringIndexType.Utf16CodeUnit,
115+
});
116+
Response<AnalyzeConversationActionResult> response = client.AnalyzeConversation(analyzeConversationInput);
117+
]]></code>
118+
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+
72124
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
73125
{
74126
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -129,6 +181,96 @@ Uri endpoint = new Uri("<endpoint>");
129181
AzureKeyCredential credential = new AzureKeyCredential("<key>");
130182
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
131183
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.",
257+
}
258+
},
259+
}
260+
},
261+
},
262+
});
263+
Response response = await client.AnalyzeConversationAsync(content);
264+
265+
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
266+
Console.WriteLine(result.GetProperty("kind").ToString());
267+
]]></code>
268+
This sample shows how to call AnalyzeConversationAsync and parse the result.
269+
<code><![CDATA[
270+
Uri endpoint = new Uri("<endpoint>");
271+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
272+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
273+
132274
using RequestContent content = RequestContent.Create(new
133275
{
134276
kind = "Conversation",
@@ -243,6 +385,96 @@ Uri endpoint = new Uri("<endpoint>");
243385
AzureKeyCredential credential = new AzureKeyCredential("<key>");
244386
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
245387
388+
using RequestContent content = RequestContent.Create(new
389+
{
390+
kind = "ConversationalAI",
391+
parameters = new
392+
{
393+
projectName = "project1",
394+
deploymentName = "deployment1",
395+
stringIndexType = "Utf16CodeUnit",
396+
},
397+
analysisInput = new
398+
{
399+
conversations = new object[]
400+
{
401+
new
402+
{
403+
id = "order",
404+
language = "en",
405+
modality = "text",
406+
conversationItems = new object[]
407+
{
408+
new
409+
{
410+
participantId = "user",
411+
id = "1",
412+
text = "Hi!",
413+
},
414+
new
415+
{
416+
participantId = "bot",
417+
id = "2",
418+
text = "Hello, how can I help you?",
419+
},
420+
new
421+
{
422+
participantId = "user",
423+
id = "3",
424+
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
425+
},
426+
new
427+
{
428+
participantId = "bot",
429+
id = "4",
430+
text = "Do you have any airline preference?",
431+
},
432+
new
433+
{
434+
participantId = "user",
435+
id = "5",
436+
text = "No.",
437+
},
438+
new
439+
{
440+
participantId = "user",
441+
id = "6",
442+
text = "I like New York and Boston.",
443+
},
444+
new
445+
{
446+
participantId = "user",
447+
id = "7",
448+
text = "Actualy, change the destination to New York.",
449+
},
450+
new
451+
{
452+
participantId = "user",
453+
id = "8",
454+
text = "Wait, I do not like the food in New York.",
455+
},
456+
new
457+
{
458+
participantId = "user",
459+
id = "9",
460+
text = "Ok, change the destination back to Berlin.",
461+
}
462+
},
463+
}
464+
},
465+
},
466+
});
467+
Response response = client.AnalyzeConversation(content);
468+
469+
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
470+
Console.WriteLine(result.GetProperty("kind").ToString());
471+
]]></code>
472+
This sample shows how to call AnalyzeConversation and parse the result.
473+
<code><![CDATA[
474+
Uri endpoint = new Uri("<endpoint>");
475+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
476+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
477+
246478
using RequestContent content = RequestContent.Create(new
247479
{
248480
kind = "Conversation",

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.Serialization.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.Serialization.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInputKind.cs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.Serialization.cs

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)