Skip to content

Commit 1518bec

Browse files
committed
Merge branch 'feature/azd-semantickernel'
2 parents c8d2ea6 + f9dbccc commit 1518bec

29 files changed

+4345
-240
lines changed

.devcontainer/devcontainer.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "Multi Agent Custom Automation Engine Solution Accelerator",
3-
"image": "mcr.microsoft.com/devcontainers/javascript-node:20-bullseye",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
44
"features": {
5-
"ghcr.io/devcontainers/features/docker-in-docker:2": {
6-
},
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
76
"ghcr.io/azure/azure-dev/azd:latest": {},
8-
"ghcr.io/devcontainers/features/azure-cli:1": {}
7+
"ghcr.io/devcontainers/features/node:1": {},
8+
"ghcr.io/devcontainers/features/azure-cli:1": {},
9+
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {}
910
},
1011
"customizations": {
1112
"vscode": {
@@ -18,13 +19,30 @@
1819
"ms-azuretools.vscode-bicep",
1920
"ms-azuretools.vscode-docker",
2021
"ms-vscode.js-debug",
21-
"ms-vscode.vscode-node-azure-pack"
22+
"ms-vscode.vscode-node-azure-pack",
23+
"charliermarsh.ruff",
24+
"exiasr.hadolint",
25+
"kevinrose.vsc-python-indent",
26+
"mosapride.zenkaku",
27+
"ms-python.python",
28+
"njpwerner.autodocstring",
29+
"redhat.vscode-yaml",
30+
"shardulm94.trailing-spaces",
31+
"tamasfe.even-better-toml",
32+
"yzhang.markdown-all-in-one",
33+
"ms-vscode.azure-account"
2234
]
2335
}
2436
},
25-
"forwardPorts": [3000, 3100],
26-
"remoteUser": "node",
37+
"postCreateCommand": "bash ./.devcontainer/setupEnv.sh",
38+
"containerEnv": {
39+
"DISPLAY": "dummy",
40+
"PYTHONUNBUFFERED": "True",
41+
"UV_LINK_MODE": "copy",
42+
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
43+
},
44+
"remoteUser": "vscode",
2745
"hostRequirements": {
2846
"memory": "8gb"
2947
}
30-
}
48+
}

.devcontainer/setupEnv.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
#!/bin/bash
22

3-
pip install --upgrade pip
3+
cd ./src/backend
4+
uv add -r requirements.txt
45

6+
cd ../frontend
7+
uv add -r requirements.txt
58

6-
(cd ./src/frontend; pip install -r requirements.txt)
9+
cd ..
710

811

9-
(cd ./src/backend; pip install -r requirements.txt)
12+
13+
14+
15+
16+
17+
# pip install --upgrade pip
18+
19+
20+
# (cd ./src/frontend; pip install -r requirements.txt)
21+
22+
23+
# (cd ./src/backend; pip install -r requirements.txt)
1024

1125

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
},
6+
// {
7+
// "path": "./src/frontend"
8+
// },
9+
// {
10+
// "path": "./src/backend"
11+
// }
12+
]
13+
}

README.md

Lines changed: 151 additions & 107 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## How to Check & Update Quota
2+
3+
1. **Navigate** to the [Azure AI Foundry portal](https://ai.azure.com/).
4+
2. **Select** the AI Project associated with this accelerator.
5+
3. **Go to** the `Management Center` from the bottom-left navigation menu.
6+
4. Select `Quota`
7+
- Click on the `GlobalStandard` dropdown.
8+
- Select the required **GPT model** (`GPT-4o`)
9+
- Choose the **region** where the deployment is hosted.
10+
5. Request More Quota or delete any unused model deployments as needed.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## [Optional]: Customizing resource names
2+
3+
By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values.
4+
5+
6+
> To override any of the parameters, run `azd env set <key> <value>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 charaters alphanumeric unique name.
7+
8+
9+
Change the Secondary Location (example: eastus2, westus2, etc.)
10+
11+
```shell
12+
azd env set AZURE_ENV_COSMOS_LOCATION eastus2
13+
```
14+
15+
Change the Model Deployment Type (allowed values: Standard, GlobalStandard)
16+
17+
```shell
18+
azd env set AZURE_ENV_MODEL_DEPLOYMENT_TYPE Standard
19+
```
20+
21+
Set the Model Name (allowed values: gpt-4, gpt-4o)
22+
23+
```shell
24+
azd env set AZURE_ENV_MODEL_NAME gpt-4o
25+
```
26+
27+
Change the Model Capacity (choose a number based on available GPT model capacity in your subscription)
28+
29+
```shell
30+
azd env set AZURE_ENV_MODEL_CAPACITY 30
31+
```
32+
33+
Change the Embedding Model
34+
35+
```shell
36+
azd env set AZURE_ENV_EMBEDDING_MODEL_NAME text-embedding-ada-002
37+
```
38+
39+
Change the Embedding Deployment Capacity (choose a number based on available embedding model capacity in your subscription)
40+
41+
```shell
42+
azd env set AZURE_ENV_EMBEDDING_MODEL_CAPACITY 80
43+
```
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Deleting Resources After a Failed Deployment in Azure Portal
2+
3+
If your deployment fails and you need to clean up the resources manually, follow these steps in the Azure Portal.
4+
5+
---
6+
7+
## **1. Navigate to the Azure Portal**
8+
1. Open [Azure Portal](https://portal.azure.com/).
9+
2. Sign in with your Azure account.
10+
11+
---
12+
13+
## **2. Find the Resource Group**
14+
1. In the search bar at the top, type **"Resource groups"** and select it.
15+
2. Locate the **resource group** associated with the failed deployment.
16+
17+
![Resource Groups](images/resourcegroup.png)
18+
19+
![Resource Groups](images/resource-groups.png)
20+
21+
---
22+
23+
## **3. Delete the Resource Group**
24+
1. Click on the **resource group name** to open it.
25+
2. Click the **Delete resource group** button at the top.
26+
27+
![Delete Resource Group](images/DeleteRG.png)
28+
29+
3. Type the resource group name in the confirmation box and click **Delete**.
30+
31+
📌 **Note:** Deleting a resource group will remove all resources inside it.
32+
33+
---
34+
35+
## **4. Delete Individual Resources (If Needed)**
36+
If you don’t want to delete the entire resource group, follow these steps:
37+
38+
1. Open **Azure Portal** and go to the **Resource groups** section.
39+
2. Click on the specific **resource group**.
40+
3. Select the **resource** you want to delete (e.g., App Service, Storage Account).
41+
4. Click **Delete** at the top.
42+
43+
![Delete Individual Resource](images/deleteservices.png)
44+
45+
---
46+
47+
## **5. Verify Deletion**
48+
- After a few minutes, refresh the **Resource groups** page.
49+
- Ensure the deleted resource or group no longer appears.
50+
51+
📌 **Tip:** If a resource fails to delete, check if it's **locked** under the **Locks** section and remove the lock.
52+
53+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Manual Azure Deployment
2+
Manual Deployment differs from the ‘Quick Deploy’ option in that it will install an Azure Container Registry (ACR) service, and relies on the installer to build and push the necessary containers to this ACR. This allows you to build and push your own code changes and provides a sample solution you can customize based on your requirements.
3+
4+
## Prerequisites
5+
6+
- Current Azure CLI installed
7+
You can update to the latest version using ```az upgrade```
8+
- Azure account with appropriate permissions
9+
- Docker installed
10+
11+
## Deploy the Azure Services
12+
All of the necessary Azure services can be deployed using the /deploy/macae.bicep script. This script will require the following parameters:
13+
14+
```
15+
az login
16+
az account set --subscription <SUBSCRIPTION_ID>
17+
az group create --name <RG_NAME> --location <RG_LOCATION>
18+
```
19+
To deploy the script you can use the Azure CLI.
20+
```
21+
az deployment group create \
22+
--resource-group <RG_NAME> \
23+
--template-file <BICEP_FILE> \
24+
--name <DEPLOYMENT_NAME>
25+
```
26+
27+
Note: if you are using windows with PowerShell, the continuation character (currently ‘\’) should change to the tick mark (‘`’).
28+
29+
The template will require you fill in locations for Cosmos and OpenAI services. This is to avoid the possibility of regional quota errors for either of these resources.
30+
31+
## Create the Containers
32+
- Get admin credentials from ACR
33+
34+
Retrieve the admin credentials for your Azure Container Registry (ACR):
35+
36+
```sh
37+
az acr credential show \
38+
--name <e.g. macaeacr2t62qyozi76bs> \
39+
--resource-group <rg-name>
40+
```
41+
42+
## Login to ACR
43+
44+
Login to your Azure Container Registry:
45+
46+
```sh
47+
az acr login --name <e.g. macaeacr2t62qyozi76bs>
48+
```
49+
50+
## Build and push the image
51+
52+
Build the frontend and backend Docker images and push them to your Azure Container Registry. Run the following from the src/backend and the src/frontend directory contexts:
53+
54+
```sh
55+
az acr build \
56+
--registry <e.g. macaeacr2t62qyozi76bs> \
57+
--resource-group <rg-name> \
58+
--image <e.g. backendmacae:latest> .
59+
```
60+
61+
## Add images to the Container APP and Web App services
62+
63+
To add your newly created backend image:
64+
- Navigate to the Container App Service in the Azure portal
65+
- Click on Application/Containers in the left pane
66+
- Click on the "Edit and deploy" button in the upper left of the containers pane
67+
- In the "Create and deploy new revision" page, click on your container image 'backend'. This will give you the option of reconfiguring the container image, and also has an Environment variables tab
68+
- Change the properties page to
69+
- point to your Azure Container registry with a private image type and your image name (e.g. backendmacae:latest)
70+
- under "Authentication type" select "Managed Identity" and choose the 'mace-containerapp-pull'... identity setup in the bicep template
71+
- In the environment variables section add the following (each with a 'Manual entry' source):
72+
73+
name: 'COSMOSDB_ENDPOINT'
74+
value: \<Cosmos endpoint>
75+
76+
name: 'COSMOSDB_DATABASE'
77+
value: 'autogen'
78+
Note: To change the default, you will need to create the database in Cosmos
79+
80+
name: 'COSMOSDB_CONTAINER'
81+
value: 'memory'
82+
83+
name: 'AZURE_OPENAI_ENDPOINT'
84+
value: <Azure OpenAI endpoint>
85+
86+
name: 'AZURE_OPENAI_DEPLOYMENT_NAME'
87+
value: 'gpt-4o'
88+
89+
name: 'AZURE_OPENAI_API_VERSION'
90+
value: '2024-08-01-preview'
91+
Note: Version should be updated based on latest available
92+
93+
name: 'FRONTEND_SITE_NAME'
94+
value: 'https://<website Name>.azurewebsites.net'
95+
96+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
97+
value: <Application Insights Connection String>
98+
99+
- Click 'Save' and deploy your new revision
100+
101+
To add the new container to your website run the following:
102+
103+
```
104+
az webapp config container set --resource-group <resource_group_name> \
105+
--name <container_name> \
106+
--container-image-name <e.g. macaeacr2t62qyozi76bs.azurecr.io/frontendmacae:latest> \
107+
--container-registry-url <e.g. https://macaeacr2t62qyozi76bs.azurecr.io>
108+
```
109+

documentation/SampleQuestions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Sample Questions
2+
3+
To help you get started, here are some **Sample Prompts** you can ask in the app:
4+
5+
1. Run each of the following sample prompts and verify that a plan is generated:
6+
- Launch a new marketing campaign
7+
- Procure new office equipment
8+
- Initiate a new product launch
9+
10+
2. Run the **Onboard employee** prompt:
11+
- Remove the employee name from the prompt to test how the solution handles missing information.
12+
- The solution should ask for the missing detail before proceeding.
13+
14+
3. Try running known **RAI test prompts** to confirm safeguard behavior:
15+
- You should see a toast message indicating that a plan could not be generated due to policy restrictions.
16+
17+
18+
**Home Page**
19+
![HomePage](images/MACAE-GP1.png)
20+
21+
**Task Page**
22+
![GeneratedPlan](images/MACAE-GP2.png)
23+
24+
25+
_This structured approach helps ensure the system handles prompts gracefully, verifies plan generation flows, and confirms RAI protections are working as intended._

documentation/TRANSPARENCY_FAQ.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Document Generation Solution Accelerator: Responsible AI FAQ
2+
- ### What is Build your own copilot - Generic Solution Accelerator?
3+
This solution accelerator is an open-source GitHub Repository to help create AI assistants using Azure OpenAI Service and Azure AI Search. This can be used by anyone looking for reusable architecture and code snippets to build AI assistants with their own enterprise data. The repository showcases a generic scenario of a user who wants to generate a document template based on a sample set of data.
4+
5+
- ### What can Document Generation Solution Accelerator do?
6+
The sample solution included focuses on a generic use case - chat with your own data, generate a document template using your own data, and exporting the document in a docx format. The sample data is sourced from generic AI-generated promissory notes. The documents are intended for use as sample data only. The sample solution takes user input in text format and returns LLM responses in text format up to 800 tokens. It uses prompt flow to search data from AI search vector store, summarize the retrieved documents with Azure OpenAI.
7+
8+
- ### What is/are Document Generation Solution Accelerator’s intended use(s)?
9+
This repository is to be used only as a solution accelerator following the open-source license terms listed in the GitHub repository. The example scenario’s intended purpose is to help users generate a document template to perform their work more efficiently.
10+
11+
- ### How was Document Generation Solution Accelerator evaluated? What metrics are used to measure performance?
12+
We have used AI Foundry Prompt flow evaluation SDK to test for harmful content, groundedness, and potential security risks.
13+
14+
- ### What are the limitations of Document Generation Solution Accelerator? How can users minimize the impact of Document Generation Solution Accelerator’s limitations when using the system?
15+
This solution accelerator can only be used as a sample to accelerate the creation of AI assistants. The repository showcases a sample scenario of a user generating a document template. Users should review the system prompts provided and update as per their organizational guidance. Users should run their own evaluation flow either using the guidance provided in the GitHub repository or their choice of evaluation methods. AI-generated content may be inaccurate and should be manually reviewed. Currently, the sample repo is available in English only.
16+
- ### What operational factors and settings allow for effective and responsible use of Document Generation Solution Accelerator?
17+
Users can try different values for some parameters like system prompt, temperature, max tokens etc. shared as configurable environment variables while running run evaluations for AI assistants. Please note that these parameters are only provided as guidance to start the configuration but not as a complete available list to adjust the system behavior. Please always refer to the latest product documentation for these details or reach out to your Microsoft account team if you need assistance.

0 commit comments

Comments
 (0)