desmarchris / docs-bot

Conversation bot using Discovery for long tail questions about Watson Conversation
9 stars 8 forks source link

Discovery is working weirdly, not as expected, help ! #2

Open MuhammadAshraff opened 7 years ago

MuhammadAshraff commented 7 years ago

Each time I call a certain query from the discovery, it displays this error message, any idea what's wrong ?

1) I've checked my JSON documents too, it's correct(followed by the template you gave)

2) Added intents and dialogs(e.g. intents[0].confidence>0.5) as well

3)It's working weirdly only when I change "resolve([data.results[0].title, data.results[0].text, data.results[0].url]);" TO "resolve(data.results[0]);"

4) By weirdly, I mean only the first result is relevant, and the second result is not.

5) Only received the error log(below) when I used "resolve([data.results[0].title, data.results[0].text, data.results[0].url]);"

Promise { '' } Promise { '' } C:\Users\L31303\Desktop\New\docs-bot-master\sendBoth.js:39 resolve([data.results[0].title, data.results[0].text, data.results[0].url]); ^

TypeError: Cannot read property 'title' of undefined at C:\Users\L31303\Desktop\New\docs-bot-master\sendBoth.js:39:41 at Request._callback (C:\Users\L31303\Desktop\New\docs-bot-master\node_modules\watson-develop er-cloud\lib\requestwrapper.js:108:5) at Request.self.callback (C:\Users\L31303\Desktop\New\docs-bot-master\node_modules\request\re quest.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (C:\Users\L31303\Desktop\New\docs-bot-master\node_modules\request\requ est.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip. (C:\Users\L31303\Desktop\New\docs-bot-master\node_modules\request\reque st.js:1091:12) at Gunzip.g (events.js:292:16)

AlaGarali commented 6 years ago

Dear @MuhammadAshraff ,

I fixed the error data.results[0].text by data.results.text but no result is shown as mentioned in this picture (result.text ==> UNDEFINED):

image1

This figure shows that, in the discovery service, the results.text variable is not NULL or Undefined

image2

Help me please ...