I have integrated Chatbase into a voice application, when the user says a certain "Intent", it will be send and logged in Chatbase.
However, while the messages are sending fine (they are returning 200 in the send callback) - there appears to be nothing in the Chatbase console. I have read saying things can take 6 hours - it has now been 24 hours and there is still nothing!
Here is my implementation:
function sendChatbaseMessage(ad, intent) {
Chatbase.setApiKey(process.env.MY_CHATBASE_ID)
.setPlatform('Alexa')
.setVersion('1.0')
.setAsTypeUser()
.newMessage()
.setTimestamp(Date.now().toString())
.setMessage(`STATE: ${ad.Session[SessionVars.SkillState]}`)
.setUserId(ad.Util.getUserId())
.setIntent(intent)
.setAsHandled()
.setCustomSessionId(ad.Util.getSessionId())
.send()
.then((data) => {
console.log("Chatbase message sent: ", data.getCreateResponse())
})
.catch((err) => {
console.log("Error sending chatbase message", prettifyJSON(err.stack))
})
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…