page_type | languages | products | |||
---|---|---|---|---|---|
sample |
|
|
This is a sample application demonstrated during Microsoft Build 2024. It highlights an integration of Azure Communication Services with Azure OpenAI Service to enable intelligent conversational agents.
- Create an Azure account with an active subscription. For details, see Create an account for free
- Visual Studio Code installed
- Node.js installed
- Create an Azure Communication Services resource. For details, see Create an Azure Communication Resource. You will need to record your resource connection string for this sample.
- Get a phone number for your new Azure Communication Services resource. For details, see Get a phone number
- An Azure OpenAI Resource and Deployed Model. See instructions.
- Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you would like to clone the sample to.
- git clone
https://github.com/Azure-Samples/communication-services-javascript-quickstarts.git
. - cd into the
callautomation-az-openai-voice
folder. - From the root of the above folder, and with node installed, run
npm install
Azure DevTunnels is an Azure service that enables you to share local web services hosted on the internet. Use the commands below to connect your local development environment to the public internet. This creates a tunnel with a persistent endpoint URL and which allows anonymous access. We will then use this endpoint to notify your application of calling events from the ACS Call Automation service.
devtunnel create --allow-anonymous
devtunnel port create -p 8080
devtunnel host
Open the .env
file to configure the following settings
CONNECTION_STRING
: Azure Communication Service resource's connection string.CALLBACK_URI
: Base url of the app. (For local development replace the dev tunnel url)AZURE_OPENAI_SERVICE_KEY
: Azure Open AI service keyAZURE_OPENAI_SERVICE_ENDPOINT
: Azure Open AI endpointAZURE_OPENAI_DEPLOYMENT_MODEL_NAME
: Azure Open AI deployment name
- Open a new Powershell window, cd into the
callautomation-az-openai-voice
folder and runnpm run dev
- Browser should pop up with the below page. If not navigate it to
http://localhost:8080/
- Register an EventGrid Webhook for the IncomingCall Event that points to your 8080 port URI (ex.
https://<devtunnel>/api/incomingCall
). Instructions here.
Once that's completed you should have a running application. The best way to test this is to place a call to your ACS phone number