Azure-Samples / gen-ai-bot-in-a-box

This template deploys a Generative AI Virtual Assistant using Azure OpenAI and Bot Framework.
MIT License
14 stars 6 forks source link

AI-in-a-Box - Generative AI Bot Quickstart

This solution is part of the the AI-in-a-Box framework developed by the team of Microsoft Customer Engineers and Architects to accelerate the deployment of AI and ML solutions. Our goal is to simplify the adoption of AI technologies by providing ready-to-use accelerators that ensure quality, efficiency, and rapid deployment. AI-in-a-box Logo: Description

Deploy to Azure

User Story

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.

What's in the Box

GenAI Bots Architecture

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.

Thinking Outside of the Box

The solution can be adapted for your own use cases:

Deploy the Solution

Prerequisites for running locally:

  1. Install latest version of Azure CLI
  2. Install latest version of Bicep
  3. Install latest version of Azure Developer CLI
  4. Install Node JS

Deploy to Azure

  1. Clone this repository locally
    git clone https://github.com/Azure-Samples/gen-ai-bot-in-a-box
  2. 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.

Azure YAML

  1. 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.

Run the Solution

Test in Web Chat

Go to the resource group and find the Azure Bot Services instance.

Resource group view

Select the Test in Web Chat option.

Azure Bot Services Overview

Chat with your new bot!

Web Chat Test

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.

Test in Bot Framework Emulator

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:

You may then open the Bot Emulator and connect it to http://localhost:3978/api/messages to test your bot.

Troubleshooting and FAQ

How to Contribute

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.

Key Contacts & Contributors

Contact GitHub ID Email
Marco Cardoso @MarcoABCardoso macardoso@microsoft.com

License

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.