Skip to content

yoshigev/ac-api-samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AudioCodes VoiceAI Connect API Samples

License

Description

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.

APIs

AudioCodes Bot API

  • 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"
        }
      }]
    }

License

This project is licensed under the ISC License.

About

Code samples for ac-api services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.6%
  • Dockerfile 2.4%