Virtual Assistants are one of the top use cases for Generative AI. With Bot Framework, you can deploy and manage an enterprise-scale chat application with multiple supported programming languages. You can also connect with different end-user channels like Web, Microsoft Teams or Slack, while maintaining a single bot implementation.
This sample provides a template and guidance on how to deploy a virtual assistant leveraging multiple Azure AI technologies. It covers the infrastructure deployment, configuration on the AI Studio and Azure Portal, and end-to-end testing examples.
The following implementations are supported:
Language | Version | Chat Completions | Assistants API | Semantic Kernel | Phi-3 |
---|---|---|---|---|---|
Python | 3.10 | ✔ | ✔ | ✔ | ✗ |
C# | 8.0 | ✔ | ✔ | ✔ | ✗ |
NodeJS | 21.0 | ✔ | ✔ | ✗ | ✗ |
Notes: The Phi model implementation (coming soon!) requires the deployment of an AI Project and Serverless Endpoint. It does not support function calling. Using Python with Bot Framework requires a Single Tenant Application.
The solution can be adapted for your own use cases:
- Add custom AI plugins to perform integrations, such as:
- Bing Search, to enable up-to-date information retrieval
- MS Graph integrations to retrieve work profile information
- Custom RAG using SQL queries
- Customize the authorization flow to use SSO
- Integrate with enterprise communication channels
- Install latest version of Azure CLI
- Install latest version of Bicep
- Install latest version of Azure Developer CLI
- Install Node JS
- Clone this repository locally
git clone https://github.com/Azure-Samples/gen-ai-bot-in-a-box
- This repository provides the same application written in Dotnet, NodeJS and Python. Go to azure.yaml and uncomment the implementation you would like to use.
- Deploy resources
cd gen-ai-bot-in-a-box
azd auth login
azd up
You will be prompted for an environment name, a subscription, location and a few other customization parameters. Make sure to select the programming language you chose on the previous step, or deployment will fail.
Go to the resource group and find the Azure Bot Services instance.
Select the Test in Web Chat option.
Chat with your new bot!
Note: The first time you open your bot after deployment, it may take a few seconds to respond. After interacting with it the first time, it will respond faster.
You can also interact with your bot through the emulator by running the code locally. How you run the code depends on the language chosen:
- Dotnet:
dotnet run
- Node:
npm install
npm start
- Python:
pip install -r requirements.txt # Or set up a virtualenv / conda environment
python app.py
You may then open the Bot Emulator and connect it to http://localhost:3978/api/messages to test your bot.
- Post-provision hooks fail with "Cannot iterate over null":
- The post-provision hooks rely on network access to the services created. Make sure to allowlist your own IP so the scripts execute correctly
- azd pipeline config fails to push changes:
- This command will push changes to the repository's main branch. Make sure you have the necessary permissions and branch protection is temporarily disabled.
- An error of type 'access_denied' occurred during the login process:
- This will happen when your App Registration is missing either the "ID Tokens" configuration, or the MS Graph
openid
permission scope. Make sure both configurations are in place and retry.
- This will happen when your App Registration is missing either the "ID Tokens" configuration, or the MS Graph
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Contact | GitHub ID | |
---|---|---|
Marco Cardoso | @MarcoABCardoso | macardoso@microsoft.com |
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.
This project is part of the AI-in-a-Box series, aimed at providing the technical community with tools and accelerators to implement AI/ML solutions efficiently and effectively.