🖥️
carter-js V3
  • carter-js
  • 💬Conversation
    • Say
    • Interactions
    • Opener
    • History
    • Speak
  • 🎱Skills
    • Basics
  • Other Features
    • Response Times
    • Personalise
  • More
    • Changelog
    • Further Reading
    • carter-py
Powered by GitBook
On this page
  • Class Level
  • Request Level
  1. Conversation

Speak

The Carter API does not return an audio URL by default as this introduces latency. carter-js mimicks this behaviour. By default, carter-js will pass speak=false to the api, and interaction.outputAudio will be null.

There are two ways to override this behaviour.

Class Level

const carter = new Carter(apiKey, logger, speak=True)

When the speak parameter is set to true on class creation, every request to carter will pass speak=True by default. Think of this as setting the default.

Request Level

const interaction = carter.say(text, playerId, speak=False)

When the speak parameter is passed to a function call, it will override the default on the class. This is true whether speak has been overriden on class creation or left to the default false.

This allows you to choose a default, and break from this with each request.

PreviousHistoryNextBasics

Last updated 2 years ago

💬