Azure / semantic-kernel-bot-in-a-box

Extensible Semantic Kernel Bot Solution Accelerator
MIT License
55 stars 12 forks source link

We've moved! Please find the latest version of this solution in the AI-in-a-Box repository: https://aka.ms/ai-in-a-box This repository will be archived on February 2024.

Semantic Kernel Bot in-a-box

Banner

This project deploys an extensible Semantic Kernel bot template to Azure.

Solution Architecture

The solution architecture is described in the diagram below.

Solution Architecture

The flow of messages is as follows:

Pre-requisites

Deploy to Azure

  1. Clone this repository locally:
git clone https://github.com/Azure/AI-in-a-Box
cd semantic-kernel-bot-in-a-box
  1. Deploy resources:

    azd up

    You will be prompted for a subcription, region and model information. Keep regional model availability when proceeding.

  2. Test on Web Chat - go to your Azure Bot resource on the Azure portal and look for the Web Chat feature on the left side menu.

Test Web Chat

Running Locally (must deploy resources to Azure first)

After running the deployment template, you may also run the application locally for development and debugging.

Sample scenarios

The application has the ability to consume information from GPT-4 itself, Cognitive Search, SQL and documents uploaded by the end user directly. Each of these data sources will be preloaded with some sample data, but you may use the connections as templates to connect your own data sources.

You may ask about the following topics to test each functionality

  1. General knowledge questions

    • Ask about any publicly available knowledge; General question scenario
  2. Retrieval-augmented generation (SearchPlugin)

    • Ask to look for hotels matching a description; Retrieval-augmented scenario
  3. Structured data retrieval (SQLPlugin)

    • Ask about your customers and sales; SQL connection scenario
  4. Upload documents as context (UploadPlugin)

    • Upload a file and ask questions about it; Upload scenario
  5. Generate images (DALLEPlugin)

    • Ask to generate images; Image Generation scenario

Keywords

Developing your own plugins

This project comes with a few plugins, which may be found in the Plugins/ directory. You may use these as examples when developing your own plugins.

To create a custom plugin:

And you're done! Redeploy your app and Semantic Kernel will now use your plugin whenever the user's questions call for it.

Enabling Web Chat

To deploy a Web Chat version of your app:

Please note that doing so will make your bot public, unless you implement authentication / SSO.

Contributing

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.

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.