Skip to content

Commit cf77e12

Browse files
Revert "updated the post deployment script for Legal Cotract scenario"
This reverts commit 540e731.
1 parent 540e731 commit cf77e12

File tree

4 files changed

+11
-74
lines changed

4 files changed

+11
-74
lines changed

infra/main.bicep

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,6 @@ param storageContainerName string = 'sample-dataset'
15351535
param storageContainerNameRetailCustomer string = 'retail-dataset-customer'
15361536
param storageContainerNameRetailOrder string = 'retail-dataset-order'
15371537
param storageContainerNameRFP string = 'rfp-dataset'
1538-
param storageContainerNameLegalContract string = 'legal-contract-dataset'
15391538
module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
15401539
name: take('avm.res.storage.storage-account.${storageAccountName}', 64)
15411540
params: {
@@ -1605,10 +1604,6 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
16051604
name: storageContainerNameRFP
16061605
publicAccess: 'None'
16071606
}
1608-
{
1609-
name: storageContainerNameLegalContract
1610-
publicAccess: 'None'
1611-
}
16121607
]
16131608
deleteRetentionPolicyDays: 9
16141609
deleteRetentionPolicyEnabled: true
@@ -1620,7 +1615,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
16201615
// ========== Search Service ========== //
16211616

16221617
var searchServiceName = 'srch-${solutionSuffix}'
1623-
var aiSearchIndexNameForLegalContract = 'sample-dataset-index'
1618+
var aiSearchIndexName = 'sample-dataset-index'
16241619
var aiSearchIndexNameForRetailCustomer = 'macae-retail-customer-index'
16251620
var aiSearchIndexNameForRetailOrder = 'macae-retail-order-index'
16261621
var aiSearchIndexNameForRFP = 'macae-rfp-index'
@@ -1827,9 +1822,7 @@ output AZURE_DEV_COLLECT_TELEMETRY string = 'no'
18271822
output AZURE_STORAGE_CONTAINER_NAME_RETAIL_CUSTOMER string = storageContainerNameRetailCustomer
18281823
output AZURE_STORAGE_CONTAINER_NAME_RETAIL_ORDER string = storageContainerNameRetailOrder
18291824
output AZURE_STORAGE_CONTAINER_NAME_RFP string = storageContainerNameRFP
1830-
output AZURE_STORAGE_CONTAINER_NAME_LEGAL_CONTRACT string = storageContainerNameLegalContract
18311825
output AZURE_AI_SEARCH_INDEX_NAME_RETAIL_CUSTOMER string = aiSearchIndexNameForRetailCustomer
18321826
output AZURE_AI_SEARCH_INDEX_NAME_RETAIL_ORDER string = aiSearchIndexNameForRetailOrder
18331827
output AZURE_AI_SEARCH_INDEX_NAME_RFP string = aiSearchIndexNameForRFP
1834-
output AZURE_AI_SEARCH_INDEX_NAME_LEGAL_CONTRACT string = aiSearchIndexNameForLegalContract
18351828

infra/scripts/Selecting-Team-Config-And-Data.ps1

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ $storageAccount = ""
1111
$blobContainerForRetailCustomer = ""
1212
$blobContainerForRetailOrder = ""
1313
$blobContainerForRFP = ""
14-
$blobContainerForLegalContract = ""
1514
$aiSearch = ""
1615
$aiSearchIndexForRetailCustomer = ""
1716
$aiSearchIndexForRetailOrder = ""
1817
$aiSearchIndexForRFP = ""
19-
$aiSearchIndexForLegalContract = ""
2018
$azSubscriptionId = ""
2119

2220
function Test-AzdInstalled {
@@ -42,12 +40,10 @@ function Get-ValuesFromAzdEnv {
4240
$script:blobContainerForRetailCustomer = $(azd env get-value AZURE_STORAGE_CONTAINER_NAME_RETAIL_CUSTOMER)
4341
$script:blobContainerForRetailOrder = $(azd env get-value AZURE_STORAGE_CONTAINER_NAME_RETAIL_ORDER)
4442
$script:blobContainerForRFP = $(azd env get-value AZURE_STORAGE_CONTAINER_NAME_RFP)
45-
$script:blobContainerForLegalContract = $(azd env get-value AZURE_STORAGE_CONTAINER_NAME_LEGAL_CONTRACT)
4643
$script:aiSearch = $(azd env get-value AZURE_AI_SEARCH_NAME)
4744
$script:aiSearchIndexForRetailCustomer = $(azd env get-value AZURE_AI_SEARCH_INDEX_NAME_RETAIL_CUSTOMER)
4845
$script:aiSearchIndexForRetailOrder = $(azd env get-value AZURE_AI_SEARCH_INDEX_NAME_RETAIL_ORDER)
4946
$script:aiSearchIndexForRFP = $(azd env get-value AZURE_AI_SEARCH_INDEX_NAME_RFP)
50-
$script:aiSearchIndexForLegalContract = $(azd env get-value AZURE_AI_SEARCH_INDEX_NAME_LEGAL_CONTRACT)
5147
$script:ResourceGroup = $(azd env get-value AZURE_RESOURCE_GROUP)
5248

5349
# Validate that we got all required values
@@ -85,11 +81,9 @@ function Get-ValuesFromAzDeployment {
8581
$script:blobContainerForRetailCustomer = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RETAIL_CUSTOMER.value
8682
$script:blobContainerForRetailOrder = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RETAIL_ORDER.value
8783
$script:blobContainerForRFP = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RFP.value
88-
$script:blobContainerForLegalContract = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_LEGAL_CONTRACT.value
8984
$script:aiSearchIndexForRetailCustomer = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RETAIL_CUSTOMER.value
9085
$script:aiSearchIndexForRetailOrder = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RETAIL_ORDER.value
9186
$script:aiSearchIndexForRFP = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RFP.value
92-
$script:aiSearchIndexForLegalContract = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_LEGAL_CONTRACT.value
9387
$script:aiSearch = $deploymentOutputs.azurE_AI_SEARCH_NAME.value
9488
$script:backendUrl = $deploymentOutputs.backenD_URL.value
9589

@@ -206,8 +200,7 @@ Write-Host "1. RFP Evaluation"
206200
Write-Host "2. Retail Customer Satisfaction"
207201
Write-Host "3. HR Employee Onboarding"
208202
Write-Host "4. Marketing Press Release"
209-
Write-Host "5. Legal Contract Review"
210-
Write-Host "6. All"
203+
Write-Host "5. All"
211204
Write-Host "==============================================="
212205
Write-Host ""
213206

@@ -216,7 +209,7 @@ do {
216209
$useCaseSelection = Read-Host "Please enter the number of the use case you would like to install."
217210

218211
# Handle both numeric and text input for 'all'
219-
if ($useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
212+
if ($useCaseSelection -eq "all" -or $useCaseSelection -eq "5") {
220213
$selectedUseCase = "All"
221214
$useCaseValid = $true
222215
Write-Host "Selected: All use cases will be installed."
@@ -245,15 +238,9 @@ do {
245238
Write-Host "Selected: Marketing Press Release"
246239
Write-Host "Note: If you choose to install a single use case, installation of other use cases will require re-running this script."
247240
}
248-
elseif ($useCaseSelection -eq "5") {
249-
$selectedUseCase = "Legal Contract Review"
250-
$useCaseValid = $true
251-
Write-Host "Selected: Legal Contract Review"
252-
Write-Host "Note: If you choose to install a single use case, installation of other use cases will require re-running this script."
253-
}
254241
else {
255242
$useCaseValid = $false
256-
Write-Host "Invalid selection. Please enter a number from 1-6." -ForegroundColor Red
243+
Write-Host "Invalid selection. Please enter a number from 1-5." -ForegroundColor Red
257244
}
258245
} while (-not $useCaseValid)
259246

@@ -338,7 +325,7 @@ $isSampleDataFailed = $false
338325
$failedTeamConfigs = 0
339326

340327
# Use Case 3 -----=--
341-
if($useCaseSelection -eq "3" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
328+
if($useCaseSelection -eq "3" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5") {
342329
Write-Host "Uploading Team Configuration for HR Employee Onboarding..."
343330
$directoryPath = "data/agent_teams"
344331
$teamId = "00000000-0000-0000-0000-000000000001"
@@ -357,7 +344,7 @@ if($useCaseSelection -eq "3" -or $useCaseSelection -eq "all" -or $useCaseSelecti
357344
}
358345

359346
# Use Case 4 -----=--
360-
if($useCaseSelection -eq "4" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
347+
if($useCaseSelection -eq "4" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5") {
361348
Write-Host "Uploading Team Configuration for Marketing Press Release..."
362349
$directoryPath = "data/agent_teams"
363350
$teamId = "00000000-0000-0000-0000-000000000002"
@@ -378,7 +365,7 @@ if($useCaseSelection -eq "4" -or $useCaseSelection -eq "all" -or $useCaseSelecti
378365
$stIsPublicAccessDisabled = $false
379366
$srchIsPublicAccessDisabled = $false
380367
# Enable public access for resources
381-
if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection -eq "5" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6"){
368+
if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5"){
382369
if ($ResourceGroup) {
383370
$stPublicAccess = $(az storage account show --name $storageAccount --resource-group $ResourceGroup --query "publicNetworkAccess" -o tsv)
384371
if ($stPublicAccess -eq "Disabled") {
@@ -412,7 +399,7 @@ if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection
412399

413400

414401

415-
if($useCaseSelection -eq "1" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
402+
if($useCaseSelection -eq "1" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5") {
416403
Write-Host "Uploading Team Configuration for RFP Evaluation..."
417404
$directoryPath = "data/agent_teams"
418405
$teamId = "00000000-0000-0000-0000-000000000004"
@@ -452,48 +439,7 @@ if($useCaseSelection -eq "1" -or $useCaseSelection -eq "all" -or $useCaseSelecti
452439
Write-Host "Python script to index data for RFP Evaluation successfully executed."
453440
}
454441

455-
456-
if($useCaseSelection -eq "5" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
457-
Write-Host "Uploading Team Configuration for Legal Contract..."
458-
$directoryPath = "data/agent_teams"
459-
$teamId = "00000000-0000-0000-0000-000000000005"
460-
try {
461-
$process = Start-Process -FilePath $pythonCmd -ArgumentList "infra/scripts/upload_team_config.py", $backendUrl, $directoryPath, $userPrincipalId, $teamId -Wait -NoNewWindow -PassThru
462-
if ($process.ExitCode -ne 0) {
463-
Write-Host "Error: Team configuration for Legal Contract upload failed."
464-
$failedTeamConfigs += 1
465-
$isTeamConfigFailed = $true
466-
}
467-
} catch {
468-
Write-Host "Error: Uploading team configuration failed."
469-
$isTeamConfigFailed = $true
470-
}
471-
Write-Host "Uploaded Team Configuration for Legal Contract..."
472-
473-
$directoryPath = "data/datasets/legal_contract"
474-
# Upload sample files to blob storage
475-
Write-Host "Uploading sample files to blob storage for Legal Contract..."
476-
$result = az storage blob upload-batch --account-name $storageAccount --destination $blobContainerForLegalContract --source $directoryPath --auth-mode login --pattern "*" --overwrite --output none
477-
478-
if ($LASTEXITCODE -ne 0) {
479-
Write-Host "Error: Failed to upload files to blob storage."
480-
$isSampleDataFailed = $true
481-
exit 1
482-
}
483-
Write-Host "Files uploaded successfully to blob storage."
484-
485-
# Run the Python script to index data
486-
Write-Host "Running the python script to index data for Legal Contract"
487-
$process = Start-Process -FilePath $pythonCmd -ArgumentList "infra/scripts/index_datasets.py", $storageAccount, $blobContainerForLegalContract , $aiSearch, $aiSearchIndexForLegalContract -Wait -NoNewWindow -PassThru
488-
489-
if ($process.ExitCode -ne 0) {
490-
Write-Host "Error: Indexing python script execution failed."
491-
$isSampleDataFailed = $true
492-
}
493-
Write-Host "Python script to index data for Legal Contract successfully executed."
494-
}
495-
496-
if($useCaseSelection -eq "2" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6") {
442+
if($useCaseSelection -eq "2" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5") {
497443
Write-Host "Uploading Team Configuration for Retail Customer Satisfaction..."
498444
$directoryPath = "data/agent_teams"
499445
$teamId = "00000000-0000-0000-0000-000000000003"
@@ -576,7 +522,7 @@ if ($isTeamConfigFailed -or $isSampleDataFailed) {
576522
Write-Host "`nOne or more tasks failed. Please check the error messages above."
577523
exit 1
578524
} else {
579-
if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection -eq "5" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "6"){
525+
if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection -eq "all" -or $useCaseSelection -eq "5"){
580526
Write-Host "`nTeam configuration upload and sample data processing completed successfully."
581527
}else {
582528
Write-Host "`nTeam configuration upload completed successfully."

infra/scripts/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ azure-identity==1.24.0
33
azure-storage-blob==12.26.0
44
requests==2.32.5
55
azure-core
6-
PyPDF2
7-
python-docx
6+
PyPDF2

infra/scripts/upload_team_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def check_team_exists(backend_url, team_id, user_principal_id):
5151
("marketing.json", "00000000-0000-0000-0000-000000000002"),
5252
("retail.json", "00000000-0000-0000-0000-000000000003"),
5353
("rfp_analysis_team.json", "00000000-0000-0000-0000-000000000004"),
54-
("legal_contract_team.json", "00000000-0000-0000-0000-000000000005"),
5554
]
5655

5756
upload_endpoint = backend_url.rstrip('/') + '/api/v4/upload_team_config'

0 commit comments

Comments
 (0)