Skip to content

One-click deploy Azure Solution Accelerator for Call Center Automation with OpenAI real-time and Azure Communication Service.

License

Notifications You must be signed in to change notification settings

Azure-Samples/realtime-call-center-accelerator

Realtime Call Center Solution Accelerator

One-click deploy Azure Solution Accelerator for Call Center Automation with OpenAI Realtime Models and Azure Communication Services. This Solution Accelerator provides a reference implementation for an AI-assisted call center solution that uses Azure Communication Services to provide a phone-based voice channel for customers to interact with an AI Agent.

Screenshot

Features:

  • Directly talk to the AI Agent through the web interface
  • Request a phone call to talk to the AI Agent via telephone
  • Speaks multiple languages
  • Ask questions about Azure products
  • Interrupt the bot anytime
  • Customizable knowledge base and system prompt

What can I ask?

For this demo, the bot is able to answer questions about Microsoft Azure products, like Azure App Service, Azure Container Apps, and Azure Container Registry but its knowledge can be customized. Here is some inspiration for questions you can ask the bot:

Which pricing tier of Azure App Service supports custom domains?

What is the difference between scaling up and scaling out in Azure App Services?

Get it running

Set up the Azure Environment

To run this application, you can provision the resources to your Azure Subscription using the Azure Developer CLI.

From your command line:

# Login to the Azure Developer CLI
azd auth login

# Provision all the resources with the azure dev cli
# The following values should work:
# location=northeurope
# aiResourceLocation=swedencentral
azd up

Azure Communication Services

At the moment, the configuration of Azure Communication Services phone number is not automated. So you will need to follow the following steps manually.

  1. Go to the Azure Portal and navigate to the Azure Communication Services resource that has been created
  2. In the left menu, select Phone numbers and then click the Get button
  3. Select a Country or region and choose Toll free as your number type
  4. Follow the instructions to purchase a phone number
  5. Add an ACS_SOURCE_NUMBER=xxx environment variable to the .azure/xxx/.env file with the phone number

Deploy the application

To deploy the application, you can use the script provided in the azd-hooks folder. This script will build and deploy the user interface and the backend API. Before running the script, make sure you have the Azure CLI and the Azure Communication Services extension installed.

az extension add --name communication

Run the script with the following commands:

# Get and set the value for AZURE_ENV_NAME
source <(azd env get-values | grep AZURE_ENV_NAME)

# Building and deploying the user interface and the backend API
bash ./azd-hooks/deploy.sh app $AZURE_ENV_NAME

When successful, you will see the following output with the URL of the deployed application:

Deployment complete. Application URI: <YOUR_APP>.azurecontainerapps.io

Cloud Infrastructure

Azure Architecture

Local Development

Running this application locally, still requires some Azure Services in the cloud, so make sure to set up the Azure environment first.

Setup the local environment

If you are running this application locally, for the first time, we recommend setting up a Python environment. This only needs to be done once.

python -m venv .venv

Activate the local Python environment.

source .venv/bin/activate

Install the packages

pip install -r src/app/requirements.txt

Set the environment variables.

source <(azd env get-values)
azd env get-values >> .env

Start the application

Start the ngrok server.

Hint: We use ngrok to tunnel localhost to a publically available URL while developing. This is needed, as Azure Communication Services need a URL for the callbacks and to send the voice packages to. This can not be localhost and must be reachable from Azure Communication Services. For the first time, you might need to install ngrok and create a free account.

ngrok http http://localhost:8765

Override the callback urls with your ngrok url (Example: f782-188-92-253-99.ngrok-free.app)

For Bash:

export ACS_CALLBACK_PATH="https://<YOUR_NGROK_URL>/acs"
export ACS_MEDIA_STREAMING_WEBSOCKET_PATH="wss://<YOUR_NGROK_URL>/realtime-acs"

For PowerShell:

setx ACS_CALLBACK_PATH="https://<YOUR_NGROK_URL>/acs"
setx ACS_MEDIA_STREAMING_WEBSOCKET_PATH="wss://<YOUR_NGROK_URL>/realtime-acs"

Start the application

python src/app/app.py

Customization

You can customize the knowledge base and the system prompt of the bot.

Knowledge base

The knowledge base is stored in the data folder. After running the deployment script, the contents of this folder will be copied to the Azure Storage Account from where it is indexed and vectorized in the Azure AI Search service.

To customize the knowledge base, you can add or remove files from the data folder and re-run the deployment script.

System prompt

By default, the hardcoded system prompt is used. You can customize the system prompt by placing a file named system_prompt.md in the prompt container of the Azure Storage Account. If this file exists, it will be used instead of the hardcoded system prompt.


Contributors

(alphabetical order)

Related content

Based on this solution accelerator: on-the-road copilot


Trademarks: This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

About

One-click deploy Azure Solution Accelerator for Call Center Automation with OpenAI real-time and Azure Communication Service.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •