{"_id":"@azure/cognitiveservices-qnamaker-runtime","_rev":"8-cb6ba91714d7b3857cb69b2e6030820f","name":"@azure/cognitiveservices-qnamaker-runtime","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@azure/cognitiveservices-qnamaker-runtime","version":"1.0.0","keywords":["node","azure","typescript","browser","isomorphic"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/cognitiveservices-qnamaker-runtime@1.0.0","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-qnamaker-runtime","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"bf9a9f6cf691ed8cfb53c378121e7e33e50c1549","tarball":"https://registry.npmjs.org/@azure/cognitiveservices-qnamaker-runtime/-/cognitiveservices-qnamaker-runtime-1.0.0.tgz","fileCount":49,"integrity":"sha512-ds4qiQoO/hO3W4eT6MPzJpe3Pjx81coaU1V8i8VJvMZHaSiLpKgND1pIRhMorTxApYC5KhohM/HX0G8zpu3WwA==","signatures":[{"sig":"MEUCIGevk+YbW37mTTojjeQ0Y+CMU/1UdWyZzaf9HLz88qZgAiEAnWpsWt6BqTJIL9EKiSx0uQj59lxaQ5zA4ToJKJEJ0Kc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":192533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO1IqCRA9TVsSAnZWagAA09gQAIlKci+/Ws4r/ElUSGoh\n1K0qwTEddy4zKoFXh/oirtx/oe+p/mveM3l2Crh3yWQG+EmdJJ0k3Zea2q+Z\n311vHADcClNqL3wmtPZLVaIk5EsfaJxAGZKSEnu2CSjRW6KWRxzmOr7JYNnk\ng29Tin657+yHWS4RtTg/YEi1b1bmjAAzCuxlIIwSAKkMVTq+7YTPa9tYcsrY\nMWIU4gX6GssB0+2j20wFTH6n+NL9rY77fu5brplGhJVcl8GYR59XuhlfvfiL\ngPXkiTCfAB0hyA0tCRvuS5RiC5A8X52gT6zonEzVwzMmXHXhDs9G78Lc//Uc\ngupWc0Z7f2oSRLQpoD+1T4MRpBe41L0r0EeumhLLrj6HNPlqcuCKRzZU1Yjw\n4jXF90UImT5cD20QkKBKjsDqdWezALSrSEPJ2ZcrCdflZ1J2yElYsfIabPmz\nW30OBGOs5GbKdQ1TowcWih9kptrcigaWxnJ6CgKC8epzmN5QIA6QNpfnrRTl\nYm82+4TOP32a98Ha3krYKhOCIUzWyAC1yveKdPnr3oF5UKOVyo1lZeigHrmm\nfI/9CPTPNSfsrFA4nv4jMlqVu8FDIdZ/SlY8x40HxaZ9MpJmCxjelwNl3siz\n2iXbDg/sdipUQSXx6s9KSTFZDVmEjfZNevXfaqmJd5zy7UhArUFz4u/9tl2j\nVZib\r\n=d7k5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cognitiveservices-qnamaker-runtime.js","_from":"file:/home/vsts/work/r1/a/_js - mgmt - ci/drop/azure-cognitiveservices-qnamaker-runtime-1.0.0.tgz","types":"./esm/qnAMakerRuntimeClient.d.ts","module":"./esm/qnAMakerRuntimeClient.js","scripts":{"build":"tsc && rollup -c rollup.config.js && npm run minify","minify":"uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-qnamaker-runtime.js.map'\" -o ./dist/cognitiveservices-qnamaker-runtime.min.js ./dist/cognitiveservices-qnamaker-runtime.js","prepack":"npm install && npm run build"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"_resolved":"","_integrity":"","deprecated":"The QnA Maker service is being retired on the 31st of March, 2025. A newer version of the question and answering capability is now available as part of Azure Cognitive Service for Language. For information on migrating existing QnA Maker knowledge bases to question answering, consult the migration guide: https://learn.microsoft.com/azure/cognitive-services/language-service/question-answering/how-to/migrate-qnamaker","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.13.4","autoPublish":true,"description":"QnAMakerRuntimeClient Library with typescript type definitions for node.js and browser.","directories":{},"sideEffects":false,"_nodeVersion":"10.18.1","dependencies":{"tslib":"^1.10.0","@azure/ms-rest-js":"^2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^1.18.0","uglify-js":"^3.6.0","typescript":"^3.5.3","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/cognitiveservices-qnamaker-runtime_1.0.0_1580945962234_0.1435259133287896","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@azure/cognitiveservices-qnamaker-runtime","version":"1.0.1","keywords":["node","azure","typescript","browser","isomorphic"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/cognitiveservices-qnamaker-runtime@1.0.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-qnamaker-runtime","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"e4d2ed3cf1a1257c6f1da5680bde718c10be8ac7","tarball":"https://registry.npmjs.org/@azure/cognitiveservices-qnamaker-runtime/-/cognitiveservices-qnamaker-runtime-1.0.1.tgz","fileCount":49,"integrity":"sha512-J3NM4OV1tCqvT6qGjHHMStRNjpuuvfn7A8gp5zubiWHi0h1j/waSQ+r7rcFJG3u+whQr04JpLLAStQln2Ar5Xg==","signatures":[{"sig":"MEUCIQCnypK5LxVdmlLXHMELwNXBtOaGk5Vvq0HDltwxRhvxGwIgVJwIKNuBPW1xNpbbsawyU8o+PKnMI+DU92BaqBAZxI8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":193487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMYnbCRA9TVsSAnZWagAAeLQP/icV3n5rWipNmeaz3SWB\nBdDd+nEMXpRuHBTo5RdsrSli76Q4INeck41EjUQLFSjV1F9baEVDB8LWAxZj\nIedrKDVPV84TcQ7F0zJY1x2CHQbYcaARI+MKJIvdDUueVlzcl14ctFYgauhL\nfpyr6pOO52QW+JV9QpzEtPaRyT+vdpFZl4NzEdtLiz8NEY3sRian2i2e2GFj\n2HlA6vb25tRWHllT25d1CMo7obljst/h3oPXwsMHhooupO2vCpTeOvFdfxAo\nHcLO4YD/yTWeGWy5JCPiiECe6xN0koT3hbQ8UJcRtxyEyUaysJj5Fgar9Lzo\nz7KwLg08iSoibxciumUWXu7RPcmQvP35kr+JfLj5phAQ/D3BYpsf0VNsylME\nM+yQQqzFIBGroUhHc3On4UNOY1YX7S5t7zZkEViwP1NMf5HD/0Fna0RR9ctV\nT4wbvHj4gDSNg0bOUB6HXHJ3KCKGX+nrNXFLSJ9P0sBlhuubaSm1QfkFB5rc\niYVcOWpOM7xE9dnkITjFgsYV84sc/Wzl+ffHI+BRfSP6/p7EIctzxXQHn+Du\nnRaPB/MQSIZmYp+a3PYvYN9MtKealo7NOnUNBzhBVx+nbQQ/LibyRcRh/VbS\nhNG2hWoKgXzR9aNprR09irVgF8lhYybjevt7HFuoa7I069kZC+rGpuUcZAtL\n7Ia3\r\n=YAt+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cognitiveservices-qnamaker-runtime.js","_from":"file:/home/vsts/work/r1/a/_js - mgmt - ci/drop/azure-cognitiveservices-qnamaker-runtime-1.0.1.tgz","types":"./esm/qnAMakerRuntimeClient.d.ts","module":"./esm/qnAMakerRuntimeClient.js","scripts":{"build":"tsc && rollup -c rollup.config.js && npm run minify","minify":"uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-qnamaker-runtime.js.map'\" -o ./dist/cognitiveservices-qnamaker-runtime.min.js ./dist/cognitiveservices-qnamaker-runtime.js","prepack":"npm install && npm run build"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"_resolved":"","_integrity":"","deprecated":"The QnA Maker service is being retired on the 31st of March, 2025. A newer version of the question and answering capability is now available as part of Azure Cognitive Service for Language. For information on migrating existing QnA Maker knowledge bases to question answering, consult the migration guide: https://learn.microsoft.com/azure/cognitive-services/language-service/question-answering/how-to/migrate-qnamaker","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.6","autoPublish":true,"description":"QnAMakerRuntimeClient Library with typescript type definitions for node.js and browser.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.10.0","@azure/ms-rest-js":"^2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^1.18.0","uglify-js":"^3.6.0","typescript":"^3.5.3","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/cognitiveservices-qnamaker-runtime_1.0.1_1597082074869_0.8005883681700843","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-02-05T23:39:22.016Z","modified":"2026-03-19T19:50:26.335Z","1.0.0":"2020-02-05T23:39:22.393Z","1.0.1":"2020-08-10T17:54:35.069Z"},"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-qnamaker-runtime","keywords":["node","azure","typescript","browser","isomorphic"],"repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"description":"QnAMakerRuntimeClient Library with typescript type definitions for node.js and browser.","maintainers":[{"email":"azure-sdk-npmjs@microsoft.com","name":"azure-sdk"},{"email":"npmjs@microsoft.com","name":"microsoft1es"},{"email":"microsoft-oss-publishing@microsoft.com","name":"microsoft-oss-releases"}],"readme":"## An isomorphic javascript sdk for - QnAMakerRuntimeClient\n\nThis package contains an isomorphic SDK for interacting with the QnA Maker service such as training and asking questions.\nFor editing and creating Knowledge Bases see @azure/cognitiveservices-qnamaker.\n\n### Currently supported environments\n\n- Node.js version 6.x.x or higher\n- Browser JavaScript\n\n### How to Install\n\n```bash\nnpm install @azure/cognitiveservices-qnamaker-runtime\n```\n\n### How to use\n\n#### nodejs - Authentication, client creation and generateAnswer runtime as an example written in TypeScript.\n\n##### Install @azure/ms-rest-azure-js\n\n```bash\nnpm install @azure/ms-rest-azure-js\n```\n\n##### Sample code\n\n```javascript\nconst { QnAMakerRuntimeClient } = require(\"@azure/cognitiveservices-qnamaker-runtime\");\nconst { CognitiveServicesCredentials } = require(\"@azure/ms-rest-azure-js\");\n\nasync function main() {\n  const QNAMAKER_KEY = process.env[\"QNAMAKER_KEY\"] || \"<QNAMAKER_KEY>\";\n  const QNAMAKER_ENDPOINT = process.env[\"QNAMAKER_ENDPOINT\"] || \"<QNAMAKER_ENDPOINT>\";\n  const kbid = process.env[\"QNAMAKER_KNOWLEDGE_BASE_ID\"] || \"<QNAMAKER_KNOWLEDGE_BASE_ID>\";\n\n  const cognitiveServicesCredentials = new CognitiveServicesCredentials(QNAMAKER_KEY);\n  const client = new QnAMakerRuntimeClient(cognitiveServicesCredentials, QNAMAKER_ENDPOINT);\n  const customHeaders = { Authorization: `EndpointKey ${QNAMAKER_KEY}` };\n\n  // A question you'd like to get a response for, from the knowledge base. For example\n  const question = \"How are you?\";\n\n  // Maximum number of answer to retreive\n  const top = 1;\n\n  // Find only answers that contain these metadata\n  const strictFilters = [{ name: \"editorial\", value: \"chitchat\" }];\n\n  const result = await client.runtime.generateAnswer(\n    kbid,\n    { question, top, strictFilters },\n    { customHeaders }\n  );\n  console.log(JSON.stringify(result));\n  // Sample Result\n  // {\n  //   answers: [\n  //     {\n  //       questions: [\n  //         \"How are you?\",\n  //         \"How is your tuesday?\"\n  //       ],\n  //       answer:\n  //         \"\"I'm doing great, thanks for asking!\",\n  //       score: 100,\n  //       id: 90,\n  //       source:\n  //         \"qna_chitchat_Friendly.tsv\",\n  //       metadata: [{ name: \"editorial\", value: \"chitchat\" }],\n  //       context: { isContextOnly: false, prompts: [] }\n  //     }\n  //   ],\n  //   debugInfo: null,\n  //   activeLearningEnabled: false\n  // }\n}\n\nmain();\n```\n\n#### browser - Authentication, client creation and generateAnswer runtime  as an example written in JavaScript.\n\n##### Sample code\n\n- index.html\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>@azure/cognitiveservices-qnamaker-runtime sample</title>\n    <script src=\"node_modules/@azure/ms-rest-js/dist/msRest.browser.js\"></script>\n    <script src=\"node_modules/@azure/cognitiveservices-qnamaker-runtime/dist/cognitiveservices-qnamaker-runtime.js\"></script>\n    <script type=\"text/javascript\">\n      const QNAMAKER_KEY = \"<QNAMAKER_KEY>\";\n      const QNAMAKER_ENDPOINT = \"<QNAMAKER_ENDPOINT>\";\n      const kbid = \"<QNAMAKER_KNOWLEDGE_BASE_ID>\";\n\n      const cognitiveServiceCredentials = new msRest.ApiKeyCredentials({\n        inHeader: {\n          \"Ocp-Apim-Subscription-Key\": QNAMAKER_KEY\n        }\n      });\n\n      const client = new Azure.CognitiveservicesQnamakerRuntime.QnAMakerRuntimeClient(\n        cognitiveServiceCredentials,\n        QNAMAKER_ENDPOINT\n      );\n      const customHeaders = { Authorization: `EndpointKey ${QNAMAKER_KEY}` };\n\n      // A question you'd like to get a response for, from the knowledge base. For example\n      const question = \"How are you?\";\n\n      // Maximum number of answer to retreive\n      const topValue = 1;\n\n      // Find only answers that contain these metadata\n      const strictFilters = [{\n        name: \"editorial\",\n        value: \"chitchat\"\n      }];\n\n      client.runtime\n        .generateAnswer(kbid, {question, topValue, strictFilters}, {customHeaders})\n        .then(result => {\n          console.log(JSON.stringify(result));\n          // Sample Result\n          // {\n          //   answers: [\n          //     {\n          //       questions: [\n          //         \"How are you?\",\n          //         \"How is your tuesday?\"\n          //       ],\n          //       answer:\n          //         \"\"I'm doing great, thanks for asking!\",\n          //       score: 100,\n          //       id: 90,\n          //       source:\n          //         \"qna_chitchat_Friendly.tsv\",\n          //       metadata: [{ name: \"editorial\", value: \"chitchat\" }],\n          //       context: { isContextOnly: false, prompts: [] }\n          //     }\n          //   ],\n          //   debugInfo: null,\n          //   activeLearningEnabled: false\n          // }\n        })\n        .catch(err => {\n          console.log(\"An error occurred:\");\n          console.error(err);\n        });\n    </script>\n  </head>\n  <body></body>\n</html>\n```\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/README.png)\n","readmeFilename":"README.md"}