A ChatGPT-like experience to query over work item data within an Azure DevOps organization.
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
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.
Execute the following commands to deploy the sample:
deploy.sh
Once the resources are deployed, you can use the Azure OpenAI Studio to chat with your newly deployed model.
- Navigate to "Chat" under the Playground
- Under "Setup", choose "Add your data"
- Click the "Add data source" button
- Under "Select data source", choose "Azure AI Search";
- Choose your Azure subscription
- Choose your Azure AI Search service
- For "Azure AI Search index", select
ado-vector-index
- Check "Add vector search to this search resource"
- Choose the embedding model (e.g.,
text-embedding-ada-002-2
) - Check the "I acknowledge that connecting to an Azure AI Search account will incur usage to my account."
- Click the "Next" button
- Under the "Search type", ensure "Hybrid + semantic" is selected
- Under "Select an existing semantic search configuration" choose
ado-vector-semantic-configuration
. - Check "I acknowledge that using semantic search will incur usage to my Azure AI Search account
- Check "I acknowledge that adding vector embeddings will incur usage to my account"
- Click the "Next" button
- Review the details presented and click the "Save and close" button
Now that your data source is configured, modify the chat playground settings to begin chatting with your data:
- Choose "Advanced settings" to expand additional options
- Optionally, adjust the Strictness (hover over the information icon for more details)
- Optionally, adjust the retrieved documents (hover over the information icon for more details)
- Choose your Open AI model deployment (e.g.,
gpt-35-turbo-16k-0613
) - Optionally, adjust past messages to include (hover over the information icon for more details)
- Enter your first prompt
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.
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
- This sample is heavily based off this article: Chat with your Azure DevOps data | Microsoft Tech Communities
- Which itself is based off this sample: Preview - Sample Chat App with AOAI | GitHub