Interactions
Last updated
Last updated
carter-js
contains an interaction class which is used to store the result of every interaction with your character, which contains the following properties:
type
- the type of interaction IE. say
id
- A uuid to identify the interaction
payload
- A dictionary containing the data carter-py sent to your character
time-taken
- The total time from calling the function to creating the interaction
timestamp
- An ISO compliant string representing when the interaction was completed
url
- The url the request was made to
ok
- A boolean, taken from the response object, see .
status_code
- The response status code, see .
status_message
- The status message related to the code, see .
The following properties will only be set on an successful interaction, when carter responds to your message. All properties will be set to None if they are not applicable/not present, so it's always worth checking interaction.ok
is True. If the response is successful, there should be output data.
output_text
- The message returned by your character
output_audio
- The output audio url returned by carter, depending on your use of speak
, see the carter-py section, and sections for individual functions for more guidance.
forced_behaviours
- This is a list of forced behaviours triggered by your character. Will not be present for opener and personalise interactions.
Interactions have an interaction.print_verbose()
function for debugging purposes.