मैं Microsoft Cognitive Services एपीआई नोडजेज़ के लिए उपयोग कर रहा हूं। मैं कोडTypeError: cognitiveServices.face एक निर्माता नहीं है
const cognitiveServices = require('cognitive-services');
const face = new cognitiveServices.face({
API_KEY: yourApiKey
})
const parameters = {
returnFaceId: "true"
returnFaceLandmarks: "false"
};
const body = {
"url": "URL of input image"
};
face.detect({
parameters,
body
})
.then((response) => {
console.log('Got response', response);
})
.catch((err) => {
console.error('Encountered error making request:', err);
});
तथापि निम्नलिखित है, जब मैं निष्पादित इस कोड को मैं निम्नलिखित मिल त्रुटि
const face = new cognitiveServices.face({
^
TypeError: cognitiveServices.face is not a constructor
at Object.<anonymous> (/Users/..../face.js:3:14)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
मैं इस त्रुटि को कैसे हल कर सकते हैं?
आप एक बयान है कि मॉड्यूल के शीर्ष पर है, है ना की आवश्यकता है? क्या आप उस कथन को शामिल करने के लिए अपना प्रश्न संपादित कर सकते हैं? इसी प्रकार यह सत्यापित करना अच्छा होगा कि आपने स्थापना के अनुसार संज्ञानात्मक सेवाओं को सही ढंग से स्थापित किया है और https://github.com/joshbalfour/node-cognitive-services#installation पर चरणों को प्रारंभ करना है। – ArthurDenture
हां मेरे पास है और मैंने अपना प्रश्न अपडेट किया है। – 2619
हाय, क्या मेरे उत्तर आपके लिए काम करते थे? मैं देखता हूं कि बक्षीस अभी भी खुला है ... – ArthurDenture