You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>Legal Notice: This is a pre-release and preview solution and therefore may not work correctly. Certain features may be missing or disabled. Microsoft may change or update this pre-release and preview solution at any time.
2
-
3
-
# Generic Build your own copilot Solution Accelerator
This solution accelerator is a powerful tool that helps you create your own AI assistant(s). The accelerator can be used by any customer looking for reusable architecture and code snippets to build an AI assistant(s) with their own enterprise data.
14
+
This solution accelerator is a powerful tool that helps you create your own AI assistant for document generation. The accelerator can be used by any customer looking for reusable architecture and code snippets to build an AI assistant to generate a sample template and content grounded on their own enterprise data.
15
+
16
+
It leverages Azure OpenAI Service and Azure AI Search, to identify relevant documents, summarize unstructured information, and generate document templates.
17
+
18
+
### Key features
19
+
20
+

21
+
22
+
Below is an image of the solution.
23
+
24
+

17
25
18
-
It leverages Azure OpenAI Service and Azure AI Search, to identify relevant documents, summarize unstructured information, and generate Word document templates using your own data.
19
26
20
27
**Scenario**
21
28
@@ -26,38 +33,188 @@ The documents are intended for use as sample data only.
**Below is an image of the solution accelerator.**
45
+
|[](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)|[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)|[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FGeneric-Build-your-own-copilot-Solution-Accelerator%2Fmain%2Finfra%2Fmain.json)|
To deploy this solution accelerator, ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the necessary permissions to create **resource groups and resources**. Follow the steps in [Azure Account Set Up](./docs/AzureAccountSetUp.md)
44
52
45
-
### Prerequisites
53
+
Check the [Azure Products by Region](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=all®ions=all) page and select a **region** where the following services are available:
46
54
47
-
To use this solution accelerator, you will need access to an [Azure subscription](https://azure.microsoft.com/free/) with permission to create resource groups and resources. While not required, a prior understanding of Azure OpenAI and Azure AI Search will be helpful.
|**Embedding Model Capacity**| Set the capacity for **embedding models**. | 80k |
80
+
81
+
82
+
### [Optional] Quota Recommendations
83
+
By default, the **GPT model capacity** in deployment is set to **30k tokens**.
84
+
> **We recommend increasing the capacity to 100k tokens for optimal performance.**
85
+
86
+
To adjust quota settings, follow these [steps](./docs/AzureGPTQuotaSettings.md)
87
+
88
+
89
+
**⚠️ Warning:****Insufficient quota can cause deployment errors.** Please ensure you have the recommended capacity or request for additional capacity before deploying this solution.
90
+
91
+
### Deployment Options
92
+
Pick from the options below to see step-by-step instructions for: GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
93
+
94
+
<details>
95
+
<summary><b>Deploy in GitHub Codespaces</b></summary>
96
+
97
+
### GitHub Codespaces
98
+
99
+
You can run this solution using GitHub Codespaces. The button will open a web-based VS Code instance in your browser:
100
+
101
+
1. Open the solution accelerator (this may take several minutes):
102
+
103
+
[](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)
104
+
2. Accept the default values on the create Codespaces page
105
+
3. Open a terminal window if it is not already open
106
+
4. Continue with the [deploying steps](#deploying)
107
+
108
+
</details>
109
+
110
+
<details>
111
+
<summary><b>Deploy in VS Code</b></summary>
112
+
113
+
### VS Code Dev Containers
114
+
115
+
You can run this solution in VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):
116
+
117
+
1. Start Docker Desktop (install it if not already installed)
118
+
2. Open the project:
119
+
120
+
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)
121
+
122
+
123
+
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
124
+
4. Continue with the [deploying steps](#deploying)
125
+
126
+
</details>
127
+
128
+
<details>
129
+
<summary><b>Deploy in your local environment</b></summary>
130
+
131
+
### Local environment
132
+
133
+
If you're not using one of the above options for opening the project, then you'll need to:
3. Open the project folder in your terminal or editor.
149
+
150
+
4. Continue with the [deploying steps](#deploying).
151
+
152
+
</details>
58
153
59
-
> Note: Some features contained in this repository are in private preview. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms).
154
+
<details>
155
+
<summary><b>Deploy with Bicep/ARM template</b></summary>
60
156
157
+
### Bicep
158
+
159
+
Click the following deployment button to create the required resources forthis solution directlyin your Azure Subscription.
160
+
161
+
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FGeneric-Build-your-own-copilot-Solution-Accelerator%2Fmain%2Finfra%2Fmain.json)
162
+
163
+
</details>
164
+
165
+
166
+
### Deploying
167
+
168
+
Once you've opened the project in [Codespaces](#github-codespaces) or in [Dev Containers](#vs-code-dev-containers) or [locally](#local-environment), you can deploy it to Azure following the following steps.
169
+
170
+
To change the azd parameters from the default values, follow the steps [here](./docs/CustomizingAzdParameters.md).
171
+
172
+
173
+
1. Login to Azure:
174
+
175
+
```shell
176
+
azd auth login
177
+
```
178
+
179
+
#### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**:
180
+
181
+
```sh
182
+
azd auth login --tenant-id <tenant-id>
183
+
```
184
+
185
+
2. Provision and deploy all the resources:
186
+
187
+
```shell
188
+
azd up
189
+
```
190
+
191
+
3. Provide an `azd` environment name (like "bycapp")
192
+
4. Select a subscription from your Azure account, and select a location which has quota for all the resources.
193
+
* This deployment will take *7-10 minutes* to provision the resources in your account and set up the solution with sample data.
194
+
* If you get an error or timeout with deployment, changing the location can help, as there may be availability constraints for the resources.
195
+
196
+
5. Once the deployment has completed successfully, open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service and get the app URL from `Default domain`.
197
+
198
+
6. You can now delete the resources by running `azd down`, if you are done trying out the application.
199
+
<!-- 6. You can now proceed to run the [development server](#development-server) to test the app locally, or if you are done trying out the app, you can delete the resources by running `azd down`. -->
200
+
201
+
<h2>
202
+
Additional Steps
203
+
</h2>
204
+
205
+
1. **Add App Authentication**
206
+
207
+
Follow steps in [App Authentication](./docs/AppAuthentication.md) to configure authenitcation in app service.
208
+
209
+
Note: Authentication changes can take up to 10 minutes
210
+
211
+
2. **Deleting Resources After a Failed Deployment**
212
+
213
+
Follow steps in [Delete Resource Group](./docs/DeleteResourceGroup.md) If your deployment fails and you need to clean up the resources.
214
+
215
+
216
+
217
+
<!--
61
218
62
219
### **How to install/deploy**
63
220
@@ -88,22 +245,8 @@ To add further access controls, update the logic in `getUserInfoList` in `fronte
88
245
2. **Importance of prompt engineering**. Prompt engineering is a critical aspect of working with AI models, especially when leveraging advanced capabilities such as those provided by Azure AI services. Proper prompt engineering ensures that the AI models generate accurate, relevant, and contextually appropriate responses. It involves carefully crafting and refining prompts to guide the model's behavior and output effectively. Neglecting prompt engineering can result in suboptimal performance, irrelevant outputs, and increased frustration for users. Therefore, it is essential to invest time and effort in prompt engineering to fully harness the potential of AI models
89
246
90
247
### Local deployment
91
-
Review the local deployment [README](./docs/README_LOCAL.md).
@@ -113,9 +256,51 @@ Responsible AI Transparency FAQ
113
256
114
257
Please refer to [Transparency FAQ](./docs/TRANSPARENCY_FAQ.md) for responsible AI transparency details of this solution accelerator.
115
258
116
-
<br/>
117
-
<br/>
118
-
---
259
+
<h2>
260
+
Supporting documentation
261
+
</h2>
262
+
263
+
### Costs
264
+
265
+
Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage.
266
+
The majority of the Azure resources used in this infrastructure are on usage-based pricing tiers.
267
+
However, Azure Container Registry has a fixed cost per registry per day.
268
+
269
+
You can try the [Azure pricing calculator](https://azure.microsoft.com/en-us/pricing/calculator) for the resources:
270
+
271
+
* Azure AI Foundry: Free tier. [Pricing](https://azure.microsoft.com/pricing/details/ai-studio/)
272
+
* Azure AI Search: Standard tier, S1. Pricing is based on the number of documents and operations. [Pricing](https://azure.microsoft.com/pricing/details/search/)
273
+
* Azure Storage Account: Standard tier, LRS. Pricing is based on storage and operations. [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/)
274
+
* Azure Key Vault: Standard tier. Pricing is based on the number of operations. [Pricing](https://azure.microsoft.com/pricing/details/key-vault/)
275
+
* Azure AI Services: S0 tier, defaults to gpt-4o and text-embedding-ada-002 models. Pricing is based on token count. [Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/)
276
+
* Azure Container App: Consumption tier with 0.5 CPU, 1GiB memory/storage. Pricing is based on resource allocation, and each month allows for a certain amount of free usage. [Pricing](https://azure.microsoft.com/pricing/details/container-apps/)
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
283
+
either by deleting the resource group in the Portal or running `azd down`.
284
+
285
+
### Security guidelines
286
+
287
+
This template uses Azure Key Vault to store all connections to communicate between resources.
288
+
289
+
This template also uses [Managed Identity](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) for local development and deployment.
290
+
291
+
To ensure continued best practices in your own repository, we recommend that anyone creating solutions based on our templates ensure that the [Github secret scanning](https://docs.github.com/code-security/secret-scanning/about-secret-scanning) setting is enabled.
292
+
293
+
You may want to consider additional security measures, such as:
294
+
295
+
* Enabling Microsoft Defender for Cloud to [secure your Azure resources](https://learn.microsoft.com/azure/security-center/defender-for-cloud).
296
+
* Protecting the Azure Container Apps instance with a [firewall](https://learn.microsoft.com/azure/container-apps/waf-app-gateway) and/or [Virtual Network](https://learn.microsoft.com/azure/container-apps/networking?tabs=workload-profiles-env%2Cazure-cli).
## Build your own copilot - Generic Solution Accelerator: Responsible AI FAQ
1
+
## Document Generation Solution Accelerator: Responsible AI FAQ
2
2
-### What is Build your own copilot - Generic Solution Accelerator?
3
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
4
5
-
-### What can Build your own copilot - Generic Solution Accelerator do?
5
+
-### What can Document Generation Solution Accelerator do?
6
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
7
8
-
-### What is/are Build your own copilot - Generic Solution Accelerator’s intended use(s)?
8
+
-### What is/are Document Generation Solution Accelerator’s intended use(s)?
9
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
10
11
-
-### How was Build your own copilot - Generic Solution Accelerator evaluated? What metrics are used to measure performance?
11
+
-### How was Document Generation Solution Accelerator evaluated? What metrics are used to measure performance?
12
12
We have used AI Foundry Prompt flow evaluation SDK to test for harmful content, groundedness, and potential security risks.
13
13
14
-
-### What are the limitations of Build your own copilot - Generic Solution Accelerator? How can users minimize the impact of Build your own copilot - Generic Solution Accelerator’s limitations when using the system?
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
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 Build your own copilot - Generic Solution Accelerator?
16
+
-### What operational factors and settings allow for effective and responsible use of Document Generation Solution Accelerator?
17
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