Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
af95d75
test: DocGen-fixed pylint issues
Ritesh-Microsoft Jun 26, 2025
e2ef2db
fixed lint issue
AjitPadhi-Microsoft Jul 2, 2025
1bab811
Initial commit for AI search tool backend changes
Ragini-Microsoft Jul 2, 2025
485fbcb
Fetch content post api added
Ragini-Microsoft Jul 2, 2025
107f7bd
fixed lint issue
AjitPadhi-Microsoft Jul 2, 2025
3705cd3
pylint issue fixes
Ragini-Microsoft Jul 2, 2025
76c935d
Merge branch 'dev' of https://github.com/microsoft/document-generatio…
Ragini-Microsoft Jul 2, 2025
8d12049
fix: pipeline issue fix for pylint
Avijit-Microsoft Jul 2, 2025
47f1228
test: DocGen-Updated script to handle response status and draft valid…
Ritesh-Microsoft Jul 3, 2025
27611c9
test: DocGen-Updated script to handle response status and draft valid…
Avijit-Microsoft Jul 3, 2025
2c32de8
Updated the code for agent
Ragini-Microsoft Jul 4, 2025
e602e66
error handling added in fetch content
Ragini-Microsoft Jul 4, 2025
8294553
updated response structure for content fetch
Ragini-Microsoft Jul 4, 2025
2cf6181
Integrated citation API on click and implemented handling for the upd…
Rohini-Microsoft Jul 4, 2025
f697b2e
added loader before showing citation content dialouge
Rohini-Microsoft Jul 4, 2025
af95a2e
added condition for citation showing only chattype is browse
Rohini-Microsoft Jul 4, 2025
2368374
Merge branch 'main' of https://github.com/microsoft/document-generati…
Ragini-Microsoft Jul 4, 2025
10c6a8c
AI Search tool changes and removed open ai sdk
Ragini-Microsoft Jul 4, 2025
6f9408b
updated variable
Ragini-Microsoft Jul 4, 2025
678746e
removed search key from readme
Ragini-Microsoft Jul 4, 2025
9f571a0
removed duplicate parameter
VishalS-Microsoft Jul 4, 2025
1c5e596
Merge branch 'dev' of https://github.com/microsoft/document-generatio…
Ragini-Microsoft Jul 4, 2025
669a147
Merge pull request #489 from microsoft/psl-missingparameter-docgen
Roopan-Microsoft Jul 4, 2025
72b61ca
fixed the pylint issues in ui automation files
Ragini-Microsoft Jul 4, 2025
1e46840
Merge pull request #488 from microsoft/psl-aisearchtool-dev
Roopan-Microsoft Jul 7, 2025
81bfbcd
modify test cases according to new response
Rohini-Microsoft Jul 10, 2025
6b1fb65
fix: unit test cases modified as per the new response
Avijit-Microsoft Jul 10, 2025
bf2191c
feat: AI Search Tool changes in Docgen
Avijit-Microsoft Jul 10, 2025
5d94f0d
Updated DeploymentGuide.md and azure.yml file
NirajC-Microsoft Jul 10, 2025
64dbe85
Merge pull request #494 from microsoft/psl-dg-azdupgrade
Roopan-Microsoft Jul 10, 2025
a2bce82
Merge pull request #495 from microsoft/dev
Roopan-Microsoft Jul 11, 2025
56076f1
updated the gpt model name in readme file
Priyanka-Microsoft Jul 11, 2025
f126101
Merge pull request #496 from microsoft/fix-changed-model-name-readme
Roopan-Microsoft Jul 11, 2025
bc4b368
added workflow for telemetry template check in azure.yaml file while …
Dhruvkumar-Microsoft Jul 11, 2025
3ca95fc
Added templateName tag on rg
Ragini-Microsoft Jul 11, 2025
8c59836
updated tag value
Ragini-Microsoft Jul 11, 2025
d30ab00
Updated tag name typo
Ragini-Microsoft Jul 11, 2025
f348e9b
Updated the checkout version
Dhruvkumar-Microsoft Jul 11, 2025
f666ab1
updated gpt model capacity and fixed aideployment location issue
Priyanka-Microsoft Jul 11, 2025
6131fe6
Merge pull request #497 from microsoft/rc-templatetag-dg-main
Roopan-Microsoft Jul 11, 2025
1f5153f
Merge pull request #498 from microsoft/psl-us-20458
Roopan-Microsoft Jul 11, 2025
2e3f6ac
Merge pull request #499 from microsoft/fix-aiDeploymentsLocation-para…
Roopan-Microsoft Jul 11, 2025
f7efc16
Merge branch 'dev' of https://github.com/microsoft/document-generatio…
Ragini-Microsoft Jul 15, 2025
136cbd5
updates for existing AI Foundry in Bicep & scripts
Ragini-Microsoft Jul 15, 2025
5acd3af
rebuilt main.json
Ragini-Microsoft Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT

env:
GPT_MIN_CAPACITY: 250
TEXT_EMBEDDING_MIN_CAPACITY: 40
GPT_MIN_CAPACITY: 150
TEXT_EMBEDDING_MIN_CAPACITY: 80
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
Expand Down Expand Up @@ -148,6 +148,7 @@ jobs:
gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} \
embeddingModel="text-embedding-ada-002" \
embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} \
aiDeploymentsLocation=${{ env.AZURE_LOCATION }} \
imageTag="${IMAGE_TAG}"

- name: Get Deployment Output and extract Values
Expand All @@ -169,6 +170,8 @@ jobs:
echo "COSMOSDB_ACCOUNT_NAME=$COSMOSDB_ACCOUNT_NAME" >> $GITHUB_ENV
AI_FOUNDRY_NAME=$(echo $BICEP_OUTPUT | jq -r '.aI_FOUNDRY_NAME.value')
echo "AI_FOUNDRY_NAME=$AI_FOUNDRY_NAME" >> $GITHUB_ENV
AI_SEARCH_SERVICE_NAME=$(echo $BICEP_OUTPUT | jq -r '.aI_SEARCH_SERVICE_NAME.value')
echo "AI_SEARCH_SERVICE_NAME=$AI_SEARCH_SERVICE_NAME" >> $GITHUB_ENV
echo "Deployment output: $BICEP_OUTPUT"

- name: Run Post-Deployment Script
Expand All @@ -186,6 +189,7 @@ jobs:
"${{ env.KEY_VAULT_NAME }}" \
"${{ env.RESOURCE_GROUP_NAME }}" \
"${{ env.AI_FOUNDRY_NAME }}" \
"${{ env.AI_SEARCH_SERVICE_NAME }}" \
"${{ secrets.AZURE_CLIENT_ID }}"

- name: Logout from Azure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- name: Pylint
run: |
echo "Running Pylint..."
python -m flake8 --config=.flake8 --verbose .
python -m flake8 --config=.flake8 --exclude=tests --verbose .

30 changes: 30 additions & 0 deletions .github/workflows/telemetry-template-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: validate template property for telemetry

on:
pull_request:
branches:
- main
paths:
- 'azure.yaml'

jobs:
validate-template-property:
name: validate-template-property
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for required metadata template line
run: |
if grep -E '^\s*#\s*template:\s*document-generation@1\.0' azure.yaml; then
echo "ERROR: 'template' line is commented out in azure.yaml! Please uncomment template line."
exit 1
fi

if ! grep -E '^\s*template:\s*document-generation@1\.0' azure.yaml; then
echo "ERROR: Required 'template' line is missing in azure.yaml! Please add template line for telemetry."
exit 1
fi
echo "template line is present and not commented."
3 changes: 3 additions & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: document-generation
metadata:
template: document-generation@1.0

requiredVersions:
azd: '>= 1.15.0'

parameters:
solutionPrefix:
type: string
Expand Down
4 changes: 2 additions & 2 deletions docs/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ If you're not using one of the above options for opening the project, then you'l

1. Make sure the following tools are installed:
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux. (Required for Windows users only. Follow the steps [here](./PowershellSetup.md) to add it to the Windows PATH.)
- [Azure Developer CLI (azd)](https://aka.ms/install-azd)
- [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.15.0+)</small> - version
- [Python 3.9+](https://www.python.org/downloads/)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [Git](https://git-scm.com/downloads)
Expand Down Expand Up @@ -175,7 +175,7 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
```
If you don't have azd env then you need to pass parameters along with the command. Then the command will look like the following:
```shell
bash ./infra/scripts/process_sample_data.sh <Storage-Account-name> <Storage-Account-container-name> <Key-Vault-name> <CosmosDB-Account-name> <Resource-Group-name> <aiFoundryResourceName>
bash ./infra/scripts/process_sample_data.sh <Storage-Account-name> <Storage-Account-container-name> <Key-Vault-name> <CosmosDB-Account-name> <Resource-Group-name> <AI-Foundry-Name> <AI-Foundry-Resource-Group-Name> <Search-Service-Name>
```

6. 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`.
Expand Down
12 changes: 6 additions & 6 deletions docs/QuotaCheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ azd auth login

### 📌 Default Models & Capacities:
```
gpt-4.1:30, text-embedding-ada-002:80, gpt-4:30
gpt4.1:150, text-embedding-ada-002:80, gpt-4:150
```
### 📌 Default Regions:
```
eastus, uksouth, eastus2, northcentralus, swedencentral, westus, westus2, southcentralus, canadacentral
francecentral, australiaeast, uksouth, eastus2, northcentralus, swedencentral, westus, westus2, southcentralus
```
### Usage Scenarios:
- No parameters passed → Default models and capacities will be checked in default regions.
Expand All @@ -40,19 +40,19 @@ eastus, uksouth, eastus2, northcentralus, swedencentral, westus, westus2, southc
```
✔️ Check specific model(s) in default regions:
```
./quota_check_params.sh --models gpt-4.1:30,text-embedding-ada-002:80
./quota_check_params.sh --models gpt4.1:150,text-embedding-ada-002:80
```
✔️ Check default models in specific region(s):
```
./quota_check_params.sh --regions eastus,westus
./quota_check_params.sh --regions eastus2,westus
```
✔️ Passing Both models and regions:
```
./quota_check_params.sh --models gpt-4.1:30 --regions eastus,westus2
./quota_check_params.sh --models gpt4.1:150 --regions eastus2,westus2
```
✔️ All parameters combined:
```
./quota_check_params.sh --models gpt-4:30,text-embedding-ada-002:80 --regions eastus,westus --verbose
./quota_check_params.sh --models gpt-4:150,text-embedding-ada-002:80 --regions eastus2,westus --verbose
```

### **Sample Output**
Expand Down
3 changes: 0 additions & 3 deletions docs/README_LOCAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ NOTE: You may find you need to set: MacOS: `export NODE_OPTIONS="--max-old-space
- `DATASOURCE_TYPE` (should be set to `AzureCognitiveSearch`)
- `AZURE_SEARCH_SERVICE`
- `AZURE_SEARCH_INDEX`
- `AZURE_SEARCH_KEY`

These variables are optional:
- `AZURE_SEARCH_USE_SEMANTIC_SEARCH`
Expand Down Expand Up @@ -178,7 +177,6 @@ Note: settings starting with `AZURE_SEARCH` are only needed when using Azure Ope
|AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME||The name of the gpt model|
|AZURE_SEARCH_SERVICE||The name of your Azure AI Search resource|
|AZURE_SEARCH_INDEX||The name of your Azure AI Search Index|
|AZURE_SEARCH_KEY||An **admin key** for your Azure AI Search resource|
|AZURE_SEARCH_USE_SEMANTIC_SEARCH|False|Whether or not to use semantic search|
|AZURE_SEARCH_QUERY_TYPE|simple|Query type: simple, semantic, vector, vectorSimpleHybrid, or vectorSemanticHybrid. Takes precedence over AZURE_SEARCH_USE_SEMANTIC_SEARCH|
|AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG||The name of the semantic search configuration to use if using semantic search.|
Expand Down Expand Up @@ -212,7 +210,6 @@ Note: settings starting with `AZURE_SEARCH` are only needed when using Azure Ope
|UI_SHOW_SHARE_BUTTON|True|Share button (right-top)
|SANITIZE_ANSWER|False|Whether to sanitize the answer from Azure OpenAI. Set to True to remove any HTML tags from the response.|
|USE_PROMPTFLOW|False|Use existing Promptflow deployed endpoint. If set to `True` then both `PROMPTFLOW_ENDPOINT` and `PROMPTFLOW_API_KEY` also need to be set.|
|USE_AI_FOUNDRY_SDK|False|Boolean flag to determine whether to use the AI Foundry SDK instead of the OpenAI SDK.|
|PROMPTFLOW_ENDPOINT||URL of the deployed Promptflow endpoint e.g. https://pf-deployment-name.region.inference.ml.azure.com/score|
|PROMPTFLOW_API_KEY||Auth key for deployed Promptflow endpoint. Note: only Key-based authentication is supported.|
|PROMPTFLOW_RESPONSE_TIMEOUT|120|Timeout value in seconds for the Promptflow endpoint to respond.|
Expand Down
102 changes: 57 additions & 45 deletions infra/deploy_ai_foundry.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var aiProjectFriendlyName = aiProjectName
var aiProjectDescription = 'AI Foundry Project'
var aiSearchName = '${abbrs.ai.aiSearch}${solutionName}'
var workspaceName = '${abbrs.managementGovernance.logAnalyticsWorkspace}${solutionName}'
// var aiSearchConnectionName = 'myVectorStoreProjectConnectionName-${solutionName}'

var useExisting = !empty(existingLogAnalyticsWorkspaceId)
var existingLawSubscription = useExisting ? split(existingLogAnalyticsWorkspaceId, '/')[2] : ''
Expand Down Expand Up @@ -111,6 +112,11 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
}
}

resource existingAiFoundry 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = if (!empty(azureExistingAIProjectResourceId)) {
name: existingAIFoundryName
scope: resourceGroup(existingAIServiceSubscription, existingAIServiceResourceGroup)
}

resource aiFoundry 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = if (empty(azureExistingAIProjectResourceId)) {
name: aiFoundryName
location: location
Expand Down Expand Up @@ -148,49 +154,50 @@ resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04
}

@batchSize(1)
resource aiFModelDeployments 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = [for aiModeldeployment in aiModelDeployments: if (empty(azureExistingAIProjectResourceId)) {
parent: aiFoundry
name: aiModeldeployment.name
properties: {
model: {
format: 'OpenAI'
name: aiModeldeployment.model
resource aiFModelDeployments 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = [
for aiModeldeployment in aiModelDeployments: if (empty(azureExistingAIProjectResourceId)) {
parent: aiFoundry
name: aiModeldeployment.name
properties: {
model: {
format: 'OpenAI'
name: aiModeldeployment.model
}
raiPolicyName: aiModeldeployment.raiPolicyName
}
sku: {
name: aiModeldeployment.sku.name
capacity: aiModeldeployment.sku.capacity
}
raiPolicyName: aiModeldeployment.raiPolicyName
}
sku:{
name: aiModeldeployment.sku.name
capacity: aiModeldeployment.sku.capacity
}
}]
]

resource aiSearch 'Microsoft.Search/searchServices@2024-06-01-preview' = {
name: aiSearchName
location: solutionLocation
sku: {
name: 'basic'
name: aiSearchName
location: solutionLocation
sku: {
name: 'basic'
}
identity: {
type: 'SystemAssigned'
}
properties: {
replicaCount: 1
partitionCount: 1
hostingMode: 'default'
publicNetworkAccess: 'enabled'
networkRuleSet: {
ipRules: []
}
properties: {
replicaCount: 1
partitionCount: 1
hostingMode: 'default'
publicNetworkAccess: 'enabled'
networkRuleSet: {
ipRules: []
}
encryptionWithCmk: {
enforcement: 'Unspecified'
}
disableLocalAuth: false
authOptions: {
apiKeyOnly: {}
}
semanticSearch: 'free'
encryptionWithCmk: {
enforcement: 'Unspecified'
}
disableLocalAuth: true
semanticSearch: 'free'
}
}

resource aiSearchFoundryConnection 'Microsoft.CognitiveServices/accounts/projects/connections@2025-04-01-preview' = if (empty(azureExistingAIProjectResourceId)) {
// name: 'foundry-search-connection'
name: aiSearchConnectionName
parent: aiFoundryProject
properties: {
Expand Down Expand Up @@ -308,7 +315,7 @@ resource azureOpenAIApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-0
parent: keyVault
name: 'AZURE-OPENAI-PREVIEW-API-VERSION'
properties: {
value: azureOpenaiAPIVersion //'2024-02-15-preview'
value: azureOpenaiAPIVersion //'2024-02-15-preview'
}
}

Expand All @@ -322,12 +329,11 @@ resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-
}
}


resource azureSearchAdminKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
resource azureOpenAIEmbeddingDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-SEARCH-KEY'
name: 'AZURE-OPENAI-EMBEDDING-MODEL'
properties: {
value: aiSearch.listAdminKeys().primaryKey
value: embeddingModel
}
}

Expand Down Expand Up @@ -359,23 +365,27 @@ resource cogServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-p
parent: keyVault
name: 'COG-SERVICES-ENDPOINT'
properties: {
value: aiFoundry.properties.endpoint
value: !empty(existingOpenAIEndpoint)
? existingOpenAIEndpoint
: aiFoundry.properties.endpoint
}
}

resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'COG-SERVICES-KEY'
properties: {
value: aiFoundry.listKeys().key1
value: !empty(existingOpenAIEndpoint)
? existingAiFoundry.listKeys().key1
: aiFoundry.listKeys().key1
}
}

resource cogServiceNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'COG-SERVICES-NAME'
properties: {
value: aiFoundryName
value: !empty(existingAIFoundryName) ? existingAIFoundryName : aiFoundryName
}
}

Expand Down Expand Up @@ -406,14 +416,15 @@ resource azureLocatioEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview
output keyvaultName string = keyvaultName
output keyvaultId string = keyVault.id

output aiServicesTarget string = aiFoundry.properties.endpoint //aiServices_m.properties.endpoint
output aiServicesName string = aiFoundryName //aiServicesName_m
output aiServicesId string = aiFoundry.id //aiServices_m.id
// output aiServicesTarget string = aiFoundry.properties.endpoint //aiServices_m.properties.endpoint
// output aiServicesName string = aiFoundryName //aiServicesName_m
// output aiServicesId string = aiFoundry.id //aiServices_m.id

output aiSearchName string = aiSearchName
output aiSearchId string = aiSearch.id
output aiSearchTarget string = 'https://${aiSearch.name}.search.windows.net'
output aiSearchService string = aiSearch.name
output aiSearchConnectionName string = aiSearchConnectionName
output aiFoundryProjectName string = !empty(existingAIProjectName) ? existingAIProjectName : aiFoundryProject.name
// output aiFoundryProjectEndpoint string = aiFoundryProject.properties.endpoints['AI Foundry API']
output aiFoundryProjectEndpoint string = !empty(existingProjEndpoint)
Expand All @@ -424,6 +435,7 @@ output aoaiEndpoint string = !empty(existingOpenAIEndpoint)
? existingOpenAIEndpoint
: aiFoundry.properties.endpoints['OpenAI Language Model Instance API']
output aiFoundryName string = !empty(existingAIFoundryName) ? existingAIFoundryName : aiFoundryName
output aiFoundryRgName string = !empty(existingAIServiceResourceGroup) ? existingAIServiceResourceGroup : resourceGroup().name

output applicationInsightsId string = applicationInsights.id
output logAnalyticsWorkspaceResourceName string = useExisting ? existingLogAnalyticsWorkspace.name : logAnalytics.name
Expand Down
Loading