This project is managed using pyproject.toml and the uv package manager for fast Python dependency management.
Based on .env.sample, create a .env file to allow your local app to access your Azure resource.
-
Run the local server:
uv run server.py
-
Once the app is running, open http://127.0.0.1:8000 in your browser (or click the printed URL in the terminal).
-
On the page, click Start to begin speaking with the agent using your browser’s microphone and speaker.
If you prefer Docker or are running in GitHub Codespaces:
-
Build the image:
docker build -t voiceagent . -
Run the image with local environment variables:
docker run --env-file .env -p 8000:8000 -it voiceagent -
Open http://127.0.0.1:8000 and click Start to interact with the agent.
To test Azure Communication Services (ACS) locally, we’ll expose the local server using Azure DevTunnels.
DevTunnels allow public HTTP/S access to your local environment — ideal for webhook testing.
-
Install Azure Dev CLI if not already installed.
-
Log in and create a tunnel:
devtunnel login devtunnel create --allow-anonymous devtunnel port create -p 8000 devtunnel host
-
The final command will output a URL like:
https://<your-tunnel>.devtunnels.ms:8000 -
Add this URL to your
.envfile under:ACS_DEV_TUNNEL=https://<your-tunnel>.devtunnels.ms:8000
- Go to your Communication Services resource in the Azure Portal.
- In the left menu, click Events → + Event Subscription.
- Use the following settings:
- Event type:
IncomingCall - Endpoint type:
Web Hook - Endpoint URL:
https://<your-tunnel>.devtunnels.ms:8000/acs/incomingcall
- Event type:
Ensure both your local Python server and DevTunnel are running before creating the subscription.
- Get a phone number for your ACS resource if not already provisioned.
- Call the number. Your call will route to your local agent.
- Use the web client for fast local testing.
- Use DevTunnel + ACS to simulate phone calls and test telephony integration.
- Use Genesys AudioHook to integrate with Genesys Cloud contact center.
- Customize the
.envfile, system prompts, and runtime behavior to fit your use case.
Genesys AudioHook (Audio Connector) streams real-time call audio from Genesys Cloud to your AudioHook endpoint for AI processing.
Add the following to your .env file:
GENESYS_API_KEY=your-chosen-api-key
uv run server.pyThe server starts with:
- AudioHook WebSocket:
ws://127.0.0.1:8000/audiohook/ws - Browser Simulator:
http://127.0.0.1:8000/genesys
Open the simulator page, enter the same API key, and click Connect & Start Call to test without a Genesys Cloud account.
For production setup and full details, see the Genesys AudioHook section in the top-level README.