@azure/ai-language-conversations 1.0.0-alpha.20240109.1 → 1.0.0-alpha.20240112.1

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.
@@ -55,7 +55,6 @@ matrix([["APIKey"]], async (authMethod) => {
55
55
  assert.isAbove(message.result.prediction.entities[0].confidence, 0);
56
56
  });
57
57
  it("Test Orchestration App Conversational Response", async function () {
58
- var _a;
59
58
  const message = await client.analyzeConversation({
60
59
  kind: "Conversation",
61
60
  analysisInput: {
@@ -85,7 +84,7 @@ matrix([["APIKey"]], async (authMethod) => {
85
84
  assert.exists(message.result.prediction.intents.EmailIntent);
86
85
  const top_intent_object = message.result.prediction.intents.EmailIntent;
87
86
  if (top_intent_object.targetProjectKind !== "Conversation" ||
88
- ((_a = top_intent_object.result) === null || _a === void 0 ? void 0 : _a.prediction) === undefined) {
87
+ top_intent_object.result?.prediction === undefined) {
89
88
  assert.fail("Expected a Conversational response");
90
89
  }
91
90
  // Assert intent
@@ -101,7 +100,6 @@ matrix([["APIKey"]], async (authMethod) => {
101
100
  assert.isAbove(conversation_result.entities[0].confidence, 0);
102
101
  });
103
102
  it.skip("Test Orchestration App LUIS Response", async function () {
104
- var _a;
105
103
  const message = await client.analyzeConversation({
106
104
  kind: "Conversation",
107
105
  analysisInput: {
@@ -133,7 +131,7 @@ matrix([["APIKey"]], async (authMethod) => {
133
131
  assert.equal(top_intent_object.targetProjectKind, "Luis");
134
132
  // Assert intent
135
133
  if (top_intent_object.targetProjectKind !== "Luis" ||
136
- ((_a = top_intent_object.result) === null || _a === void 0 ? void 0 : _a.prediction) === undefined) {
134
+ top_intent_object.result?.prediction === undefined) {
137
135
  assert.fail("Expected a LUIS response");
138
136
  }
139
137
  const luis_result = top_intent_object.result.prediction;
@@ -144,7 +142,6 @@ matrix([["APIKey"]], async (authMethod) => {
144
142
  assert.isAtLeast(luis_result.entities.length, 1);
145
143
  });
146
144
  it("Test Orchestration App QnA Response", async function () {
147
- var _a;
148
145
  const message = await client.analyzeConversation({
149
146
  kind: "Conversation",
150
147
  analysisInput: {
@@ -176,7 +173,7 @@ matrix([["APIKey"]], async (authMethod) => {
176
173
  assert.equal(top_intent_object.targetProjectKind, "QuestionAnswering");
177
174
  // Assert intent
178
175
  if (top_intent_object.targetProjectKind !== "QuestionAnswering" ||
179
- ((_a = top_intent_object.result) === null || _a === void 0 ? void 0 : _a.answers) === undefined) {
176
+ top_intent_object.result?.answers === undefined) {
180
177
  assert.fail("Expected a QnA response");
181
178
  }
182
179
  assert.exists(top_intent_object.result.answers[0].answer);
@@ -1 +1 @@
1
- {"version":3,"file":"analyze.spec.js","sourceRoot":"","sources":["../../../test/public/analyze.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAY,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAU,EAAE,KAAK,EAAE,UAAsB,EAAE,EAAE;IAC7D,QAAQ,CAAC,IAAI,UAAU,8BAA8B,EAAE;QACrD,IAAI,QAAkB,CAAC;QACvB,IAAI,MAAkC,CAAC;QAEvC,UAAU,CAAC,KAAK;YACd,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjD,MAAM,GAAG,YAAY,CAAC;gBACpB,UAAU;gBACV,QAAQ;aACT,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,KAAK;YACb,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,EAAE;YAChB,EAAE,CAAC,uBAAuB,EAAE,KAAK;gBAC/B,MAAM,OAAO,GAAG,MA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L,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AuthMethod, createClient, startRecorder } from \"./utils/recordedClient\";\nimport { Context, Suite } from \"mocha\";\nimport { assert, matrix } from \"@azure/test-utils\";\nimport { ConversationAnalysisClient } from \"../../src\";\nimport { Recorder, assertEnvironmentVariable } from \"@azure-tools/test-recorder\";\n\nmatrix([[\"APIKey\"]] as const, async (authMethod: AuthMethod) => {\n describe(`[${authMethod}] ConversationAnalysisClient`, function (this: Suite) {\n let recorder: Recorder;\n let client: ConversationAnalysisClient;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this.currentTest);\n client = createClient({\n authMethod,\n recorder,\n });\n });\n\n afterEach(async function () {\n await recorder.stop();\n });\n\n describe(\"#sync\", function () {\n it(\"Test Conversation App\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_CLU_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_CLU_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Conversation\") {\n assert.fail(\"Expected a Conversation prediction\");\n }\n // Assert top intent\n assert.equal(message.result.prediction.topIntent, \"Send\");\n assert.isAtLeast(message.result.prediction.intents.length, 1);\n assert.equal(message.result.prediction.intents[0].category, \"Send\");\n assert.isAbove(message.result.prediction.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(message.result.prediction.entities.length, 1);\n assert.equal(message.result.prediction.entities[0].category, \"Contact\");\n assert.equal(message.result.prediction.entities[0].text, \"Carol\");\n assert.isAbove(message.result.prediction.entities[0].confidence, 0);\n });\n\n it(\"Test Orchestration App Conversational Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"EmailIntent\");\n assert.exists(message.result.prediction.intents.EmailIntent);\n const top_intent_object = message.result.prediction.intents.EmailIntent;\n\n if (\n top_intent_object.targetProjectKind !== \"Conversation\" ||\n top_intent_object.result?.prediction === undefined\n ) {\n assert.fail(\"Expected a Conversational response\");\n }\n // Assert intent\n const conversation_result = top_intent_object.result.prediction;\n assert.equal(conversation_result.topIntent, \"Send\");\n assert.isAtLeast(conversation_result.intents.length, 1);\n assert.equal(conversation_result.intents[0].category, \"Send\");\n assert.isAbove(conversation_result.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(conversation_result.entities.length, 1);\n assert.equal(conversation_result.entities[0].category, \"Contact\");\n assert.equal(conversation_result.entities[0].text, \"Carol\");\n assert.isAbove(conversation_result.entities[0].confidence, 0);\n });\n\n it.skip(\"Test Orchestration App LUIS Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"RestaurantIntent\");\n assert.exists(message.result.prediction.intents.RestaurantIntent);\n const top_intent_object = message.result.prediction.intents.RestaurantIntent;\n assert.equal(top_intent_object.targetProjectKind, \"Luis\");\n\n // Assert intent\n if (\n top_intent_object.targetProjectKind !== \"Luis\" ||\n top_intent_object.result?.prediction === undefined\n ) {\n assert.fail(\"Expected a LUIS response\");\n }\n const luis_result = top_intent_object.result.prediction;\n assert.equal(luis_result.topIntent, \"Reserve\");\n assert.isAtLeast(luis_result.intents.length, 1);\n assert.isAbove(luis_result.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(luis_result.entities.length, 1);\n });\n\n it(\"Test Orchestration App QnA Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"ChitChat-QnA\");\n assert.exists(message.result.prediction.intents[\"ChitChat-QnA\"]);\n const top_intent_object = message.result.prediction.intents[\"ChitChat-QnA\"];\n assert.equal(top_intent_object.targetProjectKind, \"QuestionAnswering\");\n\n // Assert intent\n if (\n top_intent_object.targetProjectKind !== \"QuestionAnswering\" ||\n top_intent_object.result?.answers === undefined\n ) {\n assert.fail(\"Expected a QnA response\");\n }\n assert.exists(top_intent_object.result.answers[0].answer);\n assert.isAbove(top_intent_object.result.answers[0].confidence || 0, 0);\n });\n });\n\n describe(\"#async\", function () {\n it(\"Test Conversation App PII transcript\", async function () {\n const poller = await client.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 message = await poller.pollUntilDone();\n // Assert main object\n assert.equal(message.status, \"succeeded\");\n\n // Assert task result\n if (\n message.tasks.items === undefined ||\n message.tasks.items[0].kind !== \"conversationalPIIResults\"\n ) {\n assert.fail(\"Expected a Conversational PII result\");\n }\n\n const task_result = message.tasks.items[0];\n assert.equal(task_result.status, \"succeeded\");\n assert.equal(task_result.kind, \"conversationalPIIResults\");\n\n // Assert Conversation Result\n const conversation_items = task_result.results.conversations[0].conversationItems;\n assert.exists(conversation_items);\n conversation_items.forEach((conversation) => {\n assert.exists(conversation.redactedContent);\n assert.exists(conversation.entities);\n });\n });\n\n it(\"Test Conversation Summarization App\", async function () {\n const poller = await client.beginConversationAnalysis({\n displayName: \"Analyze conversations from xxx\",\n analysisInput: {\n conversations: [\n {\n conversationItems: [\n {\n text: \"Hello, how can I help you?\",\n modality: \"text\",\n id: \"1\",\n participantId: \"Agent\",\n },\n {\n text: \"How to upgrade Office? I am getting error messages the whole day.\",\n modality: \"text\",\n id: \"2\",\n participantId: \"Customer\",\n },\n {\n text: \"Press the upgrade button please. Then sign in and follow the instructions.\",\n modality: \"text\",\n id: \"3\",\n participantId: \"Agent\",\n },\n ],\n modality: \"text\",\n id: \"conversation1\",\n language: \"en\",\n },\n ],\n },\n tasks: [\n {\n taskName: \"analyze 1\",\n kind: \"ConversationalSummarizationTask\",\n parameters: {\n summaryAspects: [\"Issue, Resolution\"],\n },\n },\n ],\n });\n const message = await poller.pollUntilDone();\n // Assert main object\n assert.equal(message.status, \"succeeded\");\n\n // Assert task result\n if (\n message.tasks.items === undefined ||\n message.tasks.items[0].kind !== \"conversationalSummarizationResults\"\n ) {\n assert.fail(\"Expected a Conversational Summarization result\");\n }\n\n const task_result = message.tasks.items[0];\n assert.equal(task_result.status, \"succeeded\");\n\n // Assert Conversation Result\n const conversation_result = task_result.results.conversations[0];\n assert.exists(conversation_result.summaries);\n });\n });\n });\n});\n"]}
1
+ {"version":3,"file":"analyze.spec.js","sourceRoot":"","sources":["../../../test/public/analyze.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAY,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEj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K,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,oCAAoC,EACpE;oBACA,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;iBAC/D;gBAED,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC3C,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;gBAE9C,6BAA6B;gBAC7B,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;gBACjE,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AuthMethod, createClient, startRecorder } from \"./utils/recordedClient\";\nimport { Context, Suite } from \"mocha\";\nimport { assert, matrix } from \"@azure/test-utils\";\nimport { ConversationAnalysisClient } from \"../../src\";\nimport { Recorder, assertEnvironmentVariable } from \"@azure-tools/test-recorder\";\n\nmatrix([[\"APIKey\"]] as const, async (authMethod: AuthMethod) => {\n describe(`[${authMethod}] ConversationAnalysisClient`, function (this: Suite) {\n let recorder: Recorder;\n let client: ConversationAnalysisClient;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this.currentTest);\n client = createClient({\n authMethod,\n recorder,\n });\n });\n\n afterEach(async function () {\n await recorder.stop();\n });\n\n describe(\"#sync\", function () {\n it(\"Test Conversation App\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_CLU_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_CLU_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Conversation\") {\n assert.fail(\"Expected a Conversation prediction\");\n }\n // Assert top intent\n assert.equal(message.result.prediction.topIntent, \"Send\");\n assert.isAtLeast(message.result.prediction.intents.length, 1);\n assert.equal(message.result.prediction.intents[0].category, \"Send\");\n assert.isAbove(message.result.prediction.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(message.result.prediction.entities.length, 1);\n assert.equal(message.result.prediction.entities[0].category, \"Contact\");\n assert.equal(message.result.prediction.entities[0].text, \"Carol\");\n assert.isAbove(message.result.prediction.entities[0].confidence, 0);\n });\n\n it(\"Test Orchestration App Conversational Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"EmailIntent\");\n assert.exists(message.result.prediction.intents.EmailIntent);\n const top_intent_object = message.result.prediction.intents.EmailIntent;\n\n if (\n top_intent_object.targetProjectKind !== \"Conversation\" ||\n top_intent_object.result?.prediction === undefined\n ) {\n assert.fail(\"Expected a Conversational response\");\n }\n // Assert intent\n const conversation_result = top_intent_object.result.prediction;\n assert.equal(conversation_result.topIntent, \"Send\");\n assert.isAtLeast(conversation_result.intents.length, 1);\n assert.equal(conversation_result.intents[0].category, \"Send\");\n assert.isAbove(conversation_result.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(conversation_result.entities.length, 1);\n assert.equal(conversation_result.entities[0].category, \"Contact\");\n assert.equal(conversation_result.entities[0].text, \"Carol\");\n assert.isAbove(conversation_result.entities[0].confidence, 0);\n });\n\n it.skip(\"Test Orchestration App LUIS Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"RestaurantIntent\");\n assert.exists(message.result.prediction.intents.RestaurantIntent);\n const top_intent_object = message.result.prediction.intents.RestaurantIntent;\n assert.equal(top_intent_object.targetProjectKind, \"Luis\");\n\n // Assert intent\n if (\n top_intent_object.targetProjectKind !== \"Luis\" ||\n top_intent_object.result?.prediction === undefined\n ) {\n assert.fail(\"Expected a LUIS response\");\n }\n const luis_result = top_intent_object.result.prediction;\n assert.equal(luis_result.topIntent, \"Reserve\");\n assert.isAtLeast(luis_result.intents.length, 1);\n assert.isAbove(luis_result.intents[0].confidence, 0);\n\n // Assert entities\n assert.isAtLeast(luis_result.entities.length, 1);\n });\n\n it(\"Test Orchestration App QnA Response\", async function () {\n const message = await client.analyzeConversation({\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: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_PROJECT_NAME\"),\n deploymentName: assertEnvironmentVariable(\"LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME\"),\n verbose: true,\n isLoggingEnabled: false,\n },\n });\n // Assert prediction type\n assert.equal(message.kind, \"ConversationResult\");\n assert.exists(message.result.query);\n if (message.result.prediction.projectKind !== \"Orchestration\") {\n assert.fail(\"Expected an Orchestration prediction\");\n }\n\n // Assert top matching project\n assert.equal(message.result.prediction.topIntent, \"ChitChat-QnA\");\n assert.exists(message.result.prediction.intents[\"ChitChat-QnA\"]);\n const top_intent_object = message.result.prediction.intents[\"ChitChat-QnA\"];\n assert.equal(top_intent_object.targetProjectKind, \"QuestionAnswering\");\n\n // Assert intent\n if (\n top_intent_object.targetProjectKind !== \"QuestionAnswering\" ||\n top_intent_object.result?.answers === undefined\n ) {\n assert.fail(\"Expected a QnA response\");\n }\n assert.exists(top_intent_object.result.answers[0].answer);\n assert.isAbove(top_intent_object.result.answers[0].confidence || 0, 0);\n });\n });\n\n describe(\"#async\", function () {\n it(\"Test Conversation App PII transcript\", async function () {\n const poller = await client.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 message = await poller.pollUntilDone();\n // Assert main object\n assert.equal(message.status, \"succeeded\");\n\n // Assert task result\n if (\n message.tasks.items === undefined ||\n message.tasks.items[0].kind !== \"conversationalPIIResults\"\n ) {\n assert.fail(\"Expected a Conversational PII result\");\n }\n\n const task_result = message.tasks.items[0];\n assert.equal(task_result.status, \"succeeded\");\n assert.equal(task_result.kind, \"conversationalPIIResults\");\n\n // Assert Conversation Result\n const conversation_items = task_result.results.conversations[0].conversationItems;\n assert.exists(conversation_items);\n conversation_items.forEach((conversation) => {\n assert.exists(conversation.redactedContent);\n assert.exists(conversation.entities);\n });\n });\n\n it(\"Test Conversation Summarization App\", async function () {\n const poller = await client.beginConversationAnalysis({\n displayName: \"Analyze conversations from xxx\",\n analysisInput: {\n conversations: [\n {\n conversationItems: [\n {\n text: \"Hello, how can I help you?\",\n modality: \"text\",\n id: \"1\",\n participantId: \"Agent\",\n },\n {\n text: \"How to upgrade Office? I am getting error messages the whole day.\",\n modality: \"text\",\n id: \"2\",\n participantId: \"Customer\",\n },\n {\n text: \"Press the upgrade button please. Then sign in and follow the instructions.\",\n modality: \"text\",\n id: \"3\",\n participantId: \"Agent\",\n },\n ],\n modality: \"text\",\n id: \"conversation1\",\n language: \"en\",\n },\n ],\n },\n tasks: [\n {\n taskName: \"analyze 1\",\n kind: \"ConversationalSummarizationTask\",\n parameters: {\n summaryAspects: [\"Issue, Resolution\"],\n },\n },\n ],\n });\n const message = await poller.pollUntilDone();\n // Assert main object\n assert.equal(message.status, \"succeeded\");\n\n // Assert task result\n if (\n message.tasks.items === undefined ||\n message.tasks.items[0].kind !== \"conversationalSummarizationResults\"\n ) {\n assert.fail(\"Expected a Conversational Summarization result\");\n }\n\n const task_result = message.tasks.items[0];\n assert.equal(task_result.status, \"succeeded\");\n\n // Assert Conversation Result\n const conversation_result = task_result.results.conversations[0];\n assert.exists(conversation_result.summaries);\n });\n });\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"recordedClient.js","sourceRoot":"","sources":["../../../../test/public/utils/recordedClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,0BAA0B,EAA+B,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,QAAQ,EAER,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,mBAAmB,GAA4B;IACnD,gBAAgB,EAAE,WAAW;IAC7B,iBAAiB;IACjB,oBAAoB,EAAE,WAAW;IACjC,QAAQ,EAAE,kBAAkB;IAC5B,yBAAyB,EAAE,gBAAgB;IAC3C,4BAA4B,EAAE,mBAAmB;IACjD,mCAAmC,EAAE,gBAAgB;IACrD,sCAAsC,EAAE,mBAAmB;CAC5D,CAAC;AAEF,MAAM,oBAAoB,GAAyB;IACjD,mBAAmB;CACpB,CAAC;AAIF,MAAM,UAAU,YAAY,CAAC,OAI5B;IACC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAC7D,MAAM,QAAQ,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IAEjG,QAAQ,UAAU,EAAE;QAClB,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,IAAI,0BAA0B,CACnC,QAAQ,EACR,IAAI,kBAAkB,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAC,EACrE,cAAc,CACf,CAAC;SACH;QACD,KAAK,KAAK,CAAC,CAAC;YACV,OAAO,IAAI,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,EAAE,cAAc,CAAC,CAAC;SACzF;QACD,KAAK,aAAa,CAAC,CAAC;YAClB,OAAO,IAAI,0BAA0B,CACnC,QAAQ,EACR,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAClC,cAAc,CACf,CAAC;SACH;QACD,OAAO,CAAC,CAAC;YACP,MAAM,KAAK,CAAC,sCAAsC,UAAU,EAAE,CAAC,CAAC;SACjE;KACF;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAkB;IACpD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC3C,MAAM,QAAQ,CAAC,UAAU,CAAC,sBAAsB,EAAE,EAAE,eAAe,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC5F,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ConversationAnalysisClient, ConversationAnalysisOptions } from \"../../../src/\";\nimport {\n Recorder,\n RecorderStartOptions,\n assertEnvironmentVariable,\n} from \"@azure-tools/test-recorder\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { Test } from \"mocha\";\nimport { createTestCredential } from \"@azure-tools/test-credential\";\n\nconst envSetupForPlayback: { [k: string]: string } = {\n LANGUAGE_API_KEY: \"sanitized\",\n // Second API key\n LANGUAGE_API_KEY_ALT: \"sanitized\",\n ENDPOINT: \"https://endpoint\",\n LANGUAGE_CLU_PROJECT_NAME: \"<project-name>\",\n LANGUAGE_CLU_DEPLOYMENT_NAME: \"<deployment-name>\",\n LANGUAGE_ORCHESTRATION_PROJECT_NAME: \"<project-name>\",\n LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME: \"<deployment-name>\",\n};\n\nconst recorderStartOptions: RecorderStartOptions = {\n envSetupForPlayback,\n};\n\nexport type AuthMethod = \"APIKey\" | \"AAD\" | \"DummyAPIKey\";\n\nexport function createClient(options: {\n authMethod: AuthMethod;\n recorder?: Recorder;\n clientOptions?: ConversationAnalysisOptions;\n}): ConversationAnalysisClient {\n const { authMethod, recorder, clientOptions = {} } = options;\n const endpoint = assertEnvironmentVariable(\"ENDPOINT\");\n const updatedOptions = recorder ? recorder.configureClientOptions(clientOptions) : clientOptions;\n\n switch (authMethod) {\n case \"APIKey\": {\n return new ConversationAnalysisClient(\n endpoint,\n new AzureKeyCredential(assertEnvironmentVariable(\"LANGUAGE_API_KEY\")),\n updatedOptions\n );\n }\n case \"AAD\": {\n return new ConversationAnalysisClient(endpoint, createTestCredential(), updatedOptions);\n }\n case \"DummyAPIKey\": {\n return new ConversationAnalysisClient(\n endpoint,\n new AzureKeyCredential(\"whatever\"),\n updatedOptions\n );\n }\n default: {\n throw Error(`Unsupported authentication method: ${authMethod}`);\n }\n }\n}\n\n/**\n * starts the recorder and reads the environment variables from the `.env` file.\n * Should be called first in the test suite to make sure environment variables are\n * read before they are being used.\n */\nexport async function startRecorder(currentTest?: Test): Promise<Recorder> {\n const recorder = new Recorder(currentTest);\n await recorder.start(recorderStartOptions);\n await recorder.setMatcher(\"CustomDefaultMatcher\", { excludedHeaders: [\"Accept-Language\"] });\n return recorder;\n}\n"]}
1
+ {"version":3,"file":"recordedClient.js","sourceRoot":"","sources":["../../../../test/public/utils/recordedClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,0BAA0B,EAA+B,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,QAAQ,EAER,yBAAyB,GAC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AAU,EAAE,CAAC,CAAC;SACjE;KACF;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAkB;IACpD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC3C,MAAM,QAAQ,CAAC,UAAU,CAAC,sBAAsB,EAAE,EAAE,eAAe,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC5F,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ConversationAnalysisClient, ConversationAnalysisOptions } from \"../../../src/\";\nimport {\n Recorder,\n RecorderStartOptions,\n assertEnvironmentVariable,\n} from \"@azure-tools/test-recorder\";\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { Test } from \"mocha\";\nimport { createTestCredential } from \"@azure-tools/test-credential\";\n\nconst envSetupForPlayback: { [k: string]: string } = {\n LANGUAGE_API_KEY: \"sanitized\",\n // Second API key\n LANGUAGE_API_KEY_ALT: \"sanitized\",\n ENDPOINT: \"https://endpoint\",\n LANGUAGE_CLU_PROJECT_NAME: \"<project-name>\",\n LANGUAGE_CLU_DEPLOYMENT_NAME: \"<deployment-name>\",\n LANGUAGE_ORCHESTRATION_PROJECT_NAME: \"<project-name>\",\n LANGUAGE_ORCHESTRATION_DEPLOYMENT_NAME: \"<deployment-name>\",\n};\n\nconst recorderStartOptions: RecorderStartOptions = {\n envSetupForPlayback,\n};\n\nexport type AuthMethod = \"APIKey\" | \"AAD\" | \"DummyAPIKey\";\n\nexport function createClient(options: {\n authMethod: AuthMethod;\n recorder?: Recorder;\n clientOptions?: ConversationAnalysisOptions;\n}): ConversationAnalysisClient {\n const { authMethod, recorder, clientOptions = {} } = options;\n const endpoint = assertEnvironmentVariable(\"ENDPOINT\");\n const updatedOptions = recorder ? recorder.configureClientOptions(clientOptions) : clientOptions;\n\n switch (authMethod) {\n case \"APIKey\": {\n return new ConversationAnalysisClient(\n endpoint,\n new AzureKeyCredential(assertEnvironmentVariable(\"LANGUAGE_API_KEY\")),\n updatedOptions,\n );\n }\n case \"AAD\": {\n return new ConversationAnalysisClient(endpoint, createTestCredential(), updatedOptions);\n }\n case \"DummyAPIKey\": {\n return new ConversationAnalysisClient(\n endpoint,\n new AzureKeyCredential(\"whatever\"),\n updatedOptions,\n );\n }\n default: {\n throw Error(`Unsupported authentication method: ${authMethod}`);\n }\n }\n}\n\n/**\n * starts the recorder and reads the environment variables from the `.env` file.\n * Should be called first in the test suite to make sure environment variables are\n * read before they are being used.\n */\nexport async function startRecorder(currentTest?: Test): Promise<Recorder> {\n const recorder = new Recorder(currentTest);\n await recorder.start(recorderStartOptions);\n await recorder.setMatcher(\"CustomDefaultMatcher\", { excludedHeaders: [\"Accept-Language\"] });\n return recorder;\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "An isomorphic client library for the Azure Conversational Language Understanding service.",
6
- "version": "1.0.0-alpha.20240109.1",
6
+ "version": "1.0.0-alpha.20240112.1",
7
7
  "engines": {
8
8
  "node": ">=18.0.0"
9
9
  },
@@ -59,7 +59,6 @@
59
59
  "karma-source-map-support": "~1.4.0",
60
60
  "mocha": "^10.0.0",
61
61
  "c8": "^8.0.0",
62
- "prettier": "^2.5.1",
63
62
  "sinon": "^17.0.0",
64
63
  "source-map-support": "^0.5.9",
65
64
  "ts-node": "^10.0.0",
@@ -99,11 +98,11 @@
99
98
  "build:test": "tsc -p . && dev-tool run bundle",
100
99
  "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
101
100
  "build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
102
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
101
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
103
102
  "clean": "rimraf dist dist-* temp types *.tgz *.log",
104
103
  "execute:samples": "dev-tool samples run samples-dev",
105
104
  "extract-api": "tsc -p . && api-extractor run --local",
106
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
105
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
107
106
  "integration-test:browser": "dev-tool run test:browser",
108
107
  "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 \"dist-esm/test/**/*.spec.js\"",
109
108
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",