This repo is a GitHub Copilot Chat extension which integrates with the Chat with Your Data Solution Accelerator.
This extension is written in Python and is deployed to Azure Functions. It is built on top of this starter.
- Deployment of the Chat with Your Data Solution Accelerator.
- Upload a few documents to process in the
https://web-...-admin.azurewebsites.net
portal. - Get the endpoint of
https://web-....azurewebsites.net
.
Pre-requisites:
- Azure Function Pre-requisites: check out the official documentation
- GitHub Debug CLI: see gh debug-cli
Create a local.settings.json
file in the az-function
directory:
- Copy the values in
local.settings.json.sample
- Change the value of
AI_SEARCH_ENDPOINT
to the correct endpoint URL.
Run the app locally:
cd az-function
python -m venv .venv
source .venv/bin/activate #if using Windows Command Prompt, run `.venv\Scripts\activate`
pip install -r requirements.txt
func start
In a new terminal, use the gh debug-cli
:
export URL="http://localhost:7071/api/query" #if using Windows Command Prompt, use `set` instead of `export`
gh debug-cli
- Open the project in VS Code
- Sign in to Azure:
CTRL/Cmd + Shift + P
>Azure: Sign In
CTRL/Cmd + Shift + P
>Azure Functions: Deploy to Function App
- Go to the deployed Azure Function in the Azure Portal
- Go to Environment variables and add
AI_SEARCH_ENDPOINT
with the correct value
- Go to your GitHub Profile → Settings → Developer settings → New GitHub App
- Fill in the some initial values:
- the GitHub App name is going to be the
@agentname
that you'll use in the GH Copilot Chat - for test purposes, you may disable/uncheck "Request user authorization (OAuth) during installation"
- Click Copilot from the navigation bar on the left
- Change App Type to Agent
- Change URL to the Function URL of your Azure Function
- Change Inference description to the message you want your users to see on the chat box
- In GitHub.com, open the GitHub Copilot Chat window
- Type your
@app-name Hi!
and hit ENTER (Note: The agent won't show up until you do this for the first time) - Start chatting! (the response should be similar to when you ask directly in the deployed Chat with Your Data Solution Accelerator web application)