bitter-lighter-20858
08/19/2023, 5:59 PMhttps://cdn.discordapp.com/attachments/1142518248760426507/1142518249511194698/image1.png▾
https://cdn.discordapp.com/attachments/1142518248760426507/1142518250270376057/image.png▾
bumpy-addition-21507
08/19/2023, 6:35 PMconst endpoint = "YOUR_STACK_AI_ENDPOINT_URL"
const headers = {
Authorization: `Bearer ${stackAiapiKey}`
}
//save the user's question or send event.preview
const data = {
"in-0": workflow.question,
}
try {
const response = await axios.post(endpoint, data, { headers })
workflow.apiResponse = response.data["out-0"]
} catch (error) {
throw new Error(`stack-error: ${error}`)
}
bitter-lighter-20858
08/20/2023, 6:54 AMBearer ${stackAiapiKey}
to:
Authorization: Bearer ${stackAiapiKey}
, 'Content-Type': 'application/json'
and that works!
else I have test once again my code and it finally work modifing that line:
{ [inNode]: ${event.preview} },
by that line:
{ "int-0": ${event.preview} },