Giter Site home page Giter Site logo

msalemor / adventureworks-viewer-ai Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 4.0 567 KB

A demo application to showcase adding intelligence to an application with different levels of complexity.

Makefile 0.81% Python 36.78% Shell 0.08% JavaScript 0.49% HTML 0.25% CSS 1.28% TypeScript 16.47% TSQL 4.73% Dockerfile 0.63% C# 38.49%

adventureworks-viewer-ai's Introduction

Adventureworks-AI-Viewer

Overview

A demo application to showcase adding intelligence to an application at different levels of complexity.

A screen capture of Advetureworks AI viewer showing getting data in differente modes.

Architecture

graph LR;
  A((User))<-->F(Frontend)
  F<-->B(Backend)
  B<--GptBot-->O(GPTBot)
  B<--SQLBot-->SQL(Sqbot)
  B<-->RAG
  B<--Assistants API Bot-->Asst(Assistants API Bot)
  B<--MultiagentBot-->M(Multiagent Bot<br/>Proxy Agent<br/>Semantic Processing)
  M<--Other or<br/>Unknown<br/>Intent-->O
  M<--SQL Scripts<br/>Intent-->SQL
  M<--Charts<br/>Intent-->Asst
  M<--RAG<br/>Intent-->RAG
Loading

Application Options

Selection Description
No AI A user can click on the icons to show the data on the table on the grid in the UI.
Chatbot A user can ask questions related to top customers and products.
RAG A user can ask questions about product information.
Sqlbot A user can ask the system to generate SQL statement. The SQL statements are then executed and presented on the grid in the UI.
Assistants API Bot A user can ask the system to perform complex data analysis related to top customers and top products and generate bars and charts.
Multiagent Bot This Bot will decide which agent to call (Chatbot, SQLbot or Assistant Bot based on the user's intent and will respond accordingly.

Requirements

Database

This app leverages the SQL Adventurework database data. However, additional views need to be deployed. You will need to:

  • Deploy Azure SQL Database with AdventuresWorks to Azure

A screen capture of Advetureworks AI viewer showing getting data in differente modes.

Backend - Python

  • Python 3.11
  • openai==1.16.1
  • fastapi==0.110.1
  • uvicorn[standard]==0.29.0
  • pymssql==2.2.11
  • pillow==10.3.0

Backend - C#

  • .NET 8
  • Packages:
    • Azure OpenAI
    • Azure Assistants API
    • Dotnet.Env

Frontend - React

  • React
  • Tailwind CSS
  • react-data-grid
  • react-icons
  • react-loader-spinner
  • react-markdown

Debugging - Python

  • Install the frontend dependencies: cd src/frontend && npm install
  • Install the backend dependencies: cd src/backend && pip install -r requirements.txt
  • Create or update the environment variable files at: src/backend/.env
DB_HOST=<NAME>.database.windows.net
DB_PORT=1433
DB_USER=<ADMIN_USER>
DB_PASSWORD=<ADMIN_PASSWORD>
DB_DATABASE=<DB_NAME>

OPENAI_FULL_URI=https://<NAME>.openai.azure.com/openai/deployments/gpt4-1106-preview/chat/completions?api-version=2024-02-15-preview
OPENAI_URI=https://<NAME>.openai.azure.com/
OPENAI_KEY=<API_KEY>
OPENAI_GPT_DEPLOYMENT=gpt4-1106-preview
OPENAI_VERSION=2024-02-15-preview
OPENAPI_URL=/openapi.json
  • Start the backend: cd src/backend && sh run.sh or cd src/backend && uvicorn main:app --reload
  • Start the frontend: cd src/frontend && npm run dev

Debugging - C#

  • Install the frontend dependencies: cd src/frontend && npm install
  • Install the backend dependencies: cd src/csbackend && dotnet restore
  • Create or update the environment variable files at: src/csbackend/.env
DB_HOST=<NAME>.database.windows.net
DB_PORT=1433
DB_USER=<ADMIN_USER>
DB_PASSWORD=<ADMIN_PASSWORD>
DB_DATABASE=<DB_NAME>

OPENAI_FULL_URI=https://<NAME>.openai.azure.com/openai/deployments/gpt4-1106-preview/chat/completions?api-version=2024-02-15-preview
OPENAI_URI=https://<NAME>.openai.azure.com/
OPENAI_KEY=<API_KEY>
OPENAI_GPT_DEPLOYMENT=gpt4-1106-preview
OPENAI_VERSION=2024-02-15-preview
OPENAPI_URL=/openapi.json
  • Start the backend: cd src/csbackend or cd src/csbackend && dotnet watch run
  • Start the frontend: cd src/frontend && npm run dev

adventureworks-viewer-ai's People

Contributors

msalemor avatar

Stargazers

Aga avatar Ali Haghighi avatar davdelvecchio avatar  avatar  avatar Rubén Toribio Gallardo avatar Sunil Sattiraju avatar Ashish avatar  avatar  avatar

Watchers

 avatar Jaqueline Ramos avatar  avatar

adventureworks-viewer-ai's Issues

AI Search semantic config for RAG option

Using the RAG option, code relies on AISEARCH_SEMANTIC_CONFIG env variable. Is there guidance on how to configure the semantic configuration to add on which index?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.