I need help here, I've been trying to look for a solution for this without any progress. I am connecting botpress and stackAI and I want to capture the response given by stackAI in botpress. The user question is in a variabe called workflow.userQuestion and the response from stackAI is supposed to be stored in a variable called workflow.stackAIRespose. After starting the conversation and sending the user question, I do not get any response from stack AI. However on checking stack AI, it received the questio and generated the response. Could someone please help out? This is my code on botpress; // Set the URL for StackAI
const url = "URL"
// Prepare the headers with your API key
const headers = {
Authorization: "...",
"Content-Type": "application/json"
}
// Prepare the data payload with user's question
const data = {
"in-0": workflow.userQuestion
}
// Send a POST request to StackAI using Axios
const response = await axios.post(url, data, { headers })
// Check if the response status is successful (200)
if (response.status === 200) {
// Extract the AI-generated response from the response data
workflow.stackAIResponse = _.get(response, "data.out-0", "")
}