Skip to content

raffertyuy/github-copilot-extension-aisearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-copilot-extension-aisearch

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.

Copilot Extension in VS Code Copilot Extension in GitHub.com

Chat with your data - file upload

Pre-requisites

  1. 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.
  1. GitHub Copilot

Running and Debugging Locally

Pre-requisites:

  1. Azure Function Pre-requisites: check out the official documentation
  2. GitHub Debug CLI: see gh debug-cli

Create a local.settings.json file in the az-function directory:

  1. Copy the values in local.settings.json.sample
  2. 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

gh debug-cli

Deploying to Azure and Testing in GitHub.com

Deploy the Azure Function

  1. Open the project in VS Code
  2. Sign in to Azure: CTRL/Cmd + Shift + P > Azure: Sign In
  3. CTRL/Cmd + Shift + P > Azure Functions: Deploy to Function App
  4. Go to the deployed Azure Function in the Azure Portal
  5. Go to Environment variables and add AI_SEARCH_ENDPOINT with the correct value

Add a new GitHub App

  1. Go to your GitHub Profile → Settings → Developer settings → New GitHub App
  2. 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"
  1. 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

New GitHub App - Copilot

Test the Agent Extension

  1. In GitHub.com, open the GitHub Copilot Chat window
  2. Type your @app-name Hi! and hit ENTER (Note: The agent won't show up until you do this for the first time)
  3. Start chatting! (the response should be similar to when you ask directly in the deployed Chat with Your Data Solution Accelerator web application)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published