https://discord.gg/botpress logo
How to use api as a knowldge Base
# 🤝help
m
I have this api endpoint which is fake https://6907a782b1879c890eda624d.mockapi.io/api/restaurant/restaurants so i need to make it as a knowledge base for my bot the data in this backend is as a json so how can i use it and without uploading any files. Thanks.
i need to use it inside the autonomous node to let the bot make inquery from api to the bot
@wide-umbrella-5226
w
just query the endpoint
and return whatever
m
I mean where i have to put the api?
I can make it inside excute card but this will lead the conversation end after it run i need the to make it as a knwoledge base to reply user from it
w
well you need a knowledge base for it to work
unless you have a knowledge base inside your endpoint then nothing is gonna happen
m
can you try this link https://6907a782b1879c890eda624d.mockapi.io/api/restaurant/restaurants it is a json there are lots of fake data restrunts foods prices name etc.. so can't i call this data from this api to the bot just to let but got to this endpoint and search if there is an answer from this api then tell user yes or no.
@wide-umbrella-5226 got it?
w
you can just get the entire payload body from the api response
and give it to a autonomous agent
or to a ai task block
m
My goal in making the query database via this endpoint is to ensure the link is constant so that if the data changes, I won't need to modify it through the bot; instead, it will update so that the query is only for the actual updated data.
How can i give the autuonmous node?
w
give it access to the variable
m
didn't understand.
w
the autonomous block has a button named "variables to access"
you give it access to the variable that has the endpoint response
m
But have you reied this way?
even if i stored the endpoint in variable how it is going to answer from it.?
w
youre not gonna store the endpoint in the variable bro
youre gonna get the json from the endpoint
m
But you don't tell me where i am going to put the api?
w
you're already doing it
in the execute code card
w
@User instead Execution card use an action
m
I can't use it inside autunomous
Can you give ma the way even as a keyword
what i should do?
w
m
now i stoped at a point which is after i got the quere from user the action will take the question so how can i serach inside action for the result i need
w
- Prompt the AN to use action calls. - Prompt the AN to use the results for searching
m
Can you explain more.
4 Views