can someone please explain how to use the 'execute...
# 🌎general
c
can someone please explain how to use the 'execute code' card? I have no clue
e
Hey @calm-advantage-14138 check out the docs at https://botpress.com/docs/cloud/toolbox/execute-code/
You can use code cards to do virtually anything. Let me know if you need assistance!
c
thanks. im still just not sure how to set it up, especially if I were to try to link a knowledge base from stack ai. I'm trying to follow along with liam's examples in his templates but its not making any sense for the new bots im trying to build. I guess what im trying to say is i dont know how he's generating that code for his specific bots
thanks. im still just not sure how to set it up, especially if I were to try to link a knowledge base from stack ai. I'm trying to follow along with liam's examples in his templates but its not making any sense for the new bots im trying to build. I guess what im trying to say is i dont know how he's generating that code for his specific bots
e
Hey @calm-advantage-14138, if you want to use Stack AI, you need to learn how to make requests and get responses. Check out their docs at https://docs.stack-ai.com/stack-ai/
Sometimes you can generate code entirely with labels, but you usually have to write your own
But a request to Stack Ai would go somewhat like this:
Copy code
js
const response = await axios.get("https://stackai.com/your-knowledge-base", {
  headers: {
    "api-key": "your-api-key-to-connect"
  }
})

workflow.someVariable = response.data.information
You are making a request to Stack AI server and then passing the responde to some variable