New in 3.12From Rasa Pro 3.12, you can stream conversation audio directly from
AudioCodes to your Rasa Assistant.
Configure Rasa Assistant
Use the built-in channelaudiocodes_stream to configure your Rasa
Assistant. Create or edit the credentials.yml file
at the root of your assistant directory to add audiocodes_stream channel. Here’s an example:
credentials.yml
server_url(required): The domain at which Rasa server is available. Do not include protocol (ws:// or wss://). For example, if your server is deployed onhttps://example.ngrok.app,server_urlshould beexample.ngrok.app.asr(required): Configuration for Automatic Speech Recognition. See Speech Integrations for a list of ASR engines for which Rasa provides built-in integration with.tts(required): Configuration for Text-To-Speech. See Speech Integrations for a list of TTS engines for which Rasa provides built-in integration with.token(optional): An authentication token configured in AudioCodes. This field is optional, as AudioCodes permits empty values. If no token is provided, authentication will be skipped.
rasa run. You’ll need a URL accessible by AudioCodes for your Rasa assistant. For development, you can use tools like ngrok or Cloudflare Tunnel
You can also run it with a development inspector using rasa run --inspect.
To see all available parameters for this command, use rasa run -h.
Bot URLs for developmentVisit this section to learn how to generate
the required bot URL when testing the channel on your local machine.
Configuration on AudioCodes
This channel connector uses AudioCodes Voice Streaming API. Create a bot connection for Streaming Mode bots on AudioCodes, please refer to AudioCodes Documentation for detailed instructions.- On the Bot Connections page, click on Add new voice bot connection.
- Select AudioCodes Bot API
- Set an appropriate name for the Bot Connection. For “Bot connection API type”, select “Streaming Mode”.
- Set the “Bot URL”. Depending on the hostname and TLS configuration, the URL would be
wss://<your-domain>/webhooks/audiocodes_stream/websocket - Set an authentication token, ensure that Rasa channel configuration has the same authentication token.
- On the next page, select Enable voice streaming. For ‘Language’ field, leave the default setting as it has no impact on Rasa Assistant
Enable playFinished events
This channel connector requires playFinished events for certain features like
silence handling and hanging up the call with action_hangup to work.
To enable these events, edit the bot connection that was created in the previous
section. Go to the Advanced Tab and paste the following in,
Call Metadata
Metadata about the call can be accessed by the slotsession_started_metadata
in the beginning of the call. Following fields are available:
A custom
action_session_start can be used to store this information to a slot.