Skip to content

Commit de370d2

Browse files
2 parents 0aa2810 + c6a6d4b commit de370d2

File tree

2 files changed

+231
-46
lines changed

2 files changed

+231
-46
lines changed

README.md

Lines changed: 225 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
>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
1+
# Document Generation Solution Accelerator
42

53
MENU: [**USER STORY**](#user-story) \| [**ONE-CLICK DEPLOY**](#one-click-deploy) \| [**SUPPORTING DOCUMENTS**](#supporting-documents) \|
64
[**CUSTOMER TRUTH**](#customer-truth)
@@ -13,9 +11,18 @@ User story
1311

1412
**Solution accelerator overview**
1513

16-
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+
![Key Features](/docs/images/keyfeatures.png)
21+
22+
Below is an image of the solution.
23+
24+
![Landing Page](/docs/images/landing_page.png)
1725

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.
1926

2027
**Scenario**
2128

@@ -26,38 +33,188 @@ The documents are intended for use as sample data only.
2633

2734
<br/>
2835

29-
**Key features**
3036

31-
![Key Features](/docs/images/keyfeatures.png)
37+
### Solution accelerator architecture
38+
![image](/docs/images/architecture.png)
3239

40+
<h2><img src="./docs/images/oneClickDeploy.png" width="64">
3341
<br/>
42+
QUICK DEPLOY
43+
</h2>
3444

35-
**Below is an image of the solution accelerator.**
45+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator) | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](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) |
46+
|---|---|---|
3647

37-
![Landing Page](/docs/images/landing_page.png)
3848

49+
### Prerequisites
3950

40-
<h2><img src="/docs/images//oneClickDeploy.png" width="64">
41-
<br/>
42-
One-click deploy
43-
</h2>
51+
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)
4452

45-
### Prerequisites
53+
Check the [Azure Products by Region](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=all&regions=all) page and select a **region** where the following services are available:
4654

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.
55+
- Azure AI Foundry
56+
- Azure OpenAI Service
57+
- Azure AI Search
58+
- Embedding Model Capacity
59+
- GPT Model Capacity
60+
- [Azure Semantic Search](./docs/AzureSemanticSearchRegion.md)
4861

49-
For additional training and support, please see:
5062

51-
1. [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/)
52-
2. [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/)
53-
3. [Azure AI Foundry](https://learn.microsoft.com/en-us/azure/ai-studio/)
63+
<!-- Here are some example regions where the services are available: East US, East US2, Australia East, UK South, France Central. -->
5464

55-
### Solution accelerator architecture
56-
![image](/docs/images/architecture.png)
5765

66+
### Configurable Deployment Settings
67+
68+
When you start the deployment, most parameters will have **default values**, but you can update the following settings:
69+
70+
| **Setting** | **Description** | **Default value** |
71+
|------------|----------------| ------------|
72+
| **Azure Region** | The region where resources will be created. | East US|
73+
| **Environment Name** | A **3-20 character alphanumeric value** used to generate a unique ID to prefix the resources. | byctemplate |
74+
| **Secondary Location** | A **less busy** region for **Azure SQL and CosmosDB**, useful in case of availability constraints. | eastus2 |
75+
| **Deployment Type** | Select from a drop-down list. | Standard |
76+
| **GPT Model** | Choose from **gpt-4, gpt-4o** | gpt-4 |
77+
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models**. | 30k |
78+
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-ada-002 |
79+
| **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+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](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+
[![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](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:
134+
135+
1. Make sure the following tools are installed:
136+
137+
* [Azure Developer CLI (azd)](https://aka.ms/install-azd)
138+
* [Python 3.9+](https://www.python.org/downloads/)
139+
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)
140+
* [Git](https://git-scm.com/downloads)
141+
142+
2. Download the project code:
143+
144+
```shell
145+
azd init -t microsoft/Generic-Build-your-own-copilot-Solution-Accelerator/
146+
```
147+
148+
3. Open the project folder in your terminal or editor.
149+
150+
4. Continue with the [deploying steps](#deploying).
151+
152+
</details>
58153

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>
60156

157+
### Bicep
158+
159+
Click the following deployment button to create the required resources for this solution directly in your Azure Subscription.
160+
161+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](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+
<!--
61218
62219
### **How to install/deploy**
63220
@@ -88,22 +245,8 @@ To add further access controls, update the logic in `getUserInfoList` in `fronte
88245
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
89246
90247
### Local deployment
91-
Review the local deployment [README](./docs/README_LOCAL.md).
92-
<br>
93-
<h2><img src="./docs/images/supportingDocuments.png" width="64">
94-
<br/>
95-
Supporting documents
96-
</h2>
248+
Review the local deployment [README](./docs/README_LOCAL.md). -->
97249
98-
Supporting documents coming soon.
99-
<br>
100-
<h2><img src="./docs/images/customerTruth.png" width="64">
101-
</br>
102-
Customer truth
103-
</h2>
104-
Customer stories coming soon.
105-
106-
<br/>
107250
108251
109252
<h2>
@@ -113,9 +256,51 @@ Responsible AI Transparency FAQ
113256
114257
Please refer to [Transparency FAQ](./docs/TRANSPARENCY_FAQ.md) for responsible AI transparency details of this solution accelerator.
115258
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/)
277+
* Azure Container Registry: Basic tier. [Pricing](https://azure.microsoft.com/pricing/details/container-registry/)
278+
* Log analytics: Pay-as-you-go tier. Costs based on data ingested. [Pricing](https://azure.microsoft.com/pricing/details/monitor/)
279+
* Azure Cosmos DB: [Pricing](https://azure.microsoft.com/en-us/pricing/details/cosmos-db/autoscale-provisioned/)
280+
281+
282+
⚠️ 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).
297+
298+
299+
300+
### Additional Resources
301+
1. [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/)
302+
2. [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/)
303+
3. [Azure AI Foundry](https://learn.microsoft.com/en-us/azure/ai-studio/)
119304
120305
## Disclaimers
121306

docs/TRANSPARENCY_FAQ.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
## Build your own copilot - Generic Solution Accelerator: Responsible AI FAQ
1+
## Document Generation Solution Accelerator: Responsible AI FAQ
22
- ### What is Build your own copilot - Generic Solution Accelerator?
33
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.
44

5-
- ### What can Build your own copilot - Generic Solution Accelerator do?
5+
- ### What can Document Generation Solution Accelerator do?
66
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.
77

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)?
99
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.
1010

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?
1212
We have used AI Foundry Prompt flow evaluation SDK to test for harmful content, groundedness, and potential security risks.
1313

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?
1515
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?
1717
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)