Say

Speak to your character

Say() is the core Carter function, and is how you send messages and get responses from your character.

# Carter object already created

response = carter.say("Hello, world!", "player123", speak)

# Print the response text
if interaction.ok:
    print(response.output_text)

Say() accepts three parameters

  • text - The message to send to carter

  • user_id (optional) - A unique identifier for the player/user who is sending the message. This is optional, a new uuid will be generated for each request if none is provided. You can extract this to be saved for future use from the returned interaction.

  • speak (optional) - As discussed in the previous section, a speak boolean can be provided on a per function call basis which will override the class default. If true, the API will return an audio_url and interaction.response_audio will be set accordingly.

Last updated