Version: 3.x

rasa.core.channels.twilio_voice

TwilioVoiceInput Objects

class TwilioVoiceInput(InputChannel)

Input channel for Twilio Voice.

name

@classmethod
def name(cls) -> Text

Name of channel.

from_credentials

@classmethod
def from_credentials(cls, credentials: Optional[Dict[Text,
Any]]) -> InputChannel

Load custom configurations.

__init__

def __init__(initial_prompt: Optional[Text],
reprompt_fallback_phrase: Optional[Text],
assistant_voice: Optional[Text],
speech_timeout: Text = "5",
speech_model: Text = "default",
enhanced: Text = "false") -> None

Creates a connection to Twilio voice.

Arguments:

  • initial_prompt - text to use to prompt a conversation when call is answered.
  • reprompt_fallback_phrase - phrase to use if no user response.
  • assistant_voice - name of the assistant voice to use.
  • speech_timeout - how long to pause when user finished speaking.
  • speech_model - type of transcription model to use from Twilio.
  • enhanced - toggle to use Twilio's premium speech transcription model.

blueprint

def blueprint(
on_new_message: Callable[[UserMessage], Awaitable[None]]) -> Blueprint

Defines endpoints for Twilio voice channel.

TwilioVoiceCollectingOutputChannel Objects

class TwilioVoiceCollectingOutputChannel(CollectingOutputChannel)

Output channel that collects send messages in a list.

(doesn't send them anywhere, just collects them).

name

@classmethod
def name(cls) -> Text

Name of the output channel.

send_text_message

async def send_text_message(recipient_id: Text, text: Text,
**kwargs: Any) -> None

Sends the text message after removing emojis.

send_text_with_buttons

async def send_text_with_buttons(recipient_id: Text, text: Text,
buttons: List[Dict[Text, Any]],
**kwargs: Any) -> None

Convert buttons into a voice representation.

send_image_url

async def send_image_url(recipient_id: Text, image: Text,
**kwargs: Any) -> None

For voice channel do not send images.