Skip to content

Commit 878475d

Browse files
authored
Merge pull request #675 from microsoft/vNext-Dev
v1.1 Release from vNext-Dev to main
2 parents f4b3f3a + 8806594 commit 878475d

File tree

235 files changed

+13662
-4640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+13662
-4640
lines changed

.devcontainer/Dockerfile

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye
1+
FROM mcr.microsoft.com/vscode/devcontainers/python:3.10-bullseye
22

33
# Avoid warnings by switching to noninteractive
44
ENV DEBIAN_FRONTEND=noninteractive
@@ -48,11 +48,26 @@ RUN /tmp/docker-client.sh $USERNAME
4848
RUN git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1 \
4949
&& echo "if [ -f \"$HOME/.bash-git-prompt/gitprompt.sh\" ]; then GIT_PROMPT_ONLY_IN_REPO=1 && source $HOME/.bash-git-prompt/gitprompt.sh; fi" >> "/home/$USERNAME/.bashrc"
5050

51+
# terraform + tflint
52+
ARG TERRAFORM_VERSION=1.3.7
53+
ARG TFLINT_VERSION=0.44.1
54+
RUN mkdir -p /tmp/docker-downloads \
55+
&& curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
56+
&& unzip /tmp/docker-downloads/terraform.zip \
57+
&& mv terraform /usr/local/bin \
58+
&& rm /tmp/docker-downloads/terraform.zip \
59+
&& echo "alias tf=terraform" >> "/home/$USERNAME/.bashrc"
60+
61+
RUN curl -sSL -o /tmp/docker-downloads/tflint.zip https://github.com/wata727/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip \
62+
&& unzip /tmp/docker-downloads/tflint.zip \
63+
&& mv tflint /usr/local/bin \
64+
&& rm /tmp/docker-downloads/tflint.zip
65+
5166
# azure-cli
5267
COPY ./scripts/azure-cli.sh /tmp/
5368
RUN /tmp/azure-cli.sh
5469

55-
# Install dotnet 6 & Azure Functions Core Tools
70+
# Install Azure Functions Core Tools
5671
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/microsoft.list \
5772
&& echo "deb [arch=amd64] https://packages.microsoft.com/debian/$(lsb_release -rs | cut -d'.' -f 1)/prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \
5873
&& wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb \
@@ -78,4 +93,10 @@ RUN if [ -z "$TZ" ]; then TZ="Europe/London"; fi && sudo ln -snf /usr/share/zone
7893

7994
# Install gettext-base so that we have envsubst
8095
RUN sudo apt-get update \
81-
&& sudo apt-get -y install gettext-base
96+
&& sudo apt-get -y install gettext-base
97+
98+
# Install python packages for migration
99+
RUN pip install azure-cosmos
100+
RUN pip install pyfiglet
101+
RUN pip install azure-identity
102+
RUN pip install azure-keyvault-secrets

.devcontainer/devcontainer.json

+50-51
Original file line numberDiff line numberDiff line change
@@ -23,58 +23,57 @@
2323
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock"
2424
],
2525

26-
// Set *default* container specific settings.json values on container create.
27-
"settings": {
28-
"python.pythonPath": "/opt/conda/envs/development/bin/python",
29-
"python.languageServer": "Pylance",
30-
"python.linting.enabled": true,
31-
"python.linting.pylintEnabled": true,
32-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
33-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
34-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
35-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
36-
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
37-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
38-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
39-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
40-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
41-
"files.watcherExclude": {
42-
"**/.git/objects/**": true,
43-
"**/.git/subtree-cache/**": true,
44-
"**/node_modules/*/**": true,
45-
"**/.python_packages/*/**": true
46-
},
47-
"files.associations": {
48-
"*.workbook": "[jsonc]"
26+
// Set *default* container specific settings values on container create.
27+
"customizations": {
28+
"vscode": {
29+
"settings": {
30+
"python.pythonPath": "/opt/conda/envs/development/bin/python",
31+
"python.languageServer": "Pylance",
32+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
33+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
34+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
35+
"files.watcherExclude": {
36+
"**/.git/objects/**": true,
37+
"**/.git/subtree-cache/**": true,
38+
"**/node_modules/*/**": true,
39+
"**/.python_packages/*/**": true
40+
},
41+
"files.associations": {
42+
"*.workbook": "[jsonc]"
43+
}
44+
},
45+
// Add extensions you want installed when the container is created into this array
46+
"extensions": [
47+
"ms-python.python",
48+
"ms-python.vscode-pylance",
49+
"IronGeek.vscode-env",
50+
"ms-azuretools.vscode-docker",
51+
"ms-toolsai.jupyter",
52+
"humao.rest-client",
53+
"ms-dotnettools.csharp",
54+
"ms-vsliveshare.vsliveshare-pack",
55+
"ms-vscode.powershell",
56+
"DavidAnson.vscode-markdownlint",
57+
"redhat.vscode-yaml",
58+
"ms-azure-devops.azure-pipelines",
59+
"k--kato.docomment",
60+
"hediet.vscode-drawio",
61+
"msazurermtools.azurerm-vscode-tools",
62+
"ms-azuretools.vscode-azurestorage",
63+
"GitHub.copilot",
64+
"GitHub.copilot-chat",
65+
"BelkacemBerras.spellcheck",
66+
"ms-azuretools.vscode-azureresourcegroups",
67+
"ms-azuretools.vscode-azurefunctions",
68+
"ms-python.pylint",
69+
"ms-python.mypy",
70+
"HashiCorp.terraform",
71+
"mhutchie.git-graph",
72+
"esbenp.prettier-vscode",
73+
"mutantdino.resourcemonitor"
74+
]
4975
}
5076
},
5177

52-
// Add the IDs of extensions you want installed when the container is created.
53-
"extensions": [
54-
"ms-python.python",
55-
"ms-python.vscode-pylance",
56-
"irongeek.vscode-env",
57-
"ms-azuretools.vscode-docker",
58-
"ms-toolsai.jupyter",
59-
"humao.rest-client",
60-
"ms-dotnettools.csharp",
61-
"ms-vsliveshare.vsliveshare-pack",
62-
"ms-vscode.powershell",
63-
"DavidAnson.vscode-markdownlint",
64-
"redhat.vscode-yaml",
65-
"ms-azure-devops.azure-pipelines",
66-
"k--kato.docomment",
67-
"hediet.vscode-drawio",
68-
"msazurermtools.azurerm-vscode-tools",
69-
"ms-azuretools.vscode-azurestorage",
70-
"ms-azuretools.vscode-bicep",
71-
"GitHub.copilot",
72-
"BelkacemBerras.spellcheck",
73-
"ms-azuretools.vscode-azureresourcegroups",
74-
"ms-azuretools.vscode-azurefunctions",
75-
"ms-python.python",
76-
"ms-python.pylint"
77-
],
78-
7978
"remoteUser": "vscode"
80-
}
79+
}

.gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ main.parameters.json
369369
infrastructure.env
370370
infrastructure.debug.env
371371
infra_output.json
372+
inf_output.json
372373
random.txt
373374
.state
374375

@@ -385,4 +386,13 @@ app/backend/shared_code
385386
packages-microsoft*
386387

387388
# docker container build artifacts
388-
app/enrichment/shared_code
389+
app/enrichment/shared_code
390+
391+
#terraform
392+
.terraform
393+
infra/.terraform*
394+
terraform.tfstate
395+
terraform.tfstate.d
396+
.tfplan.txt
397+
infra/infoasst*
398+
infra/sp_config/config.json

.vscode/launch.json

+6-12
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,18 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7-
87
{
98
"name": "Python: WebApp backend",
109
"type": "python",
1110
"request": "launch",
12-
"module": "flask",
13-
"cwd": "${workspaceFolder}/app/backend",
14-
"env": {
15-
"FLASK_APP": "app.py",
16-
"FLASK_ENV": "development",
17-
"FLASK_DEBUG": "0"
18-
},
11+
"module": "uvicorn",
1912
"args": [
20-
"run",
21-
"--no-debugger",
22-
"--no-reload",
23-
"-p 5000"
13+
"app:app",
14+
"--reload",
15+
"--port",
16+
"5000"
2417
],
18+
"cwd": "${workspaceFolder}/app/backend",
2519
"console": "integratedTerminal",
2620
"justMyCode": true,
2721
"envFile": "${workspaceFolder}/scripts/environments/infrastructure.debug.env",

Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ infrastructure: check-subscription ## Deploy infrastructure
2525
@./scripts/inf-create.sh
2626

2727
extract-env: extract-env-debug-webapp extract-env-debug-functions ## Extract infrastructure.env file from BICEP output
28-
@./scripts/json-to-env.sh < infra_output.json > ./scripts/environments/infrastructure.env
28+
@./scripts/json-to-env.sh < inf_output.json > ./scripts/environments/infrastructure.env
2929

3030
deploy-webapp: extract-env ## Deploys the web app code to Azure App Service
3131
@./scripts/deploy-webapp.sh
@@ -40,10 +40,10 @@ deploy-search-indexes: extract-env ## Deploy search indexes
4040
@./scripts/deploy-search-indexes.sh
4141

4242
extract-env-debug-webapp: ## Extract infrastructure.debug.env file from BICEP output
43-
@./scripts/json-to-env.webapp.debug.sh < infra_output.json > ./scripts/environments/infrastructure.debug.env
43+
@./scripts/json-to-env.webapp.debug.sh < inf_output.json > ./scripts/environments/infrastructure.debug.env
4444

4545
extract-env-debug-functions: ## Extract local.settings.json to debug functions from BICEP output
46-
@./scripts/json-to-env.function.debug.sh < infra_output.json > ./functions/local.settings.json
46+
@./scripts/json-to-env.function.debug.sh < inf_output.json > ./functions/local.settings.json
4747

4848
# Utils (used by other Makefile rules)
4949
check-subscription:
@@ -53,8 +53,16 @@ check-subscription:
5353
take-dir-ownership:
5454
@sudo chown -R vscode .
5555

56+
terraform-remote-backend:
57+
@./scripts/terraform-remote-backend.sh
58+
59+
infrastructure-remote-backend: terraform-remote-backend infrastructure
60+
5661
destroy-inf: check-subscription
5762
@./scripts/inf-destroy.sh
5863

5964
functional-tests: extract-env ## Run functional tests to check the processing pipeline is working
6065
@./scripts/functional-tests.sh
66+
67+
run-migration: ## Migrate from bicep to terraform
68+
python ./scripts/merge-databases.py

README.md

+43-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
> [!IMPORTANT]
44
> As of November 15, 2023, Azure Cognitive Search has been renamed to Azure AI Search. Azure Cognitive Services have also been renamed to Azure AI Services.
55
6-
## Table of Contents
6+
## Table of Contents
77

8+
- [Response Generation Approaches](#response-generation-approaches)
89
- [Features](#features)
910
- [Azure account requirements](#azure-account-requirements)
1011
- [Azure Deployment](./docs/deployment/deployment.md)
@@ -19,6 +20,7 @@
1920
- [Using the app](/docs/deployment/using_ia_first_time.md)
2021
- [Responsible AI](#responsible-ai)
2122
- [Transparency Note](#transparency-note)
23+
- [Content Safety](#content-safety)
2224
- [Data Collection Notice](#data-collection-notice)
2325
- [Resources](#resources)
2426
- [Known Issues](./docs/knownissues.md)
@@ -39,17 +41,40 @@ The accelerator adapts prompts based on the model type for enhanced performance.
3941

4042
Please [see this video](https://aka.ms/InfoAssist/video) for use cases that may be achievable with this accelerator.
4143

44+
# Response Generation Approaches
45+
46+
## Work(Grounded)
47+
It utilizes a retrieval-augmented generation (RAG) pattern to generate responses grounded in specific data sourced from your own dataset. By combining retrieval of relevant information with generative capabilities, It can produce responses that are not only contextually relevant but also grounded in verified data. The RAG pipeline accesses your dataset to retrieve relevant information before generating responses, ensuring accuracy and reliability. Additionally, each response includes a citation to the document chunk from which the answer is derived, providing transparency and allowing users to verify the source. This approach is particularly advantageous in domains where precision and factuality are paramount. Users can trust that the responses generated are based on reliable data sources, enhancing the credibility and usefulness of the application. Specific information on our Grounded (RAG) can be found in [RAG](docs/features/cognitive_search.md#azure-ai-search-integration)
48+
49+
## Ungrounded
50+
It leverages the capabilities of a large language model (LLM) to generate responses in an ungrounded manner, without relying on external data sources or retrieval-augmented generation techniques. The LLM has been trained on a vast corpus of text data, enabling it to generate coherent and contextually relevant responses solely based on the input provided. This approach allows for open-ended and creative generation, making it suitable for tasks such as ideation, brainstorming, and exploring hypothetical scenarios. It's important to note that the generated responses are not grounded in specific factual data and should be evaluated critically, especially in domains where accuracy and verifiability are paramount.
51+
52+
## Work and Web
53+
It offers 3 response options: one generated through our retrieval-augmented generation (RAG) pipeline, and the other grounded in content directly from the web. When users opt for the RAG response, they receive a grounded answer sourced from your data, complete with citations to document chunks for transparency and verification. Conversely, selecting the web response provides access to a broader range of sources, potentially offering more diverse perspectives. Each web response is grounded in content from the web accompanied by citations of web links, allowing users to explore the original sources for further context and validation. Upon request, It can also generate a final response that compares and contrasts both responses. This comparative analysis allows users to make informed decisions based on the reliability, relevance, and context of the information provided.
54+
Specific information about our Grounded and Web can be found in [Web](/docs/features/features.md#bing-search-and-compare)
55+
56+
## Assistants
57+
It generates response by using LLM as a reasoning engine. The key strength lies in agent's ability to autonomously reason about tasks, decompose them into steps, and determine the appropriate tools and data sources to leverage, all without the need for predefined task definitions or rigid workflows. This approach allows for a dynamic and adaptive response generation process without predefining set of tasks. It harnesses the capabilities of LLM to understand natural language queries and generate responses tailored to specific tasks. These Agents are being released in preview mode as we continue to evaluate and mitigate the potential risks associated with autonomous reasoning, such as misuse of external tools, lack of transparency, biased outputs, privacy concerns, and remote code execution vulnerabilities. With future releases, we plan to work to enhance the safety and robustness of these autonomous reasoning capabilities. Specific information on our preview agents can be found in [Assistants](/docs/features/features.md#autonomous-reasoning-with-assistants-agents).
58+
59+
4260
## Features
4361

4462
The IA Accelerator contains several features, many of which have their own documentation.
4563

4664
- Examples of custom Retrieval Augmented Generation (RAG), Prompt Engineering, and Document Pre-Processing
4765
- Azure AI Search Integration to include text search of both text documents and images
4866
- Customization and Personalization to enable enhanced AI interaction
67+
- Preview into autonomous agents
4968

5069
For a detailed review see our [Features](./docs/features/features.md) page.
5170

52-
![Process Flow](/docs/process_flow.png)
71+
### Process Flow for Work(Grounded), Ungrounded, and Work and Web
72+
73+
![Process Flow for Chat](/docs/process_flow_chat.png)
74+
75+
### Process Flow for Assistants
76+
77+
![Process Flow for Assistants](/docs/process_flow_agent.png)
5378

5479
## Azure account requirements
5580

@@ -61,7 +86,7 @@ For a detailed review see our [Features](./docs/features/features.md) page.
6186

6287
Model Name | Supported Versions
6388
---|---
64-
gpt-35-turbo | 0301, 0613
89+
gpt-35-turbo | current version
6590
**gpt-35-turbo-16k** | current version
6691
**gpt-4** | current version
6792
gpt-4-32k | current version
@@ -97,6 +122,20 @@ The Information Assistant (IA) Accelerator and Microsoft are committed to the ad
97122

98123
Find out more with Microsoft's [Responsible AI resources](https://www.microsoft.com/en-us/ai/responsible-ai)
99124

125+
### Content Safety
126+
127+
Content safety is provided through Azure Open AI service. The Azure OpenAI Service includes a content filtering system that runs alongside the core AI models. This system uses an ensemble of classification models to detect four categories of potentially harmful content (violence, hate, sexual, and self-harm) at four severity levels (safe, low, medium, high).These 4 categories may not be sufficient for all use cases, especially for minors. Please read our [Transaparncy Note](/docs/transparency.md)
128+
129+
By default, the content filters are set to filter out prompts and completions that are detected as medium or high severity for those four harm categories. Content labeled as low or safe severity is not filtered.
130+
131+
There are optional binary classifiers/filters that can detect jailbreak risk (trying to bypass filters) as well as existing text or code pulled from public repositories. These are turned off by default, but some scenarios may require enabling the public content detection models to retain coverage under the customer copyright commitment.
132+
133+
The filtering configuration can be customized at the resource level, allowing customers to adjust the severity thresholds for filtering each harm category separately for prompts and completions.
134+
135+
This provides controls for Azure customers to tailor the content filtering behavior to their needs while aiming to prevent potentially harmful generated content and any copyright violations from public content.
136+
137+
Instructions on how to confiure content filters via Azure OpenAI Studio can be found here <https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/content-filters#configuring-content-filters-via-azure-openai-studio-preview>
138+
100139
## Data Collection Notice
101140

102141
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
@@ -154,3 +193,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
154193
### Reporting Security Issues
155194

156195
For security concerns, please see [Security Guidelines](./SECURITY.md)
196+

0 commit comments

Comments
 (0)