The Copilot Extension processes image files to generate code snippets from visual data, analyze and interpret architecture diagrams, and convert diagram-based logic into code. It can extract key information to create class files, model data from images, and identify target resource requirements. Additionally, it generates test cases from visual flows and parses network topology diagrams to produce configuration scripts.
- Copilot Chat: User interfacce
- img-insight Extension: Copilot Extension to process image
- GitHub Model: GPT 4o-mini model from GitHub Models for processing the user request
- GitHub Keys api: Request verification
- GitHub content api: Retrieve he content of attachments, if any
This feature allows you to analyze and interpret architecture diagrams.
Sample Prompts:
- Explain the architecture at *image link*.
- Explain the attached image
This feature helps you generate class files based on diagrams.
Sample Prompts:
- Create C# class files using the diagram at *image link*.
- Create Java class files based on attached diagram
This feature converts logic from diagrams into code.
Sample Prompts:
- Convert this logic into a JavaScript function *image link*.
- Create Python code based on the attached flow-chart
This feature generates SQL create statements using entities defined in images.
Sample Prompts:
- Generate SQL create statements using the entities defined at *image link* .
This feature identifies the Azure resources utilized in architecture diagrams.
Sample Prompts:
- What are the Azure resources utilized in *image link*
This feature generates unit test cases using JUnit to address functionality defined in visual flows.
Sample Prompts:
- Generate unit test cases using JUnit to address the functionality defined at *image link*.
This feature generates configuration scripts based on network topology diagrams.
Sample Prompts:
- Generate configuration scripts for the diagram at *image link*.
This feature convert a web or mobile design into code by extracting style and page components
Sample Prompts:
- Create html and css files for the design share *image link or attachment*.
-
Clone the Repository
git clone https://github.com/octodemo/amb-copilot-extensions.git
-
Create a new
.env
file in the root directory of your project. Add the following line to the.env
file:GITHUB_KEYS_URI=https://api.github.com/meta/public_keys/copilot_api GITHUB_TOKEN=<your-github-token>
-
Install the Required Dependencies Navigate to the
img-insight-extn
directory and install the dependencies:cd img-insight-extn npm install
-
Run the App Start the Angular application:
npm start
-
Access the Application Open your browser and navigate to:
http://localhost:3000
- Establish OIDC Connectivity with Microsoft Entra ID by refering the documentation
- Add the following secrets to GitHub Secrets:
AZURE_CLIENT_ID - Your Azure client ID AZURE_AD_TENANT - Your Azure AD tenant AZURE_SUBSCRIPTION_ID - Your Azure subscription ID
- Add the following secrets to GitHub Secrets:
- Create a Web applicaton to host the extension
- Update the
Environment Variables
in the Azure Web application with the following:GITHUB_KEYS_URI=https://api.github.com/meta/public_keys/copilot_api GITHUB_TOKEN=<your-github-token>
- Update the
app-name
input for the workflow Node Deploy with the Azure Web application name - Trigger the workflow by selecting the
pack-name=img-insight-extn
and clicking onRun workflow