Opener
Who even knows how to start a conversation anymore
carter-js
provides an opener
function which makes use of Carter's opener endpoint. It allows you to begin a conversation without an initial input.
// Assuming you have created a Carter object called carter
const response = await carter.opener('your_player_id', speak) // both optional
if (response.ok) {
console.log(response.data.sentence)
}
The response object is identical to a regular CarterInteraction
, except it doesn't include forced behaviours.
speak
behaves in the same way as in say()
and personalise()
Last updated