This repository contains simple servers that can be used as a reference for integrating with the AudioCodes VoiceAI Connect API. The servers are written in Typescript.
- Speech-to-Text API [API documentation]: A simple server that accepts websocket connections and sends pre-set transcriptions to the client.
-
HTTP Mode [API documentation]: A server that echos incoming messages. It also supports pre-defined replies like "disconnect", which hangs up.
To use the bot, you need to set the environment variable ACCESS_TOKEN for running the bot, and configure it accordingly in VoiceAI Connect.
For example, if the token is MyS3cr3tT0k3n, VoiceAI Connect configuration should contain:
{ "providers": [{ "name": "my-bot", "type": "ac-api", "botURL": "http://bot-server:8083/CreateConversation", "credentials": { "token": "MyS3cr3tT0k3n" } }] }
-
WebSocket Mode [API documentation]: A bot that echos incoming voice or text.
To use the bot, you need to set the environment variable ACCESS_TOKEN for running the bot, and configure it accordingly in VoiceAI Connect.
BOT_WS_PORT can be configured as well (default is 8050).
LISTEN_HOST can be configured as well (default is localhost).
the default echo time is five seconds. ecoTime (in milliseconds) can be configured using botUrl search params. i.e http://bot-server:8050/?echoTime=7000
To activate websocket mode add:
"acBotApiType": "streaming"
to bot configuration.this sample bot can support direct mode (stream voice directly to bot) or text mode. To activate direct mode add:
{ "directTTS": true, "directSTT": true, }
to bot configuration.
Basic websocket mode provider configuration:
{ "providers": [{ "name": "my-bot", "type": "ac-api", "botURL": "http://bot-server:8050", "credentials": { "token": "MyS3cr3tT0k3n" } }] }
This project is licensed under the ISC License.