Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MuhammadAshraff opened this issue Sep 28, 2017 · 1 comment
Open

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

MuhammadAshraff opened this issue Sep 28, 2017 · 1 comment

Comments

@MuhammadAshraff
Copy link

MuhammadAshraff commented Sep 28, 2017

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]);"

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

  2. 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
Copy link

AlaGarali commented Jul 11, 2018

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants