ibmtjbot / tjbot

IBM TJBot
https://ibmtjbot.github.io
Apache License 2.0
481 stars 282 forks source link

error creating session for assistant service / Resource not found / 404 #219

Closed BzowK closed 6 months ago

BzowK commented 1 year ago

Hey All -

Followed the instructions to set everything up (as best I could - they were wildly outdated) and when executing "sudo node conversation.js" everything starts correctly and correctly types the command I speak however once one is recognized, it errors out. Below is the error, my config, and what I've tried (which includes potential solutions from other similar issues.)

The Error info: Hello from TJBot! info: Initializing TJBot with microphone,speaker,led_neopixel,servo You can ask me to introduce myself or tell you a joke. Try saying, "Johnny Five, please introduce yourself" or "Johnny Five, what can you do?" You can also say, "Johnny Five, tell me a joke!" Say 'stop' or press ctrl-c to exit this recipe. info: TJBot heard: "tell me a joke" info: TJBot heard: "Johnny five tell me a joke" error: error creating session for assistant service. please check that tj.configuration.converse.assistantId is defined. /home/pi/tjbot/recipes/conversation/node_modules/ibm-cloud-sdk-core/lib/request-wrapper.js:224 var error = new Error(); ^

Not Found: Resource not found at RequestWrapper.formatError (/home/pi/tjbot/recipes/conversation/node_modules/ibm-cloud-sdk-core/lib/request-wrapper.js:224:21) at /home/pi/tjbot/recipes/conversation/node_modules/ibm-cloud-sdk-core/lib/request-wrapper.js:212:25 at processTicksAndRejections (node:internal/process/task_queues:94:5) { statusText: 'Not Found', status: 404, code: 404, body: '{"error":"Resource not found","code":404}', headers: { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS', 'access-control-allow-headers': 'Content-Type, Content-Length, Authorization, X-Watson-Authorization-Token, xxxxxxxxxxxxxx-OUT, X-Watson-UserInfo, X-Watson-Learning-Opt-Out, X-Watson-Metadata', 'access-control-max-age': '3600', 'content-security-policy': "default-src 'none'", 'x-dns-prefetch-control': 'off', 'x-frame-options': 'SAMEORIGIN', 'strict-transport-security': 'max-age=15552000; includeSubDomains, max-age=31536000; includeSubDomains;', 'x-download-options': 'noopen', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'content-type': 'application/json; charset=utf-8', 'content-length': '41', 'x-dp-watson-tran-id': 'xxxxxxxxxxxxxx', 'x-request-id': 'xxxxxxxxxxxxxx', 'x-global-transaction-id': 'xxxxxxxxxxxxxx', server: 'watson-gateway', 'x-edgeconnect-midmile-rtt': '18', 'x-edgeconnect-origin-mex-latency': '37', date: 'Wed, 08 Feb 2023 17:21:54 GMT', connection: 'close' } }

My Setup config.js

export default {
    assistantId: 'xxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx', // add your assistant id from Watson Assistant
    hasCamera: false, // set this to false if your TJBot doesn't have a camera
    robotName: 'Johnny Five', // set this to the name you wish to use to address your tjbot!
};

ibm-credentials.env

ASSISTANT_APIKEY=lSpa4QzaS8YgRbojBSEMlngviSmKO-xxxxxxxxxx
ASSISTANT_IAM_APIKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ASSISTANT_URL=https://api.us-east.assistant.watson.cloud.ibm.com/instances/xxxxxxxxxxxxxxxxxxxxx
ASSISTANT_AUTH_TYPE=
SPEECH_TO_TEXT_APIKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SPEECH_TO_TEXT_IAM_APIKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SPEECH_TO_TEXT_URL=https://api.us-east.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxxxxxxxxxxxxxxx
SPEECH_TO_TEXT_AUTH_TYPE=
TEXT_TO_SPEECH_APIKEY=xxxxxxxxxxxxxx_xxxxxxxxx
TEXT_TO_SPEECH_IAM_APIKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TEXT_TO_SPEECH_URL=https://api.us-east.text-to-speech.watson.cloud.ibm.com/instances/xxxxxxxxxxxxxxxxxxxxx
TEXT_TO_SPEECH_AUTH_TYPE=
VISUAL_RECOGNITION_APIKEY=
VISUAL_RECOGNITION_IAM_APIKEY=
VISUAL_RECOGNITION_URL=
VISUAL_RECOGNITION_AUTH_TYPE=

What I've Tried

Thanks Guys!

cmaciel commented 1 year ago

Hello BzowK. We are actually in the process of updating the code and instructions. As you mentioned, there are information that is outdated, code that does not work anymore, and we are working on this. Feel free to check back again in the near future.

cmaciel commented 1 year ago

Also, you may want to remove your API credentials from this post, since this is open for everyone to see.

BzowK commented 1 year ago

Thanks - I changed the ending part of them but will blank them all out just in case. Appreciate it!

StarkMaximus333 commented 1 year ago

hey, i am getting the same error

modcarroll commented 6 months ago

Closing as outdated