Skip to content

Commit ba935be

Browse files
author
SDKAuto
committed
CodeGen from PR 33086 in Azure/azure-rest-api-specs
Merge a560b032c946acc49ab1b92a0743db041c48058d into 8fb5391
1 parent 7e1309c commit ba935be

35 files changed

+3276
-148
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: 262 additions & 137 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 BaseConversationalAITaskParameters("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
Response<AnalyzeConversationActionResult> response = await client.AnalyzeConversationAsync(analyzeConversationInput);
1440
]]></code>
@@ -65,6 +91,32 @@ Uri endpoint = new Uri("<endpoint>");
6591
AzureKeyCredential credential = new AzureKeyCredential("<key>");
6692
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
6793
94+
AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisOptions(new ConversationInput[]
95+
{
96+
new TextConversation("order", "en", new TextConversationItem[]
97+
{
98+
new TextConversationItem("1", "user", "Hi!"),
99+
new TextConversationItem("2", "bot", "Hello, how can I help you?"),
100+
new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
101+
new TextConversationItem("4", "bot", "Do you have any airline preference?"),
102+
new TextConversationItem("5", "user", "No."),
103+
new TextConversationItem("6", "user", "I like New York and Boston."),
104+
new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
105+
new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
106+
new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
107+
})
108+
}), new BaseConversationalAITaskParameters("project1", "deployment1")
109+
{
110+
StringIndexType = StringIndexType.Utf16CodeUnit,
111+
});
112+
Response<AnalyzeConversationActionResult> response = client.AnalyzeConversation(analyzeConversationInput);
113+
]]></code>
114+
This sample shows how to call AnalyzeConversation.
115+
<code><![CDATA[
116+
Uri endpoint = new Uri("<endpoint>");
117+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
118+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
119+
68120
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}"));
69121
Response<AnalyzeConversationActionResult> response = client.AnalyzeConversation(analyzeConversationInput);
70122
]]></code>
@@ -121,6 +173,96 @@ Uri endpoint = new Uri("<endpoint>");
121173
AzureKeyCredential credential = new AzureKeyCredential("<key>");
122174
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
123175
176+
using RequestContent content = RequestContent.Create(new
177+
{
178+
kind = "ConversationalAI",
179+
parameters = new
180+
{
181+
projectName = "project1",
182+
deploymentName = "deployment1",
183+
stringIndexType = "Utf16CodeUnit",
184+
},
185+
analysisInput = new
186+
{
187+
conversations = new object[]
188+
{
189+
new
190+
{
191+
id = "order",
192+
language = "en",
193+
modality = "text",
194+
conversationItems = new object[]
195+
{
196+
new
197+
{
198+
participantId = "user",
199+
id = "1",
200+
text = "Hi!",
201+
},
202+
new
203+
{
204+
participantId = "bot",
205+
id = "2",
206+
text = "Hello, how can I help you?",
207+
},
208+
new
209+
{
210+
participantId = "user",
211+
id = "3",
212+
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
213+
},
214+
new
215+
{
216+
participantId = "bot",
217+
id = "4",
218+
text = "Do you have any airline preference?",
219+
},
220+
new
221+
{
222+
participantId = "user",
223+
id = "5",
224+
text = "No.",
225+
},
226+
new
227+
{
228+
participantId = "user",
229+
id = "6",
230+
text = "I like New York and Boston.",
231+
},
232+
new
233+
{
234+
participantId = "user",
235+
id = "7",
236+
text = "Actualy, change the destination to New York.",
237+
},
238+
new
239+
{
240+
participantId = "user",
241+
id = "8",
242+
text = "Wait, I do not like the food in New York.",
243+
},
244+
new
245+
{
246+
participantId = "user",
247+
id = "9",
248+
text = "Ok, change the destination back to Berlin.",
249+
}
250+
},
251+
}
252+
},
253+
},
254+
});
255+
Response response = await client.AnalyzeConversationAsync(content);
256+
257+
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
258+
Console.WriteLine(result.GetProperty("kind").ToString());
259+
]]></code>
260+
This sample shows how to call AnalyzeConversationAsync and parse the result.
261+
<code><![CDATA[
262+
Uri endpoint = new Uri("<endpoint>");
263+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
264+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
265+
124266
using RequestContent content = RequestContent.Create(new
125267
{
126268
kind = "Conversation",
@@ -233,6 +375,96 @@ Uri endpoint = new Uri("<endpoint>");
233375
AzureKeyCredential credential = new AzureKeyCredential("<key>");
234376
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
235377
378+
using RequestContent content = RequestContent.Create(new
379+
{
380+
kind = "ConversationalAI",
381+
parameters = new
382+
{
383+
projectName = "project1",
384+
deploymentName = "deployment1",
385+
stringIndexType = "Utf16CodeUnit",
386+
},
387+
analysisInput = new
388+
{
389+
conversations = new object[]
390+
{
391+
new
392+
{
393+
id = "order",
394+
language = "en",
395+
modality = "text",
396+
conversationItems = new object[]
397+
{
398+
new
399+
{
400+
participantId = "user",
401+
id = "1",
402+
text = "Hi!",
403+
},
404+
new
405+
{
406+
participantId = "bot",
407+
id = "2",
408+
text = "Hello, how can I help you?",
409+
},
410+
new
411+
{
412+
participantId = "user",
413+
id = "3",
414+
text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
415+
},
416+
new
417+
{
418+
participantId = "bot",
419+
id = "4",
420+
text = "Do you have any airline preference?",
421+
},
422+
new
423+
{
424+
participantId = "user",
425+
id = "5",
426+
text = "No.",
427+
},
428+
new
429+
{
430+
participantId = "user",
431+
id = "6",
432+
text = "I like New York and Boston.",
433+
},
434+
new
435+
{
436+
participantId = "user",
437+
id = "7",
438+
text = "Actualy, change the destination to New York.",
439+
},
440+
new
441+
{
442+
participantId = "user",
443+
id = "8",
444+
text = "Wait, I do not like the food in New York.",
445+
},
446+
new
447+
{
448+
participantId = "user",
449+
id = "9",
450+
text = "Ok, change the destination back to Berlin.",
451+
}
452+
},
453+
}
454+
},
455+
},
456+
});
457+
Response response = client.AnalyzeConversation(content);
458+
459+
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
460+
Console.WriteLine(result.GetProperty("kind").ToString());
461+
]]></code>
462+
This sample shows how to call AnalyzeConversation and parse the result.
463+
<code><![CDATA[
464+
Uri endpoint = new Uri("<endpoint>");
465+
AzureKeyCredential credential = new AzureKeyCredential("<key>");
466+
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
467+
236468
using RequestContent content = RequestContent.Create(new
237469
{
238470
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/AnalyzeConversationResult.cs

Lines changed: 3 additions & 3 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/AnalyzeConversationResultKind.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.

0 commit comments

Comments
 (0)