Hello can anyone please tell me how to use the pre...
# 🤝help
r
I've been following the tutorial and it didn't work so please let me know how to access the template
f
Hey there, Could you link me to the template that you are talking about? Is it any of these https://botpress.com/hub?type=Template
Im trying a lot but it still shows error
f
Thank you. I can see that there are a lot of videos about the template. Have you followed all of them? If so, which part of which video gives you the error?
r
The third part. After adding the code for calling api it shows error occurred
f
Can you expand the error to see the full error message?
r
This is it
f
You should be able to find it in the logs
You can open the logs by hitting Ctrl + J on your keyboard
r
Is this what you're asking?
Any help would be appreciated bro. I'm trying to do a project for college
f
Exactly that. Based on the error message, it would seem like you haven't set your API Key
r
I have set my api key from the spoonacular website
f
Well you got a variable called myapikey that is not defined
I am guessing that should be your API key
r
That is the api key I got from that website
Yes
f
Have you set it like in video 3. In the configuration variable?
r
Yes
f
In your code. Are you using env.myapikey as your API key variable
r
No I changed it to myapikey
I read a comment on that video. So I did that
f
It should be env.myapikey
r
Ok wait let me try
f
Looks like you are also missing a variable called recipes with the workflow scope
r
Oh so what should I do
f
Create a variable called recipes, with the workflow scope
r
I'm sorry to ask this. But how do I do that
f
No worries 🙂
And then hit add, and you should be all set
r
How to reach this page?
f
Its just in your workflow
r
I. Got it
Ok wait let me try this
f
Sounds good! Let me know if it works
r
Bro. The third video part is working
But the fourth video part is not
This is the error it is showing @fresh-fireman-491
f
What is the code that is causing that
r
This is the code from the 4th video
I copied the code from the website
f
You are missing a lot of variables there
You should start out by fixing all of the things that is underlined by red
Looks like you need a variable called recipes with the scope workflow. Should be an object.
Create it the same way as before
But this time change it from String to Object
r
Oh
f
workflow.recipeInfo is also missing. This should be an array
r
I can't seem to add the recipes
f
What do you mean?
r
f
Ah yea ofc
You already have a variable called that
Find the variable that you created before
r
So delete the previous one?
f
Called recipes
And yea sure delete it
And then make a new
You can also hit edit
And then change the variable type
r
Ok yes on it
f
You also need to create an Object variable called cards, with the workflow scope
r
I should make this . The same way?
Should I type in workflow.recipeInfo or just recipeInfo
f
Just recipeInfo
r
Okay
Ok so I have added these three
Should I add push too?
f
No
r
Ok let me try. Again I'm really sorry to bother you with all these. Thanks a lot brother I really mean it.
f
Push is not a variable. Push adds a a new iten to the end of an array
You are not bothering me at all 🙂 Love helping
r
Thank you 😊
Hey. I'm not getting any errors but no recipe is showing up either @fresh-fireman-491
f
Well that is a good start. Can you try and search for one of the recipes that worked for Gordy in the videos. Make sure to word it exactly like he did. Just to see if it works
r
I tried beef stew . Just like he did and it didn't work 😞
And rice pudding
f
What can you see in the logs
Is there anything in there that you think could enlighten us on why its not working
r
Wait
No im not able to recognise that from the logs
Lemme show you
Is this of any help @fresh-fireman-491
f
Thank you Can you add console.log(response.data) console.log(response.data.results) Right below the workflow.recipes = response.data.results
r
Is there an = sign in between?
So should I add the variable?
Like this?
@fresh-fireman-491 are you there?
f
No
Like this
console.log(response.data) console.log(response.data.results)
New line each time
r
It is still showing the same
f
can you send a screenshot of the new code
r
f
Perfect
Can you now take a screenshot of the logs, with each of the logs expanded
r
Oke
Which all should I expand? @fresh-fireman-491
f
These 2
r
These are the expanded version of the first log
These are the second log @fresh-fireman-491
f
Looks like it did actually get something
r
oh but the results showed nothing
I exported the chatbot. Would this be of any help?
f
I can take a look at it tomorrow
r
Ok that's more than wonderful. Thanks a lot brother. I'll also head to sleep then. Thanks a lot for today . 😁😊😊😊
f
You are very welcome, and sleep well!
r
Did you take a look at it bro?
@fresh-fireman-491
f
Yes, You don't have to use the expression card with always as the label. Every node has a transition round thing at the end, which you can use instead.
There were some issues with the code snippets provided in the blog post.
All of the issues were resolved by watching his videos
r
Omg this works
Thanks a lot broo
I tried a lot but couldn't find the problem. You're really a life saver
So the bot is complete now? Or till the fourth video? @fresh-fireman-491
f
The main problems where in the part Code Snippet that appears in Video 4 to render recipe carousel First line should be workflow.recipeInfo = [] not workflow.recipes = [] 2nd line should be const myCards = workflow.recipes.map((recipe) => { not const myCards = workflow.recipeInfo.map((recipe) => { 3rd line should be workflow.recipeInfo.push({ not workflow.recipes.push({
I also changed some variable types
That is really up to you
You can develop further on it
r
yes im developing it further now. thanks a lot brother
f
That is great to hear and you are very welcome
r
Hey brother. I'm missing a lot of recipes on the spoonacular api. If I want to change it to another one, what should I do? @fresh-fireman-491
f
Another recipe API?
r
Yes
Yes
f
Looks like they have a good documentation https://developer.edamam.com/edamam-docs-recipe-api
Should be enough
r
Yes but how can I change it to this. Just change the apikey?
f
Nope. You will have to follow their documentation, and change multiple things. Their responses will most likely not be the same
r
Oh I will try it once I get home. Thank you
3 Views