@@ -11,10 +11,12 @@ $storageAccount = ""
1111$blobContainerForRetailCustomer = " "
1212$blobContainerForRetailOrder = " "
1313$blobContainerForRFP = " "
14+ $blobContainerForLegalContract = " "
1415$aiSearch = " "
1516$aiSearchIndexForRetailCustomer = " "
1617$aiSearchIndexForRetailOrder = " "
1718$aiSearchIndexForRFP = " "
19+ $aiSearchIndexForLegalContract = " "
1820$azSubscriptionId = " "
1921
2022function Test-AzdInstalled {
@@ -40,10 +42,12 @@ function Get-ValuesFromAzdEnv {
4042 $script :blobContainerForRetailCustomer = $ (azd env get-value AZURE_STORAGE_CONTAINER_NAME_RETAIL_CUSTOMER)
4143 $script :blobContainerForRetailOrder = $ (azd env get-value AZURE_STORAGE_CONTAINER_NAME_RETAIL_ORDER)
4244 $script :blobContainerForRFP = $ (azd env get-value AZURE_STORAGE_CONTAINER_NAME_RFP)
45+ $script :blobContainerForLegalContract = $ (azd env get-value AZURE_STORAGE_CONTAINER_NAME_LEGAL_CONTRACT)
4346 $script :aiSearch = $ (azd env get-value AZURE_AI_SEARCH_NAME)
4447 $script :aiSearchIndexForRetailCustomer = $ (azd env get-value AZURE_AI_SEARCH_INDEX_NAME_RETAIL_CUSTOMER)
4548 $script :aiSearchIndexForRetailOrder = $ (azd env get-value AZURE_AI_SEARCH_INDEX_NAME_RETAIL_ORDER)
4649 $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)
4751 $script :ResourceGroup = $ (azd env get-value AZURE_RESOURCE_GROUP)
4852
4953 # Validate that we got all required values
@@ -81,9 +85,11 @@ function Get-ValuesFromAzDeployment {
8185 $script :blobContainerForRetailCustomer = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RETAIL_CUSTOMER.value
8286 $script :blobContainerForRetailOrder = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RETAIL_ORDER.value
8387 $script :blobContainerForRFP = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_RFP.value
88+ $script :blobContainerForLegalContract = $deploymentOutputs.azurE_STORAGE_CONTAINER_NAME_LEGAL_CONTRACT.value
8489 $script :aiSearchIndexForRetailCustomer = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RETAIL_CUSTOMER.value
8590 $script :aiSearchIndexForRetailOrder = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RETAIL_ORDER.value
8691 $script :aiSearchIndexForRFP = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_RFP.value
92+ $script :aiSearchIndexForLegalContract = $deploymentOutputs.azurE_AI_SEARCH_INDEX_NAME_LEGAL_CONTRACT.value
8793 $script :aiSearch = $deploymentOutputs.azurE_AI_SEARCH_NAME.value
8894 $script :backendUrl = $deploymentOutputs.backenD_URL.value
8995
@@ -200,7 +206,8 @@ Write-Host "1. RFP Evaluation"
200206Write-Host " 2. Retail Customer Satisfaction"
201207Write-Host " 3. HR Employee Onboarding"
202208Write-Host " 4. Marketing Press Release"
203- Write-Host " 5. All"
209+ Write-Host " 5. Legal Contract Review"
210+ Write-Host " 6. All"
204211Write-Host " ==============================================="
205212Write-Host " "
206213
209216 $useCaseSelection = Read-Host " Please enter the number of the use case you would like to install."
210217
211218 # Handle both numeric and text input for 'all'
212- if ($useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ) {
219+ if ($useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ) {
213220 $selectedUseCase = " All"
214221 $useCaseValid = $true
215222 Write-Host " Selected: All use cases will be installed."
@@ -238,9 +245,15 @@ do {
238245 Write-Host " Selected: Marketing Press Release"
239246 Write-Host " Note: If you choose to install a single use case, installation of other use cases will require re-running this script."
240247 }
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+ }
241254 else {
242255 $useCaseValid = $false
243- Write-Host " Invalid selection. Please enter a number from 1-5 ." - ForegroundColor Red
256+ Write-Host " Invalid selection. Please enter a number from 1-6 ." - ForegroundColor Red
244257 }
245258} while (-not $useCaseValid )
246259
@@ -325,7 +338,7 @@ $isSampleDataFailed = $false
325338$failedTeamConfigs = 0
326339
327340# Use Case 3 -----=--
328- if ($useCaseSelection -eq " 3" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ) {
341+ if ($useCaseSelection -eq " 3" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ) {
329342 Write-Host " Uploading Team Configuration for HR Employee Onboarding..."
330343 $directoryPath = " data/agent_teams"
331344 $teamId = " 00000000-0000-0000-0000-000000000001"
@@ -344,7 +357,7 @@ if($useCaseSelection -eq "3" -or $useCaseSelection -eq "all" -or $useCaseSelecti
344357}
345358
346359# Use Case 4 -----=--
347- if ($useCaseSelection -eq " 4" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ) {
360+ if ($useCaseSelection -eq " 4" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ) {
348361 Write-Host " Uploading Team Configuration for Marketing Press Release..."
349362 $directoryPath = " data/agent_teams"
350363 $teamId = " 00000000-0000-0000-0000-000000000002"
@@ -365,7 +378,7 @@ if($useCaseSelection -eq "4" -or $useCaseSelection -eq "all" -or $useCaseSelecti
365378$stIsPublicAccessDisabled = $false
366379$srchIsPublicAccessDisabled = $false
367380# Enable public access for resources
368- if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " 2" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ){
381+ if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " 2" -or $useCaseSelection -eq " 5 " -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ){
369382 if ($ResourceGroup ) {
370383 $stPublicAccess = $ (az storage account show -- name $storageAccount -- resource- group $ResourceGroup -- query " publicNetworkAccess" - o tsv)
371384 if ($stPublicAccess -eq " Disabled" ) {
@@ -399,7 +412,7 @@ if($useCaseSelection -eq "1"-or $useCaseSelection -eq "2" -or $useCaseSelection
399412
400413
401414
402- if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ) {
415+ if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ) {
403416 Write-Host " Uploading Team Configuration for RFP Evaluation..."
404417 $directoryPath = " data/agent_teams"
405418 $teamId = " 00000000-0000-0000-0000-000000000004"
@@ -439,7 +452,48 @@ if($useCaseSelection -eq "1" -or $useCaseSelection -eq "all" -or $useCaseSelecti
439452 Write-Host " Python script to index data for RFP Evaluation successfully executed."
440453}
441454
442- if ($useCaseSelection -eq " 2" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5" ) {
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" ) {
443497 Write-Host " Uploading Team Configuration for Retail Customer Satisfaction..."
444498 $directoryPath = " data/agent_teams"
445499 $teamId = " 00000000-0000-0000-0000-000000000003"
@@ -522,7 +576,7 @@ if ($isTeamConfigFailed -or $isSampleDataFailed) {
522576 Write-Host " `n One or more tasks failed. Please check the error messages above."
523577 exit 1
524578} else {
525- if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " 2" -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 5 " ){
579+ if ($useCaseSelection -eq " 1" -or $useCaseSelection -eq " 2" -or $useCaseSelection -eq " 5 " -or $useCaseSelection -eq " all" -or $useCaseSelection -eq " 6 " ){
526580 Write-Host " `n Team configuration upload and sample data processing completed successfully."
527581 }else {
528582 Write-Host " `n Team configuration upload completed successfully."
0 commit comments