bigdatasciencegroup / microsoft-langchain-azure-ai-search-rag

VSCodeDay 2024 demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LangChain RAG with Azure AI Search

This repository contains a Streamlit application that generates project ideas based on Microsoft Azure Certifications and the level of the project (beginner, intermediate, advanced). The application uses the LangChain RAG (Retrieval-Augmented Generation) model with Azure AI Search to generate the project ideas.

Architecture

Architecture for the project

Features

  • Select a Microsoft Azure Certification from a dropdown list (AZ-900, AZ-104, AZ-305, AZ-400).
  • Select a project level from a dropdown list (beginner, intermediate, advanced).
  • Generate a detailed project idea, including the project name, description, list of services used, and steps to make the project.
  • Prompt Template used:
template="""
        You are a helpful cloud instructor that provides cloud project ideas about Microsoft Azure Certifications based on the certification guide.
        
        Give me a project idea for certification: {certification} of the level: {level}
        By searching the following certification guide: {docs}
        
        Only use the factual information from the guide to provide the project idea.
        
        If you feel like you don't have enough information to answer the question, say "I don't know".
        
        Your answers should be verbose and detailed. Include a Project Name, Project Description, list of Services Used and Steps to make the project. Make sure your response is in markdown format like:

        ### Project Name:
        Project Description:
        Services Used:
        - Service 1
        - Service 2
        #### Steps:
        - Step 1
        - Step 2
        """

Setup

pip install -r requirements.txt
  • Set up your Azure AI Search service and get your endpoint URL and admin key.
  • Set up your OpenAI API key.
  • Create a .env file in the root directory of the project and add your Azure Search endpoint URL, admin key, and OpenAI API key (look at the `.env.example):
AZURE_SEARCH_ENDPOINT="<YOUR_AZURE_SEARCH_ENDPOINT_URL>"
AZURE_SEARCH_ADMIN_KEY="<YOUR_AZURE_SEARCH_ADMIN_KEY>"
OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"

Usage

  1. Run the Streamlit application:
streamlit run streamlit.py
  1. Open the application in your web browser.
  2. Select a Microsoft Azure Certification and a project level.
  3. Click the "Generate" button to generate a project idea.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

Author

About

VSCodeDay 2024 demo


Languages

Language:Python 97.1%Language:Dockerfile 2.9%