Coder Social home page Coder Social logo

ado-chatgpt's Introduction

ADO ChatGPT

A ChatGPT-like experience to query over work item data within an Azure DevOps organization.

Pre-requisites

To run this sample in its entirety, you need the following:

  • a bash-like shell (e.g. Git Bash, WSL, etc.)
  • an Azure DevOps organization and team project from which data will be exported
  • an Azure DevOps work item query to pull work items from (should return 1000 items or less)
  • an Azure subscription, with access to Open AI
  • az cli installed and logged in to your Azure subscription

Configuration

Duplicate the .envsample file and rename it to .env. Fill in the values for all of the required environment variables.

The following parameters can be configured:
Name Description Required?
AZURE_LOCATION The name of the Azure region to deploy to; a list can be found by running az account list-locations -o table --query "[].displayName" Yes
AZURE_WORKLOAD The workload name to be used when creating Azure resources; keep short and limited to A-z, 0-9, and hyphens Yes
AZURE_SUBSCRIPTIONID The Subscription ID (GUID) that this sample will be deployed to Yes
ADO_ORG The Azure DevOps organization name work items will be exported from Yes
ADO_PROJECT The Azure DevOps project name work items will be exported from Yes
ADO_QUERIES A comma-separated list of query IDs that work items will be pulled from No
AZURE_OPENAI_EMBEDDINGMODELNAME The name of the Azure OpenAI Model to use for embedding vectors into the Azure AI Search index (recommended to use text-embedding-ada-002 or equivalent) Yes
AZURE_OPENAI_EMBEDDINGMODELVERSION The version of the Azure OpenAI Model to use for embedding vectors into the Azure AI Search index (recommended to use 2 or equivalent) Yes
AZURE_OPENAI_MODELNAME The name of the Azure OpenAI Model to use for querying the Azure AI Search index (recommended to use gpt-35-turbo-16k or equivalent) Yes
AZURE_OPENAI_MODELVERSION The version of the Azure OpenAI Model to use for querying the Azure AI Search index (recommended to use 0613 or equivalent) No
SKIP_ADO_DOWNLOAD Set to 1 to skip the ADO Work Item download process No
SKIP_ADO_UPLOAD Set to 1 to skip the ADO Work Item upload to Azure Storage process No
SKIP_INFRASTRUCTURE Set to 1 to skip the Azure infrastructure deployment process No
SKIP_OPENAI_MODELSETUP Set to 1 to skip the Azure Open AI model setup process No
SKIP_SEARCH_DATASOURCESETUP Set to 1 to skip the Azure AI Search data source setup process No
SKIP_SEARCH_INDEXERSETUP Set to 1 to skip the Azure AI Search indexer setup process No
SKIP_SEARCH_INDEXSETUP Set to 1 to skip the Azure AI Search index setup process No
SKIP_SEARCH_SKILLSETSETUP Set to 1 to skip the Azure AI Search skill set setup process No

Optionally, copy the templates/ado-record.jq file to queries/ado-recrord.jq to customize the properties that are indexed by Azure AI Search.

Instead of utilizing the ADO_QUERIES environment variable, copy templates/ado-query-example.wiql to the queries/ folder with a descriptive name. Any queries present in this folder will be executed in alphabetical order. Do not add an ORDER BY clause, as one will be added sorting by Work Item ID (System.Id). This will bypass the 1,000 record limit on queries.

Deploy the Resources

Execute the following commands to deploy the sample:

deploy.sh

Use Azure OpenAI Studio to Chat with Your Data

Configure your chat data source

Once the resources are deployed, you can use the Azure OpenAI Studio to chat with your newly deployed model.

Add Data Source

  1. Navigate to "Chat" under the Playground
  2. Under "Setup", choose "Add your data"
  3. Click the "Add data source" button

Configure data source

  1. Under "Select data source", choose "Azure AI Search";
  2. Choose your Azure subscription
  3. Choose your Azure AI Search service
  4. For "Azure AI Search index", select ado-vector-index
  5. Check "Add vector search to this search resource"
  6. Choose the embedding model (e.g., text-embedding-ada-002-2)
  7. Check the "I acknowledge that connecting to an Azure AI Search account will incur usage to my account."
  8. Click the "Next" button

Configure data management

  1. Under the "Search type", ensure "Hybrid + semantic" is selected
  2. Under "Select an existing semantic search configuration" choose ado-vector-semantic-configuration.
  3. Check "I acknowledge that using semantic search will incur usage to my Azure AI Search account
  4. Check "I acknowledge that adding vector embeddings will incur usage to my account"
  5. Click the "Next" button

Review and finish

  1. Review the details presented and click the "Save and close" button

Chat with your data

Now that your data source is configured, modify the chat playground settings to begin chatting with your data:

Prepare the Chat

  1. Choose "Advanced settings" to expand additional options
  2. Optionally, adjust the Strictness (hover over the information icon for more details)
  3. Optionally, adjust the retrieved documents (hover over the information icon for more details)
  4. Choose your Open AI model deployment (e.g., gpt-35-turbo-16k-0613)
  5. Optionally, adjust past messages to include (hover over the information icon for more details)
  6. Enter your first prompt

Query the data

Note that citations can be expanded and clicked on to show the data source the response came from. You can continue to query through additional prompts to refine the data that has been retrieved.

Optional: Deploy a Web App

If you would like to deploy a web app to interact with your data, you can use the "Deploy to…" button and choose "A new web app…" to create an interactive web application using your newly deployed models and datasets.

For more information, follow the instructions in Tutorial: Deploy a web app for chat on your data

References and Additional Resources

ado-chatgpt's People

Contributors

brandonmartinez avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

codebytes

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.