@azure/ai-language-conversations 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +15 -11
  3. package/{types/src → dist/browser}/azureKeyCredentialPolicy.d.ts +2 -2
  4. package/dist/browser/azureKeyCredentialPolicy.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/azureKeyCredentialPolicy.js +1 -1
  6. package/dist/browser/azureKeyCredentialPolicy.js.map +1 -0
  7. package/{dist-esm/src → dist/browser}/constants.js +1 -1
  8. package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
  9. package/{types/src → dist/browser}/conversationAnalysisClient.d.ts +6 -8
  10. package/dist/browser/conversationAnalysisClient.d.ts.map +1 -0
  11. package/{dist-esm/src → dist/browser}/conversationAnalysisClient.js +8 -10
  12. package/dist/browser/conversationAnalysisClient.js.map +1 -0
  13. package/{types/src → dist/browser}/generated/conversationAnalysisClient.d.ts +1 -1
  14. package/dist/browser/generated/conversationAnalysisClient.d.ts.map +1 -0
  15. package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js +25 -14
  16. package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js.map +1 -1
  17. package/dist/browser/generated/index.d.ts +3 -0
  18. package/{types/src → dist/browser}/generated/index.d.ts.map +1 -1
  19. package/{dist-esm/src → dist/browser}/generated/index.js +2 -2
  20. package/dist/browser/generated/index.js.map +1 -0
  21. package/{dist-esm/src → dist/browser}/generated/lroImpl.js +11 -3
  22. package/dist/browser/generated/lroImpl.js.map +1 -0
  23. package/{types/src → dist/browser}/generated/models/index.d.ts +46 -46
  24. package/dist/browser/generated/models/index.d.ts.map +1 -0
  25. package/{dist-esm/src → dist/browser}/generated/models/mappers.js +297 -117
  26. package/dist/browser/generated/models/mappers.js.map +1 -0
  27. package/{dist-esm/src → dist/browser}/generated/models/parameters.js +1 -1
  28. package/{dist-esm/src → dist/browser}/generated/models/parameters.js.map +1 -1
  29. package/{types/src → dist/browser}/index.d.ts +3 -3
  30. package/{types/src → dist/browser}/index.d.ts.map +1 -1
  31. package/{dist-esm/src → dist/browser}/index.js +4 -4
  32. package/dist/browser/index.js.map +1 -0
  33. package/{types/src → dist/browser}/models.d.ts +47 -47
  34. package/dist/browser/models.d.ts.map +1 -0
  35. package/{dist-esm/src → dist/browser}/models.js +0 -2
  36. package/dist/browser/models.js.map +1 -0
  37. package/dist/browser/package.json +3 -0
  38. package/dist/commonjs/azureKeyCredentialPolicy.d.ts +9 -0
  39. package/dist/commonjs/azureKeyCredentialPolicy.d.ts.map +1 -0
  40. package/dist/commonjs/azureKeyCredentialPolicy.js +25 -0
  41. package/dist/commonjs/azureKeyCredentialPolicy.js.map +1 -0
  42. package/dist/commonjs/constants.d.ts +3 -0
  43. package/dist/commonjs/constants.d.ts.map +1 -0
  44. package/dist/commonjs/constants.js +8 -0
  45. package/dist/commonjs/constants.js.map +1 -0
  46. package/dist/commonjs/conversationAnalysisClient.d.ts +63 -0
  47. package/dist/commonjs/conversationAnalysisClient.d.ts.map +1 -0
  48. package/dist/commonjs/conversationAnalysisClient.js +85 -0
  49. package/dist/commonjs/conversationAnalysisClient.js.map +1 -0
  50. package/dist/commonjs/generated/conversationAnalysisClient.d.ts +36 -0
  51. package/dist/commonjs/generated/conversationAnalysisClient.d.ts.map +1 -0
  52. package/dist/commonjs/generated/conversationAnalysisClient.js +207 -0
  53. package/dist/commonjs/generated/conversationAnalysisClient.js.map +1 -0
  54. package/dist/commonjs/generated/index.d.ts +3 -0
  55. package/dist/commonjs/generated/index.d.ts.map +1 -0
  56. package/dist/commonjs/generated/index.js +15 -0
  57. package/dist/commonjs/generated/index.js.map +1 -0
  58. package/dist/commonjs/generated/lroImpl.d.ts +16 -0
  59. package/dist/commonjs/generated/lroImpl.d.ts.map +1 -0
  60. package/dist/commonjs/generated/lroImpl.js +37 -0
  61. package/dist/commonjs/generated/lroImpl.js.map +1 -0
  62. package/dist/commonjs/generated/models/index.d.ts +1951 -0
  63. package/dist/commonjs/generated/models/index.d.ts.map +1 -0
  64. package/dist/commonjs/generated/models/index.js +659 -0
  65. package/dist/commonjs/generated/models/index.js.map +1 -0
  66. package/dist/commonjs/generated/models/mappers.d.ts +153 -0
  67. package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
  68. package/dist/commonjs/generated/models/mappers.js +2847 -0
  69. package/dist/commonjs/generated/models/mappers.js.map +1 -0
  70. package/dist/commonjs/generated/models/parameters.d.ts +8 -0
  71. package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
  72. package/dist/commonjs/generated/models/parameters.js +64 -0
  73. package/dist/commonjs/generated/models/parameters.js.map +1 -0
  74. package/dist/commonjs/index.d.ts +13 -0
  75. package/dist/commonjs/index.d.ts.map +1 -0
  76. package/dist/commonjs/index.js +21 -0
  77. package/dist/commonjs/index.js.map +1 -0
  78. package/{types/ai-language-conversations.d.ts → dist/commonjs/models.d.ts} +1953 -2221
  79. package/dist/commonjs/models.d.ts.map +1 -0
  80. package/dist/commonjs/models.js +652 -0
  81. package/dist/commonjs/models.js.map +1 -0
  82. package/dist/commonjs/package.json +3 -0
  83. package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
  84. package/dist/esm/azureKeyCredentialPolicy.d.ts +9 -0
  85. package/dist/esm/azureKeyCredentialPolicy.d.ts.map +1 -0
  86. package/dist/esm/azureKeyCredentialPolicy.js +22 -0
  87. package/dist/esm/azureKeyCredentialPolicy.js.map +1 -0
  88. package/dist/esm/constants.d.ts +3 -0
  89. package/dist/esm/constants.d.ts.map +1 -0
  90. package/dist/esm/constants.js +5 -0
  91. package/dist/esm/constants.js.map +1 -0
  92. package/dist/esm/conversationAnalysisClient.d.ts +63 -0
  93. package/dist/esm/conversationAnalysisClient.d.ts.map +1 -0
  94. package/dist/esm/conversationAnalysisClient.js +81 -0
  95. package/dist/esm/conversationAnalysisClient.js.map +1 -0
  96. package/dist/esm/generated/conversationAnalysisClient.d.ts +36 -0
  97. package/dist/esm/generated/conversationAnalysisClient.d.ts.map +1 -0
  98. package/dist/esm/generated/conversationAnalysisClient.js +202 -0
  99. package/dist/esm/generated/conversationAnalysisClient.js.map +1 -0
  100. package/dist/esm/generated/index.d.ts +3 -0
  101. package/dist/esm/generated/index.d.ts.map +1 -0
  102. package/dist/esm/generated/index.js +10 -0
  103. package/dist/esm/generated/index.js.map +1 -0
  104. package/dist/esm/generated/lroImpl.d.ts +16 -0
  105. package/dist/esm/generated/lroImpl.d.ts.map +1 -0
  106. package/dist/esm/generated/lroImpl.js +33 -0
  107. package/dist/esm/generated/lroImpl.js.map +1 -0
  108. package/dist/esm/generated/models/index.d.ts +1951 -0
  109. package/dist/esm/generated/models/index.d.ts.map +1 -0
  110. package/dist/esm/generated/models/index.js +656 -0
  111. package/dist/esm/generated/models/index.js.map +1 -0
  112. package/dist/esm/generated/models/mappers.d.ts +153 -0
  113. package/dist/esm/generated/models/mappers.d.ts.map +1 -0
  114. package/dist/{index.js → esm/generated/models/mappers.js} +404 -1395
  115. package/dist/esm/generated/models/mappers.js.map +1 -0
  116. package/dist/esm/generated/models/parameters.d.ts +8 -0
  117. package/dist/esm/generated/models/parameters.d.ts.map +1 -0
  118. package/dist/esm/generated/models/parameters.js +61 -0
  119. package/dist/esm/generated/models/parameters.js.map +1 -0
  120. package/dist/esm/index.d.ts +13 -0
  121. package/dist/esm/index.d.ts.map +1 -0
  122. package/dist/esm/index.js +15 -0
  123. package/dist/esm/index.js.map +1 -0
  124. package/dist/esm/models.d.ts +1953 -0
  125. package/dist/esm/models.d.ts.map +1 -0
  126. package/dist/esm/models.js +649 -0
  127. package/dist/esm/models.js.map +1 -0
  128. package/dist/esm/package.json +3 -0
  129. package/dist/react-native/azureKeyCredentialPolicy.d.ts +9 -0
  130. package/dist/react-native/azureKeyCredentialPolicy.d.ts.map +1 -0
  131. package/dist/react-native/azureKeyCredentialPolicy.js +22 -0
  132. package/dist/react-native/azureKeyCredentialPolicy.js.map +1 -0
  133. package/dist/react-native/constants.d.ts +3 -0
  134. package/dist/react-native/constants.d.ts.map +1 -0
  135. package/dist/react-native/constants.js +5 -0
  136. package/dist/react-native/constants.js.map +1 -0
  137. package/dist/react-native/conversationAnalysisClient.d.ts +63 -0
  138. package/dist/react-native/conversationAnalysisClient.d.ts.map +1 -0
  139. package/dist/react-native/conversationAnalysisClient.js +81 -0
  140. package/dist/react-native/conversationAnalysisClient.js.map +1 -0
  141. package/dist/react-native/generated/conversationAnalysisClient.d.ts +36 -0
  142. package/dist/react-native/generated/conversationAnalysisClient.d.ts.map +1 -0
  143. package/dist/react-native/generated/conversationAnalysisClient.js +202 -0
  144. package/dist/react-native/generated/conversationAnalysisClient.js.map +1 -0
  145. package/dist/react-native/generated/index.d.ts +3 -0
  146. package/dist/react-native/generated/index.d.ts.map +1 -0
  147. package/dist/react-native/generated/index.js +10 -0
  148. package/dist/react-native/generated/index.js.map +1 -0
  149. package/dist/react-native/generated/lroImpl.d.ts +16 -0
  150. package/dist/react-native/generated/lroImpl.d.ts.map +1 -0
  151. package/dist/react-native/generated/lroImpl.js +33 -0
  152. package/dist/react-native/generated/lroImpl.js.map +1 -0
  153. package/dist/react-native/generated/models/index.d.ts +1951 -0
  154. package/dist/react-native/generated/models/index.d.ts.map +1 -0
  155. package/dist/react-native/generated/models/index.js +656 -0
  156. package/dist/react-native/generated/models/index.js.map +1 -0
  157. package/dist/react-native/generated/models/mappers.d.ts +153 -0
  158. package/dist/react-native/generated/models/mappers.d.ts.map +1 -0
  159. package/dist/react-native/generated/models/mappers.js +2842 -0
  160. package/dist/react-native/generated/models/mappers.js.map +1 -0
  161. package/dist/react-native/generated/models/parameters.d.ts +8 -0
  162. package/dist/react-native/generated/models/parameters.d.ts.map +1 -0
  163. package/dist/react-native/generated/models/parameters.js +61 -0
  164. package/dist/react-native/generated/models/parameters.js.map +1 -0
  165. package/dist/react-native/index.d.ts +13 -0
  166. package/dist/react-native/index.d.ts.map +1 -0
  167. package/dist/react-native/index.js +15 -0
  168. package/dist/react-native/index.js.map +1 -0
  169. package/dist/react-native/models.d.ts +1953 -0
  170. package/dist/react-native/models.d.ts.map +1 -0
  171. package/dist/react-native/models.js +649 -0
  172. package/dist/react-native/models.js.map +1 -0
  173. package/dist/react-native/package.json +3 -0
  174. package/package.json +95 -100
  175. package/CHANGELOG.md +0 -5
  176. package/dist/index.js.map +0 -1
  177. package/dist-esm/samples-dev/sample_analyze_conversation_app.js +0 -74
  178. package/dist-esm/samples-dev/sample_analyze_conversation_app.js.map +0 -1
  179. package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js +0 -89
  180. package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js.map +0 -1
  181. package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js +0 -65
  182. package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js.map +0 -1
  183. package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js +0 -66
  184. package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js.map +0 -1
  185. package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js +0 -76
  186. package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js.map +0 -1
  187. package/dist-esm/samples-dev/sample_authentication.js +0 -44
  188. package/dist-esm/samples-dev/sample_authentication.js.map +0 -1
  189. package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js +0 -112
  190. package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js.map +0 -1
  191. package/dist-esm/samples-dev/sample_conv_summarization.js +0 -95
  192. package/dist-esm/samples-dev/sample_conv_summarization.js.map +0 -1
  193. package/dist-esm/src/azureKeyCredentialPolicy.js.map +0 -1
  194. package/dist-esm/src/conversationAnalysisClient.js.map +0 -1
  195. package/dist-esm/src/generated/index.js.map +0 -1
  196. package/dist-esm/src/generated/lroImpl.js.map +0 -1
  197. package/dist-esm/src/generated/models/mappers.js.map +0 -1
  198. package/dist-esm/src/index.js.map +0 -1
  199. package/dist-esm/src/models.js.map +0 -1
  200. package/dist-esm/test/public/analyze.spec.js +0 -159
  201. package/dist-esm/test/public/analyze.spec.js.map +0 -1
  202. package/dist-esm/test/public/inputs.js +0 -166
  203. package/dist-esm/test/public/inputs.js.map +0 -1
  204. package/dist-esm/test/public/utils/recordedClient.js +0 -50
  205. package/dist-esm/test/public/utils/recordedClient.js.map +0 -1
  206. package/review/ai-language-conversations.api.md +0 -1291
  207. package/rollup.config.js +0 -122
  208. package/tsconfig.json +0 -11
  209. package/types/samples-dev/sample_analyze_conversation_app.d.ts +0 -2
  210. package/types/samples-dev/sample_analyze_conversation_app.d.ts.map +0 -1
  211. package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts +0 -2
  212. package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts.map +0 -1
  213. package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts +0 -2
  214. package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts.map +0 -1
  215. package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts +0 -2
  216. package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts.map +0 -1
  217. package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts +0 -2
  218. package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts.map +0 -1
  219. package/types/samples-dev/sample_authentication.d.ts +0 -2
  220. package/types/samples-dev/sample_authentication.d.ts.map +0 -1
  221. package/types/samples-dev/sample_conv_pii_transcript_input.d.ts +0 -2
  222. package/types/samples-dev/sample_conv_pii_transcript_input.d.ts.map +0 -1
  223. package/types/samples-dev/sample_conv_summarization.d.ts +0 -2
  224. package/types/samples-dev/sample_conv_summarization.d.ts.map +0 -1
  225. package/types/src/azureKeyCredentialPolicy.d.ts.map +0 -1
  226. package/types/src/conversationAnalysisClient.d.ts.map +0 -1
  227. package/types/src/generated/conversationAnalysisClient.d.ts.map +0 -1
  228. package/types/src/generated/index.d.ts +0 -3
  229. package/types/src/generated/models/index.d.ts.map +0 -1
  230. package/types/src/models.d.ts.map +0 -1
  231. package/types/test/public/analyze.spec.d.ts +0 -2
  232. package/types/test/public/analyze.spec.d.ts.map +0 -1
  233. package/types/test/public/inputs.d.ts +0 -8
  234. package/types/test/public/inputs.d.ts.map +0 -1
  235. package/types/test/public/utils/recordedClient.d.ts +0 -16
  236. package/types/test/public/utils/recordedClient.d.ts.map +0 -1
  237. /package/{types/src → dist/browser}/constants.d.ts +0 -0
  238. /package/{types/src → dist/browser}/constants.d.ts.map +0 -0
  239. /package/{types/src → dist/browser}/generated/lroImpl.d.ts +0 -0
  240. /package/{types/src → dist/browser}/generated/lroImpl.d.ts.map +0 -0
  241. /package/{dist-esm/src → dist/browser}/generated/models/index.js +0 -0
  242. /package/{dist-esm/src → dist/browser}/generated/models/index.js.map +0 -0
  243. /package/{types/src → dist/browser}/generated/models/mappers.d.ts +0 -0
  244. /package/{types/src → dist/browser}/generated/models/mappers.d.ts.map +0 -0
  245. /package/{types/src → dist/browser}/generated/models/parameters.d.ts +0 -0
  246. /package/{types/src → dist/browser}/generated/models/parameters.d.ts.map +0 -0
@@ -1,74 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze user query for intents and entities using
5
- * a conversation project with a language parameter.
6
- *
7
- * @summary Conversational query analysis for intents and entities extraction
8
- * @azsdk-weight 50
9
- */
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- //Get secrets
15
- //You will have to set these environment variables for the sample to work
16
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
17
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
18
- const projectName = process.env.AZURE_CONVERSATIONS_PROJECT_NAME || "<project-name>";
19
- const deploymentName = process.env.AZURE_CONVERSATIONS_DEPLOYMENT_NAME || "<deployment-name>";
20
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
21
- const body = {
22
- kind: "Conversation",
23
- analysisInput: {
24
- conversationItem: {
25
- id: "id__7863",
26
- participantId: "id__7863",
27
- text: "Send an email to Carol about the tomorrow's demo",
28
- },
29
- },
30
- parameters: {
31
- projectName: projectName,
32
- deploymentName: deploymentName,
33
- },
34
- };
35
- export async function main() {
36
- //Analyze query
37
- const { result } = await service.analyzeConversation(body);
38
- console.log("query: ", result.query);
39
- console.log("project kind: ", result.prediction.projectKind);
40
- console.log("top intent: ", result.prediction.topIntent);
41
- const prediction = result.prediction;
42
- if (prediction.projectKind == "Conversation") {
43
- console.log("category: ", prediction.intents[0].category);
44
- console.log("confidence score: ", prediction.intents[0].confidence);
45
- console.log("entities:");
46
- for (const entity of prediction.entities) {
47
- console.log("\ncategory: ", entity.category);
48
- console.log("text: ", entity.text);
49
- console.log("confidence score: ", entity.confidence);
50
- if (entity.resolutions) {
51
- console.log("resolutions:");
52
- for (const resolution of entity.resolutions) {
53
- console.log("kind: ", resolution.resolutionKind);
54
- if ("value" in resolution)
55
- console.log("value: ", resolution.value);
56
- }
57
- }
58
- if (entity.extraInformation) {
59
- console.log("extra info:");
60
- for (const data of entity.extraInformation) {
61
- console.log("kind: ", data.extraInformationKind);
62
- if (data.extraInformationKind == "ListKey")
63
- console.log("key: ", data.key);
64
- if (data.extraInformationKind == "EntitySubtype")
65
- console.log("value: ", data.value);
66
- }
67
- }
68
- }
69
- }
70
- }
71
- main().catch((err) => {
72
- console.error("The sample encountered an error:", err);
73
- });
74
- //# sourceMappingURL=sample_analyze_conversation_app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_analyze_conversation_app.js","sourceRoot":"","sources":["../../samples-dev/sample_analyze_conversation_app.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OA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C,oBAAoB,IAAI,SAAS;wBAAE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;oBAC3E,IAAI,IAAI,CAAC,oBAAoB,IAAI,eAAe;wBAAE,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;iBACtF;aACF;SACF;KACF;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze user query for intents and entities using\n * a conversation project with a language parameter.\n *\n * @summary Conversational query analysis for intents and entities extraction\n * @azsdk-weight 50\n */\n\nimport { ConversationAnalysisClient, ConversationalTask } from \"@azure/ai-language-conversations\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\n\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\nconst projectName = process.env.AZURE_CONVERSATIONS_PROJECT_NAME || \"<project-name>\";\nconst deploymentName = process.env.AZURE_CONVERSATIONS_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n id: \"id__7863\",\n participantId: \"id__7863\",\n text: \"Send an email to Carol about the tomorrow's demo\",\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n },\n};\n\nexport async function main() {\n //Analyze query\n const { result } = await service.analyzeConversation(body);\n console.log(\"query: \", result.query);\n console.log(\"project kind: \", result.prediction.projectKind);\n console.log(\"top intent: \", result.prediction.topIntent);\n\n const prediction = result.prediction;\n if (prediction.projectKind == \"Conversation\") {\n console.log(\"category: \", prediction.intents[0].category);\n console.log(\"confidence score: \", prediction.intents[0].confidence);\n console.log(\"entities:\");\n\n for (const entity of prediction.entities) {\n console.log(\"\\ncategory: \", entity.category);\n console.log(\"text: \", entity.text);\n console.log(\"confidence score: \", entity.confidence);\n\n if (entity.resolutions) {\n console.log(\"resolutions:\");\n for (const resolution of entity.resolutions) {\n console.log(\"kind: \", resolution.resolutionKind);\n if (\"value\" in resolution) console.log(\"value: \", resolution.value);\n }\n }\n\n if (entity.extraInformation) {\n console.log(\"extra info:\");\n for (const data of entity.extraInformation) {\n console.log(\"kind: \", data.extraInformationKind);\n if (data.extraInformationKind == \"ListKey\") console.log(\"key: \", data.key);\n if (data.extraInformationKind == \"EntitySubtype\") console.log(\"value: \", data.value);\n }\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}
@@ -1,89 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze user query using an orchestration project.
5
- * In this sample, orchestration project's top intent will map to a conversation project.
6
- *
7
- * @summary Orchestration project with conversational response
8
- * @azsdk-weight 50
9
- */
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- //Get secrets
15
- //You will have to set these environment variables for the sample to work
16
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
17
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
18
- const projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || "<project-name>";
19
- const deploymentName = process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || "<deployment-name>";
20
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
21
- const body = {
22
- kind: "Conversation",
23
- analysisInput: {
24
- conversationItem: {
25
- participantId: "1",
26
- id: "1",
27
- modality: "text",
28
- language: "en",
29
- text: "Send an email to Carol about the tomorrow's demo",
30
- },
31
- },
32
- parameters: {
33
- projectName: projectName,
34
- deploymentName: deploymentName,
35
- verbose: true,
36
- isLoggingEnabled: false,
37
- },
38
- };
39
- export async function main() {
40
- //Analyze query
41
- const { result } = await service.analyzeConversation(body);
42
- console.log("query: ", result.query);
43
- console.log("project kind: ", result.prediction.projectKind);
44
- const top_intent = result.prediction.topIntent || "None";
45
- console.log("top intent: ", top_intent);
46
- const prediction = result.prediction;
47
- if (prediction.projectKind == "Orchestration") {
48
- const top_intent_object = prediction.intents[top_intent];
49
- console.log("confidence score: ", top_intent_object.confidence);
50
- console.log("project kind: ", top_intent_object.targetProjectKind);
51
- if (top_intent_object.targetProjectKind == "Conversation") {
52
- console.log("\nview conversation result:");
53
- if (top_intent_object.result && top_intent_object.result.prediction) {
54
- console.log("\ntop intent: ", top_intent_object.result.prediction.topIntent);
55
- const intent = top_intent_object.result.prediction.intents[0];
56
- console.log("category: ", intent.category);
57
- console.log("confidence score: ", intent.confidence);
58
- console.log("\nview entities:");
59
- top_intent_object.result.prediction.entities.forEach((entity) => {
60
- console.log("\ncategory: ", entity.category);
61
- console.log("text: ", entity.text);
62
- console.log("confidence score: %f", entity.confidence);
63
- if (entity.resolutions) {
64
- console.log("resolutions:");
65
- entity.resolutions.forEach((resolution) => {
66
- console.log("kind: ", resolution.resolutionKind);
67
- if ("value" in resolution)
68
- console.log("value: ", resolution.value);
69
- });
70
- }
71
- if (entity.extraInformation) {
72
- console.log("extra info:");
73
- for (const data of entity.extraInformation) {
74
- console.log("kind: ", data.extraInformationKind);
75
- if (data.extraInformationKind == "ListKey")
76
- console.log("key: ", data.key);
77
- if (data.extraInformationKind == "EntitySubtype")
78
- console.log("value: ", data.value);
79
- }
80
- }
81
- });
82
- }
83
- }
84
- }
85
- }
86
- main().catch((err) => {
87
- console.error("The sample encountered an error:", err);
88
- });
89
- //# sourceMappingURL=sample_analyze_orchestration_app_conv_response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_analyze_orchestration_app_conv_response.js","sourceRoot":"","sources":["../../samples-dev/sample_analyze_orchestration_app_conv_response.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAsB,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,aAAa;AACb,yEAAyE;AACzE,MAAM,WAAW,GACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,mDAAmD,CAAC;AAClG,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,WAAW,CAAC;AAClE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,IAAI,gBAAgB,CAAC;AAC9F,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,mBAAmB,CAAC;AAElF,MAAM,OAAO,GAA+B,IAAI,0BAA0B,CACxE,WAAW,EACX,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAC/B,CAAC;AAEF,MAAM,IAAI,GAAuB;IAC/B,IAAI,EAAE,cAAc;IACpB,aAAa,EAAE;QACb,gBAAgB,EAAE;YAChB,aAAa,EAAE,GAAG;YAClB,EAAE,EAAE,GAAG;YACP,QAAQ,EAAE,MAAM;YAChB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,kDAAkD;SACzD;KACF;IACD,UAAU,EAAE;QACV,WAAW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AAC,CAAC;4BAC3E,IAAI,IAAI,CAAC,oBAAoB,IAAI,eAAe;gCAAE,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;yBACtF;qBACF;gBACH,CAAC,CAAC,CAAC;aACJ;SACF;KACF;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze user query using an orchestration project.\n * In this sample, orchestration project's top intent will map to a conversation project.\n *\n * @summary Orchestration project with conversational response\n * @azsdk-weight 50\n */\n\nimport { ConversationAnalysisClient, ConversationalTask } from \"@azure/ai-language-conversations\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\n\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\nconst projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || \"<project-name>\";\nconst deploymentName =\n process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n participantId: \"1\",\n id: \"1\",\n modality: \"text\",\n language: \"en\",\n text: \"Send an email to Carol about the tomorrow's demo\",\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n verbose: true,\n isLoggingEnabled: false,\n },\n};\n\nexport async function main() {\n //Analyze query\n const { result } = await service.analyzeConversation(body);\n console.log(\"query: \", result.query);\n console.log(\"project kind: \", result.prediction.projectKind);\n\n const top_intent = result.prediction.topIntent || \"None\";\n console.log(\"top intent: \", top_intent);\n\n const prediction = result.prediction;\n if (prediction.projectKind == \"Orchestration\") {\n const top_intent_object = prediction.intents[top_intent];\n console.log(\"confidence score: \", top_intent_object.confidence);\n console.log(\"project kind: \", top_intent_object.targetProjectKind);\n\n if (top_intent_object.targetProjectKind == \"Conversation\") {\n console.log(\"\\nview conversation result:\");\n\n if (top_intent_object.result && top_intent_object.result.prediction) {\n console.log(\"\\ntop intent: \", top_intent_object.result.prediction.topIntent);\n\n const intent = top_intent_object.result.prediction.intents[0];\n console.log(\"category: \", intent.category);\n console.log(\"confidence score: \", intent.confidence);\n\n console.log(\"\\nview entities:\");\n top_intent_object.result.prediction.entities.forEach((entity) => {\n console.log(\"\\ncategory: \", entity.category);\n console.log(\"text: \", entity.text);\n console.log(\"confidence score: %f\", entity.confidence);\n\n if (entity.resolutions) {\n console.log(\"resolutions:\");\n entity.resolutions.forEach((resolution) => {\n console.log(\"kind: \", resolution.resolutionKind);\n if (\"value\" in resolution) console.log(\"value: \", resolution.value);\n });\n }\n\n if (entity.extraInformation) {\n console.log(\"extra info:\");\n for (const data of entity.extraInformation) {\n console.log(\"kind: \", data.extraInformationKind);\n if (data.extraInformationKind == \"ListKey\") console.log(\"key: \", data.key);\n if (data.extraInformationKind == \"EntitySubtype\") console.log(\"value: \", data.value);\n }\n }\n });\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}
@@ -1,65 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze user query using an orchestration project.
5
- * In this sample, orchestration project's top intent will map to a LUIS project
6
- *
7
- * @summary Orchestration project with LUIS response
8
- * @azsdk-weight 50
9
- */
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- //Get secrets
15
- //You will have to set these environment variables for the sample to work
16
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
17
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
18
- const projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || "<project-name>";
19
- const deploymentName = process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || "<deployment-name>";
20
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
21
- const body = {
22
- kind: "Conversation",
23
- analysisInput: {
24
- conversationItem: {
25
- participantId: "1",
26
- id: "1",
27
- modality: "text",
28
- language: "en",
29
- text: "Reserve a table for 2 at the Italian restaurant",
30
- },
31
- },
32
- parameters: {
33
- projectName: projectName,
34
- deploymentName: deploymentName,
35
- verbose: true,
36
- isLoggingEnabled: false,
37
- },
38
- };
39
- export async function main() {
40
- //Analyze query
41
- const { result } = await service.analyzeConversation(body);
42
- console.log("query: ", result.query);
43
- console.log("project kind: ", result.prediction.projectKind);
44
- const top_intent = result.prediction.topIntent || "None";
45
- console.log("top intent: ", top_intent);
46
- const prediction = result.prediction;
47
- if (prediction.projectKind == "Orchestration") {
48
- const top_intent_object = prediction.intents[top_intent];
49
- console.log("confidence score: ", top_intent_object.confidence);
50
- console.log("project kind: ", top_intent_object.targetProjectKind);
51
- if (top_intent_object.targetProjectKind == "Luis" && top_intent_object.result) {
52
- console.log("\nluis response:");
53
- const luis_response = top_intent_object.result.prediction;
54
- console.log("top intent: ", luis_response.topIntent);
55
- console.log("\nentities:");
56
- for (const entity of luis_response.entities) {
57
- console.log("\n", entity);
58
- }
59
- }
60
- }
61
- }
62
- main().catch((err) => {
63
- console.error("The sample encountered an error:", err);
64
- });
65
- //# sourceMappingURL=sample_analyze_orchestration_app_luis_response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_analyze_orchestration_app_luis_response.js","sourceRoot":"","sources":["../../samples-dev/sample_analyze_orchestration_app_luis_response.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAsB,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,aAAa;AACb,yEAAyE;AACzE,MAAM,WAAW,GACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,mDAAmD,CAAC;AAClG,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,WAAW,CAAC;AAClE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,IAAI,gBAAgB,CAAC;AAC9F,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,mBAAmB,CAAC;AAElF,MAAM,OAAO,GAA+B,IAAI,0BAA0B,CACxE,WAAW,EACX,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAC/B,CAAC;AAEF,MAAM,IAAI,GAAuB;IAC/B,IAAI,EAAE,cAAc;IACpB,aAAa,EAAE;QACb,gBAAgB,EAAE;YAChB,aAAa,EAAE,GAAG;YAClB,EAAE,EAAE,GAAG;YACP,QAAQ,EAAE,MAAM;YAChB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,iDAAiD;SACxD;KACF;IACD,UAAU,EAAE;QACV,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,cAAc;QAC9B,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,eAAe;IACf,MAAM,EAAE,MAAM,EAA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AkC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze user query using an orchestration project.\n * In this sample, orchestration project's top intent will map to a LUIS project\n *\n * @summary Orchestration project with LUIS response\n * @azsdk-weight 50\n */\n\nimport { ConversationAnalysisClient, ConversationalTask } from \"@azure/ai-language-conversations\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\nconst projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || \"<project-name>\";\nconst deploymentName =\n process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n participantId: \"1\",\n id: \"1\",\n modality: \"text\",\n language: \"en\",\n text: \"Reserve a table for 2 at the Italian restaurant\",\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n verbose: true,\n isLoggingEnabled: false,\n },\n};\n\nexport async function main() {\n //Analyze query\n const { result } = await service.analyzeConversation(body);\n console.log(\"query: \", result.query);\n console.log(\"project kind: \", result.prediction.projectKind);\n\n const top_intent = result.prediction.topIntent || \"None\";\n console.log(\"top intent: \", top_intent);\n\n const prediction = result.prediction;\n if (prediction.projectKind == \"Orchestration\") {\n const top_intent_object = prediction.intents[top_intent];\n console.log(\"confidence score: \", top_intent_object.confidence);\n console.log(\"project kind: \", top_intent_object.targetProjectKind);\n\n if (top_intent_object.targetProjectKind == \"Luis\" && top_intent_object.result) {\n console.log(\"\\nluis response:\");\n\n const luis_response = top_intent_object.result.prediction;\n console.log(\"top intent: \", luis_response.topIntent);\n console.log(\"\\nentities:\");\n for (const entity of luis_response.entities) {\n console.log(\"\\n\", entity);\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}
@@ -1,66 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze user query using an orchestration project.
5
- * In this sample, orchestration project's top intent will map to a Qna project.
6
- *
7
- * @summary Orchestration project with QnA response
8
- * @azsdk-weight 50
9
- */
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- //Get secrets
15
- //You will have to set these environment variables for the sample to work
16
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
17
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
18
- const projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || "<project-name>";
19
- const deploymentName = process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || "<deployment-name>";
20
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
21
- const body = {
22
- kind: "Conversation",
23
- analysisInput: {
24
- conversationItem: {
25
- participantId: "1",
26
- id: "1",
27
- modality: "text",
28
- language: "en",
29
- text: "How are you?",
30
- },
31
- },
32
- parameters: {
33
- projectName: projectName,
34
- deploymentName: deploymentName,
35
- verbose: true,
36
- isLoggingEnabled: false,
37
- },
38
- };
39
- export async function main() {
40
- //Analyze query
41
- const { result } = await service.analyzeConversation(body);
42
- console.log("query: ", result.query);
43
- console.log("project kind: ", result.prediction.projectKind);
44
- const top_intent = result.prediction.topIntent || "None";
45
- console.log("\ntop intent: ", top_intent);
46
- const prediction = result.prediction;
47
- if (prediction.projectKind == "Orchestration") {
48
- const top_intent_object = prediction.intents[top_intent];
49
- console.log("confidence score: ", top_intent_object.confidence);
50
- console.log("project kind: ", top_intent_object.targetProjectKind);
51
- if (top_intent_object.targetProjectKind == "QuestionAnswering") {
52
- console.log("\nqna response:");
53
- const qna_response = top_intent_object.result;
54
- if (qna_response && qna_response.answers) {
55
- for (const answer of qna_response.answers) {
56
- console.log("\nanswer: ", answer.answer);
57
- console.log("confidence score: ", answer.confidence);
58
- }
59
- }
60
- }
61
- }
62
- }
63
- main().catch((err) => {
64
- console.error("The sample encountered an error:", err);
65
- });
66
- //# sourceMappingURL=sample_analyze_orchestration_app_qna_response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_analyze_orchestration_app_qna_response.js","sourceRoot":"","sources":["../../samples-dev/sample_analyze_orchestration_app_qna_response.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAsB,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,aAAa;AACb,yEAAyE;AACzE,MAAM,WAAW,GACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,mDAAmD,CAAC;AAClG,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,WAAW,CAAC;AAClE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,IAAI,gBAAgB,CAAC;AAC9F,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,mBAAmB,CAAC;AAElF,MAAM,OAAO,GAA+B,IAAI,0BAA0B,CACxE,WAAW,EACX,IAAI,kBAAkB,C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AC,CAAC;YAC/B,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC;YAC9C,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxC,KAAK,MAAM,MAAM,IAAI,YAAY,CAAC,OAAO,EAAE;oBACzC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;oBACzC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;iBACtD;aACF;SACF;KACF;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze user query using an orchestration project.\n * In this sample, orchestration project's top intent will map to a Qna project.\n *\n * @summary Orchestration project with QnA response\n * @azsdk-weight 50\n */\n\nimport { ConversationAnalysisClient, ConversationalTask } from \"@azure/ai-language-conversations\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\nconst projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || \"<project-name>\";\nconst deploymentName =\n process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n participantId: \"1\",\n id: \"1\",\n modality: \"text\",\n language: \"en\",\n text: \"How are you?\",\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n verbose: true,\n isLoggingEnabled: false,\n },\n};\n\nexport async function main() {\n //Analyze query\n const { result } = await service.analyzeConversation(body);\n console.log(\"query: \", result.query);\n console.log(\"project kind: \", result.prediction.projectKind);\n\n const top_intent = result.prediction.topIntent || \"None\";\n console.log(\"\\ntop intent: \", top_intent);\n\n const prediction = result.prediction;\n if (prediction.projectKind == \"Orchestration\") {\n const top_intent_object = prediction.intents[top_intent];\n console.log(\"confidence score: \", top_intent_object.confidence);\n console.log(\"project kind: \", top_intent_object.targetProjectKind);\n\n if (top_intent_object.targetProjectKind == \"QuestionAnswering\") {\n console.log(\"\\nqna response:\");\n const qna_response = top_intent_object.result;\n if (qna_response && qna_response.answers) {\n for (const answer of qna_response.answers) {\n console.log(\"\\nanswer: \", answer.answer);\n console.log(\"confidence score: \", answer.confidence);\n }\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}
@@ -1,76 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze user query using an orchestration project.
5
- * In this sample, orchestration project's top intent will map to a Qna project.
6
- *
7
- * @summary Orchestration project with direct target
8
- * @azsdk-weight 50
9
- */
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- //Get secrets
15
- //You will have to set these environment variables for the sample to work
16
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
17
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
18
- const projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || "<project-name>";
19
- const deploymentName = process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || "<deployment-name>";
20
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
21
- const query = "How are you?";
22
- const qna_app = "ChitChat-QnA";
23
- const body = {
24
- kind: "Conversation",
25
- analysisInput: {
26
- conversationItem: {
27
- participantId: "1",
28
- id: "1",
29
- modality: "text",
30
- language: "en",
31
- text: query,
32
- },
33
- },
34
- parameters: {
35
- projectName: projectName,
36
- deploymentName: deploymentName,
37
- isLoggingEnabled: false,
38
- directTarget: qna_app,
39
- targetProjectParameters: {
40
- "ChitChat-QnA": {
41
- targetProjectKind: "QuestionAnswering",
42
- callingOptions: {
43
- question: query,
44
- },
45
- },
46
- },
47
- },
48
- };
49
- export async function main() {
50
- //Analyze query
51
- const { result } = await service.analyzeConversation(body);
52
- console.log("query: ", result.query);
53
- console.log("project kind: ", result.prediction.projectKind);
54
- const top_intent = result.prediction.topIntent || "None";
55
- console.log("\ntop intent: ", top_intent);
56
- const prediction = result.prediction;
57
- if (prediction.projectKind == "Orchestration") {
58
- const top_intent_object = prediction.intents[top_intent];
59
- console.log("confidence score: ", top_intent_object.confidence);
60
- console.log("project kind: ", top_intent_object.targetProjectKind);
61
- if (top_intent_object.targetProjectKind == "QuestionAnswering") {
62
- console.log("\nqna response:");
63
- const qna_response = top_intent_object.result;
64
- if (qna_response && qna_response.answers) {
65
- for (const answer of qna_response.answers) {
66
- console.log("\nanswer: ", answer.answer);
67
- console.log("confidence score: ", answer.confidence);
68
- }
69
- }
70
- }
71
- }
72
- }
73
- main().catch((err) => {
74
- console.error("The sample encountered an error:", err);
75
- });
76
- //# sourceMappingURL=sample_analyze_orchestration_direct_target.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_analyze_orchestration_direct_target.js","sourceRoot":"","sources":["../../samples-dev/sample_analyze_orchestration_direct_target.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAA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;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze user query using an orchestration project.\n * In this sample, orchestration project's top intent will map to a Qna project.\n *\n * @summary Orchestration project with direct target\n * @azsdk-weight 50\n */\n\nimport { ConversationAnalysisClient, ConversationalTask } from \"@azure/ai-language-conversations\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\nconst projectName = process.env.AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME || \"<project-name>\";\nconst deploymentName =\n process.env.AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nconst query = \"How are you?\";\nconst qna_app = \"ChitChat-QnA\";\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n participantId: \"1\",\n id: \"1\",\n modality: \"text\",\n language: \"en\",\n text: query,\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n isLoggingEnabled: false,\n directTarget: qna_app,\n targetProjectParameters: {\n \"ChitChat-QnA\": {\n targetProjectKind: \"QuestionAnswering\",\n callingOptions: {\n question: query,\n },\n },\n },\n },\n};\n\nexport async function main() {\n //Analyze query\n const { result } = await service.analyzeConversation(body);\n console.log(\"query: \", result.query);\n console.log(\"project kind: \", result.prediction.projectKind);\n\n const top_intent = result.prediction.topIntent || \"None\";\n console.log(\"\\ntop intent: \", top_intent);\n\n const prediction = result.prediction;\n if (prediction.projectKind == \"Orchestration\") {\n const top_intent_object = prediction.intents[top_intent];\n console.log(\"confidence score: \", top_intent_object.confidence);\n console.log(\"project kind: \", top_intent_object.targetProjectKind);\n\n if (top_intent_object.targetProjectKind == \"QuestionAnswering\") {\n console.log(\"\\nqna response:\");\n\n const qna_response = top_intent_object.result;\n if (qna_response && qna_response.answers) {\n for (const answer of qna_response.answers) {\n console.log(\"\\nanswer: \", answer.answer);\n console.log(\"confidence score: \", answer.confidence);\n }\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}
@@ -1,44 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to use an API Key to authenticate a ConversationAnalysisClient.
5
- *
6
- * @summary authenticates a service client using an API key
7
- * @azsdk-weight 40
8
- */
9
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
10
- // To use an API Key, import `AzureKeyCredential`
11
- import { AzureKeyCredential } from "@azure/core-auth";
12
- import * as dotenv from "dotenv";
13
- dotenv.config();
14
- // You will need to set these environment variables or edit the following values
15
- const projectName = process.env.AZURE_CONVERSATIONS_PROJECT_NAME || "<project-name>";
16
- const deploymentName = process.env.AZURE_CONVERSATIONS_DEPLOYMENT_NAME || "<deployment-name>";
17
- const body = {
18
- kind: "Conversation",
19
- analysisInput: {
20
- conversationItem: {
21
- id: "id__7863",
22
- participantId: "id__7863",
23
- text: "Send an email to Carol about the tomorrow's demo",
24
- },
25
- },
26
- parameters: {
27
- projectName: projectName,
28
- deploymentName: deploymentName,
29
- },
30
- };
31
- async function sample_authentication_api_key() {
32
- console.log("\n.. authentication_with_api_key");
33
- // You will need to set these environment variables or edit the following values
34
- const endpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
35
- const key = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
36
- const client = new ConversationAnalysisClient(endpoint, new AzureKeyCredential(key));
37
- const { result } = await client.analyzeConversation(body);
38
- console.log("top intent: ", result.prediction.topIntent);
39
- }
40
- function main() {
41
- sample_authentication_api_key();
42
- }
43
- main();
44
- //# sourceMappingURL=sample_authentication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_authentication.js","sourceRoot":"","sources":["../../samples-dev/sample_authentication.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AAEH,OAAO,EAAsB,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAClG,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,gFAAgF;AAChF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,gBAAgB,CAAC;AACrF,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,mBAAmB,CAAC;AAE9F,MAAM,IAAI,GAAuB;IAC/B,IAAI,EAAE,cAAc;IACpB,aAAa,EAAE;QACb,gBAAgB,EAAE;YAChB,EAAE,EAAE,UAAU;YACd,aAAa,EAAE,UAAU;YACzB,IAAI,EAAE,kDAAkD;SACzD;KACF;IACD,UAAU,EAAE;QACV,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC;AAEF,KAAK,UAAU,6BAA6B;IAC1C,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,gFAAgF;IAChF,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,mDAAmD,CAAC;IAClG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,WAAW,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAI,0BAA0B,CAAC,QAAQ,EAAE,IAAI,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;IACrF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,IAAI;IACX,6BAA6B,EAAE,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to use an API Key to authenticate a ConversationAnalysisClient.\n *\n * @summary authenticates a service client using an API key\n * @azsdk-weight 40\n */\n\nimport { ConversationalTask, ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\n// To use an API Key, import `AzureKeyCredential`\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\n// You will need to set these environment variables or edit the following values\nconst projectName = process.env.AZURE_CONVERSATIONS_PROJECT_NAME || \"<project-name>\";\nconst deploymentName = process.env.AZURE_CONVERSATIONS_DEPLOYMENT_NAME || \"<deployment-name>\";\n\nconst body: ConversationalTask = {\n kind: \"Conversation\",\n analysisInput: {\n conversationItem: {\n id: \"id__7863\",\n participantId: \"id__7863\",\n text: \"Send an email to Carol about the tomorrow's demo\",\n },\n },\n parameters: {\n projectName: projectName,\n deploymentName: deploymentName,\n },\n};\n\nasync function sample_authentication_api_key() {\n console.log(\"\\n.. authentication_with_api_key\");\n // You will need to set these environment variables or edit the following values\n const endpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\n const key = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\n\n const client = new ConversationAnalysisClient(endpoint, new AzureKeyCredential(key));\n const { result } = await client.analyzeConversation(body);\n console.log(\"top intent: \", result.prediction.topIntent);\n}\n\nfunction main() {\n sample_authentication_api_key();\n}\n\nmain();\n"]}
@@ -1,112 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * This sample demonstrates how to analyze a conversation for PII (personally identifiable information).
5
- *
6
- * @summary PII conversational analysis
7
- * @azsdk-weight 50
8
- */
9
- import { AzureKeyCredential } from "@azure/core-auth";
10
- import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
11
- import * as dotenv from "dotenv";
12
- dotenv.config();
13
- //Get secrets
14
- //You will have to set these environment variables for the sample to work
15
- const cluEndpoint = process.env.AZURE_CONVERSATIONS_ENDPOINT || "https://dummyendpoint.cognitiveservices.azure.com";
16
- const cluKey = process.env.AZURE_CONVERSATIONS_KEY || "<api-key>";
17
- const service = new ConversationAnalysisClient(cluEndpoint, new AzureKeyCredential(cluKey));
18
- export async function main() {
19
- //Analyze query
20
- const poller = await service.beginConversationAnalysis({
21
- displayName: "Analyze PII in conversation",
22
- analysisInput: {
23
- conversations: [
24
- {
25
- conversationItems: [
26
- {
27
- id: "1",
28
- participantId: "0",
29
- modality: "transcript",
30
- text: "It is john doe.",
31
- lexical: "It is john doe",
32
- itn: "It is john doe",
33
- maskedItn: "It is john doe",
34
- },
35
- {
36
- id: "2",
37
- participantId: "1",
38
- modality: "transcript",
39
- text: "Yes, 633-27-8199 is my phone",
40
- lexical: "yes six three three two seven eight one nine nine is my phone",
41
- itn: "yes 633278199 is my phone",
42
- maskedItn: "yes 633278199 is my phone",
43
- },
44
- {
45
- id: "3",
46
- participantId: "1",
47
- modality: "transcript",
48
- text: "j.doe@yahoo.com is my email",
49
- lexical: "j dot doe at yahoo dot com is my email",
50
- maskedItn: "j.doe@yahoo.com is my email",
51
- itn: "j.doe@yahoo.com is my email",
52
- },
53
- ],
54
- modality: "transcript",
55
- id: "1",
56
- language: "en",
57
- },
58
- ],
59
- },
60
- tasks: [
61
- {
62
- kind: "ConversationalPIITask",
63
- parameters: {
64
- redactionSource: "lexical",
65
- piiCategories: ["all"],
66
- },
67
- },
68
- ],
69
- });
70
- const actionResult = await poller.pollUntilDone();
71
- if (actionResult.tasks.items === undefined)
72
- return;
73
- const task_result = actionResult.tasks.items[0];
74
- if (task_result.kind == "conversationalPIIResults") {
75
- console.log("... view task status ...");
76
- console.log("status: ", task_result.status);
77
- const conv_pii_result = task_result.results;
78
- if (conv_pii_result.errors && conv_pii_result.errors.length != 0) {
79
- console.log("... errors occured ...");
80
- for (const error of conv_pii_result.errors) {
81
- console.log(error);
82
- }
83
- }
84
- else {
85
- const conversation_result = conv_pii_result.conversations[0];
86
- if (conversation_result.warnings && conversation_result.warnings.length != 0) {
87
- console.log("... view warnings ...");
88
- for (const warning of conversation_result.warnings) {
89
- console.log(warning);
90
- }
91
- }
92
- else {
93
- console.log("... view task result ...");
94
- for (const conversation of conversation_result.conversationItems) {
95
- console.log("conversation id: ", conversation.id);
96
- console.log("... entities ...");
97
- for (const entity of conversation.entities) {
98
- console.log("text: ", entity.text);
99
- console.log("category: ", entity.category);
100
- console.log("confidence: ", entity.confidenceScore);
101
- console.log("offset: ", entity.offset);
102
- console.log("length: ", entity.length);
103
- }
104
- }
105
- }
106
- }
107
- }
108
- }
109
- main().catch((err) => {
110
- console.error("The sample encountered an error:", err);
111
- });
112
- //# sourceMappingURL=sample_conv_pii_transcript_input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample_conv_pii_transcript_input.js","sourceRoot":"","sources":["../../samples-dev/sample_conv_pii_transcript_input.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,aAAa;AACb,yEAAyE;AACzE,MAAM,WAAW,GACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,mDAAmD,CAAC;AAClG,MAAM,MAAM,GAAG,OAAO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oBAChC,KAAK,MAAM,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE;wBAC1C,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;wBACnC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;wBAC3C,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;wBACpD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;wBACvC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;qBACxC;iBACF;aACF;SACF;KACF;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This sample demonstrates how to analyze a conversation for PII (personally identifiable information).\n *\n * @summary PII conversational analysis\n * @azsdk-weight 50\n */\n\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\n//Get secrets\n//You will have to set these environment variables for the sample to work\nconst cluEndpoint =\n process.env.AZURE_CONVERSATIONS_ENDPOINT || \"https://dummyendpoint.cognitiveservices.azure.com\";\nconst cluKey = process.env.AZURE_CONVERSATIONS_KEY || \"<api-key>\";\n\nconst service: ConversationAnalysisClient = new ConversationAnalysisClient(\n cluEndpoint,\n new AzureKeyCredential(cluKey)\n);\n\nexport async function main() {\n //Analyze query\n const poller = await service.beginConversationAnalysis({\n displayName: \"Analyze PII in conversation\",\n analysisInput: {\n conversations: [\n {\n conversationItems: [\n {\n id: \"1\",\n participantId: \"0\",\n modality: \"transcript\",\n text: \"It is john doe.\",\n lexical: \"It is john doe\",\n itn: \"It is john doe\",\n maskedItn: \"It is john doe\",\n },\n {\n id: \"2\",\n participantId: \"1\",\n modality: \"transcript\",\n text: \"Yes, 633-27-8199 is my phone\",\n lexical: \"yes six three three two seven eight one nine nine is my phone\",\n itn: \"yes 633278199 is my phone\",\n maskedItn: \"yes 633278199 is my phone\",\n },\n {\n id: \"3\",\n participantId: \"1\",\n modality: \"transcript\",\n text: \"j.doe@yahoo.com is my email\",\n lexical: \"j dot doe at yahoo dot com is my email\",\n maskedItn: \"j.doe@yahoo.com is my email\",\n itn: \"j.doe@yahoo.com is my email\",\n },\n ],\n modality: \"transcript\",\n id: \"1\",\n language: \"en\",\n },\n ],\n },\n tasks: [\n {\n kind: \"ConversationalPIITask\",\n parameters: {\n redactionSource: \"lexical\",\n piiCategories: [\"all\"],\n },\n },\n ],\n });\n const actionResult = await poller.pollUntilDone();\n if (actionResult.tasks.items === undefined) return;\n\n const task_result = actionResult.tasks.items[0];\n if (task_result.kind == \"conversationalPIIResults\") {\n console.log(\"... view task status ...\");\n console.log(\"status: \", task_result.status);\n const conv_pii_result = task_result.results;\n if (conv_pii_result.errors && conv_pii_result.errors.length != 0) {\n console.log(\"... errors occured ...\");\n for (const error of conv_pii_result.errors) {\n console.log(error);\n }\n } else {\n const conversation_result = conv_pii_result.conversations[0];\n if (conversation_result.warnings && conversation_result.warnings.length != 0) {\n console.log(\"... view warnings ...\");\n for (const warning of conversation_result.warnings) {\n console.log(warning);\n }\n } else {\n console.log(\"... view task result ...\");\n for (const conversation of conversation_result.conversationItems) {\n console.log(\"conversation id: \", conversation.id);\n console.log(\"... entities ...\");\n for (const entity of conversation.entities) {\n console.log(\"text: \", entity.text);\n console.log(\"category: \", entity.category);\n console.log(\"confidence: \", entity.confidenceScore);\n console.log(\"offset: \", entity.offset);\n console.log(\"length: \", entity.length);\n }\n }\n }\n }\n }\n}\n\nmain().catch((err) => {\n console.error(\"The sample encountered an error:\", err);\n});\n"]}