diff --git a/.gitignore b/.gitignore index 05bbf3b060..3778ecedf1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ .azure *_env +# Test files with credentials +test_auth.py + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/app/backend/requirements.txt b/app/backend/requirements.txt index ab502bb225..5618cc275f 100644 --- a/app/backend/requirements.txt +++ b/app/backend/requirements.txt @@ -76,7 +76,7 @@ certifi==2024.7.4 # httpx # msrest # requests -cffi==1.17.0 +cffi==1.16.0 # via cryptography charset-normalizer==3.3.2 # via requests @@ -86,7 +86,7 @@ click==8.3.0 # prompty # quart # uvicorn -cryptography==44.0.1 +cryptography==42.0.7 # via # -r requirements.in # azure-identity diff --git a/app/frontend/src/locales/en/translation.json b/app/frontend/src/locales/en/translation.json index 9976d143b9..d30d68f2d8 100644 --- a/app/frontend/src/locales/en/translation.json +++ b/app/frontend/src/locales/en/translation.json @@ -37,10 +37,10 @@ "chatEmptyStateTitle": "Chat with your data", "chatEmptyStateSubtitle": "Ask anything or try an example", "defaultExamples": { - "1": "What is included in my Northwind Health Plus plan that is not in standard?", - "2": "What happens in a performance review?", - "3": "What does a Product Manager do?", - "placeholder": "Type a new question (e.g. does my plan cover annual eye exams?)" + "1": "What are the guidelines for acceptable use of AI and ML tools?", + "2": "What is the company policy on conflicts of interest?", + "3": "What are the dos and don'ts for email communication?", + "placeholder": "Type a new question (e.g. what is the social media policy?)" }, "askTitle": "Ask your data", "multimodalExamples": { diff --git a/azure.yaml b/azure.yaml index f629d9a374..b7edda53b9 100644 --- a/azure.yaml +++ b/azure.yaml @@ -1,6 +1,6 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json -name: azure-search-openai-demo +name: azure-rag-auth metadata: template: azure-search-openai-demo@0.0.3 requiredVersions: @@ -20,24 +20,24 @@ services: prepackage: windows: shell: pwsh - run: cd ../frontend;npm install;npm run build + run: ../../scripts/build_frontend.ps1 interactive: false continueOnError: false posix: shell: sh - run: cd ../frontend;npm install;npm run build + run: ../../scripts/build_frontend.sh interactive: false continueOnError: false # This hook is called when Azure Container Apps is the host prebuild: windows: shell: pwsh - run: cd ../frontend;npm install;npm run build + run: ../../scripts/build_frontend.ps1 interactive: false continueOnError: false posix: shell: sh - run: cd ../frontend;npm install;npm run build + run: ../../scripts/build_frontend.sh interactive: false continueOnError: false hooks: @@ -55,11 +55,11 @@ hooks: postprovision: windows: shell: pwsh - run: ./scripts/auth_update.ps1;./scripts/prepdocs.ps1 + run: ./scripts/auth_update.ps1 && ./scripts/prepdocs.ps1 interactive: true continueOnError: false posix: shell: sh - run: ./scripts/auth_update.sh;./scripts/prepdocs.sh + run: ./scripts/auth_update.sh && ./scripts/prepdocs.sh interactive: true continueOnError: false diff --git a/data/Benefit_Options.pdf b/data/Benefit_Options.pdf deleted file mode 100644 index 6a4c07dc94..0000000000 Binary files a/data/Benefit_Options.pdf and /dev/null differ diff --git a/data/Contoso_Electronics_Company_Overview.md b/data/Contoso_Electronics_Company_Overview.md deleted file mode 100644 index 033d7dd84a..0000000000 --- a/data/Contoso_Electronics_Company_Overview.md +++ /dev/null @@ -1,48 +0,0 @@ -# Contoso Electronics - -*Disclaimer: This content is generated by AI and may not accurately represent factual information about any real entity. Use this information with caution and verify details from reliable sources.* - -## History - -Contoso Electronics, a pioneering force in the tech industry, was founded in 1985 by visionary entrepreneurs with a passion for innovation. Over the years, the company has played a pivotal role in shaping the landscape of consumer electronics. - -| Year | Milestone | -|------|-----------| -| 1985 | Company founded with a focus on cutting-edge technology | -| 1990 | Launched the first-ever handheld personal computer | -| 2000 | Introduced groundbreaking advancements in AI and robotics | -| 2015 | Expansion into sustainable and eco-friendly product lines | - -## Company Overview - -At Contoso Electronics, we take pride in fostering a dynamic and inclusive workplace. Our dedicated team of experts collaborates to create innovative solutions that empower and connect people globally. - -### Core Values - -- **Innovation:** Constantly pushing the boundaries of technology. -- **Diversity:** Embracing different perspectives for creative excellence. -- **Sustainability:** Committed to eco-friendly practices in our products. - -## Vacation Perks - -We believe in work-life balance and understand the importance of well-deserved breaks. Our vacation perks are designed to help our employees recharge and return with renewed enthusiasm. - -| Vacation Tier | Duration | Additional Benefits | -|---------------|----------|---------------------| -| Standard | 2 weeks | Health and wellness stipend | -| Senior | 4 weeks | Travel vouchers for a dream destination | -| Executive | 6 weeks | Luxury resort getaway with family | - -## Employee Recognition - -Recognizing the hard work and dedication of our employees is at the core of our culture. Here are some ways we celebrate achievements: - -- Monthly "Innovator of the Month" awards -- Annual gala with awards for outstanding contributions -- Team-building retreats for high-performing departments - -## Join Us! - -Contoso Electronics is always on the lookout for talented individuals who share our passion for innovation. If you're ready to be part of a dynamic team shaping the future of technology, check out our [careers page](http://www.contoso.com) for exciting opportunities. - -[Learn more about Contoso Electronics!](http://www.contoso.com) diff --git a/data/Json_Examples/2189.json b/data/Json_Examples/2189.json deleted file mode 100644 index d7066c9fbd..0000000000 --- a/data/Json_Examples/2189.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "AreaPath": "SmartHotel360", - "AssignedTo": null, - "Categories": null, - "ChangedDate": "2023-12-13T23:08:38.69Z", - "ClosedDate": null, - "CreatedDate": "2023-12-13T23:08:38.69Z", - "Description": "As a customer, I would like to reserve a conference room such that:

1. It should display available date and time slots
2. Give an option to reserve a conference room for X hours
3. One can reserve a conference room for max 4 hours per day
", - "Id": 2189, - "State": "New", - "StateChangeDate": "2023-12-13T23:08:38.69Z", - "Tags": "Reservation", - "Title": "As a customer, I would like to reserve a conference room" -} diff --git a/data/Json_Examples/2190.json b/data/Json_Examples/2190.json deleted file mode 100644 index 5a45f1158f..0000000000 --- a/data/Json_Examples/2190.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "AreaPath": "SmartHotel360", - "AssignedTo": null, - "Categories": null, - "ChangedDate": "2023-12-13T23:08:38.997Z", - "ClosedDate": null, - "CreatedDate": "2023-12-13T23:08:38.997Z", - "Description": "

Enter the guest's name to whom you would\nlike to send a confirmation, display the company, contact, source\nand agent associated\nwith the reservation.

", - "Id": 2190, - "State": "New", - "StateChangeDate": "2023-12-13T23:08:38.997Z", - "Tags": "Notification", - "Title": "As a reservation agent, I would like to send confirmations to guest" -} diff --git a/data/Json_Examples/2191.json b/data/Json_Examples/2191.json deleted file mode 100644 index 455e4c9a24..0000000000 --- a/data/Json_Examples/2191.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "AreaPath": "SmartHotel360", - "AssignedTo": null, - "Categories": null, - "ChangedDate": "2023-12-13T23:08:39.17Z", - "ClosedDate": null, - "CreatedDate": "2023-12-13T23:08:39.17Z", - "Description": "

If you have not picked up\nyour vehicle you can remove or cancel your reservation by clicking here.


1. Car reserved should have an option to cancel the request
2. Car driver should receive a notification about cancellation
", - "Id": 2191, - "State": "New", - "StateChangeDate": "2023-12-13T23:08:39.17Z", - "Tags": "Reservation", - "Title": "As a customer, I should be able to remove a car reservation " -} diff --git a/data/Json_Examples/2192.json b/data/Json_Examples/2192.json deleted file mode 100644 index d2e489f317..0000000000 --- a/data/Json_Examples/2192.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "AreaPath": "SmartHotel360", - "AssignedTo": null, - "Categories": null, - "ChangedDate": "2023-12-13T23:08:39.383Z", - "ClosedDate": null, - "CreatedDate": "2023-12-13T23:08:39.383Z", - "Description": "As a courtesy, grant an\nextra hour or two to leave the room, especially if it isn't booked\nfor the upcoming evening. But customer must call the front desk\nin advance and request a late checkout.


1. Late Check-in time should be displayed
2. Request should be sent to front-desk 
3. Any extra charge should be displayed
", - "Id": 2192, - "State": "New", - "StateChangeDate": "2023-12-13T23:08:39.383Z", - "Tags": "Front-desk; Members; Reservation", - "Title": "As a customer, I should be able to request hotel for late Check-out" -} diff --git a/data/Json_Examples/query.json b/data/Json_Examples/query.json deleted file mode 100644 index ceb9dc1a6f..0000000000 --- a/data/Json_Examples/query.json +++ /dev/null @@ -1,244 +0,0 @@ -[ - { - "fields": { - "System.Id": 2348, - "System.State": "New", - "System.Title": "Provide related items or frequently bought together section when people browse or search", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2348, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2348" - }, - { - "fields": { - "System.Id": 2349, - "System.State": "New", - "System.Title": "As tester, I need to test the website on all the relevant broswers and devices and be sure that it can handle our load.", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2349, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2349" - }, - { - "fields": { - "System.Id": 2350, - "System.State": "New", - "System.Title": "As a customer, I should be able to put items to shopping cart", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2350, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2350" - }, - { - "fields": { - "System.Id": 2351, - "System.State": "New", - "System.Title": "As a customer, I should be able to print my purchase order", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2351, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2351" - }, - { - "fields": { - "System.Id": 2352, - "System.State": "New", - "System.Title": "As a customer, I would like to have a sort capabaility by price and customer ratings", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2352, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2352" - }, - { - "fields": { - "System.Id": 2353, - "System.State": "New", - "System.Title": "Recommended products must be based on customer purchase pattern history", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2353, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2353" - }, - { - "fields": { - "System.Id": 2354, - "System.State": "New", - "System.Title": "As a customer, I would like to save my addresses so that I can easily select the address for delivery", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2354, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2354" - }, - { - "fields": { - "System.Id": 2355, - "System.State": "New", - "System.Title": "As marketer, I want to run an A|B test on alternative Web Sites using Application Insights.", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2355, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2355" - }, - { - "fields": { - "System.AssignedTo": { - "_links": { - "avatar": { - "href": "https://dev.azure.com/codebytes/_apis/GraphProfile/MemberAvatars/aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0" - } - }, - "descriptor": "aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0", - "displayName": "Chris Ayers", - "id": "cd8258ec-ad87-4c0d-9026-e5e343447185", - "imageUrl": "https://dev.azure.com/codebytes/_apis/GraphProfile/MemberAvatars/aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0", - "uniqueName": "chrisayers@microsoft.com", - "url": "https://spsprodeus27.vssps.visualstudio.com/A6b854e9d-a8be-405d-a4cc-5eb8e7027155/_apis/Identities/cd8258ec-ad87-4c0d-9026-e5e343447185" - }, - "System.Id": 2356, - "System.State": "Done", - "System.Title": "Provide customers the ability to track status of the package", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2356, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2356" - }, - { - "fields": { - "System.AssignedTo": { - "_links": { - "avatar": { - "href": "https://dev.azure.com/codebytes/_apis/GraphProfile/MemberAvatars/aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0" - } - }, - "descriptor": "aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0", - "displayName": "Chris Ayers", - "id": "cd8258ec-ad87-4c0d-9026-e5e343447185", - "imageUrl": "https://dev.azure.com/codebytes/_apis/GraphProfile/MemberAvatars/aad.ZDlhOGEyZjktMGZmZS03YjY4LTlkYjctNjk1ZWZiNGY2Nzg0", - "uniqueName": "chrisayers@microsoft.com", - "url": "https://spsprodeus27.vssps.visualstudio.com/A6b854e9d-a8be-405d-a4cc-5eb8e7027155/_apis/Identities/cd8258ec-ad87-4c0d-9026-e5e343447185" - }, - "System.Id": 2357, - "System.State": "Done", - "System.Title": "As a customer, I would like to have the ability to send my items as gift", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2357, - "relations": null, - "rev": 2, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2357" - }, - { - "fields": { - "System.Id": 2358, - "System.State": "Committed", - "System.Title": "As a customer, I would like to store my credit card details securely", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2358, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2358" - }, - { - "fields": { - "System.Id": 2359, - "System.State": "Committed", - "System.Title": "As a customer, I should be able to select different shipping option", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2359, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2359" - }, - { - "fields": { - "System.Id": 2360, - "System.State": "Committed", - "System.Title": "As developer, I want to use Azure Machine Learning to provide a recommendations engine behind the website.", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2360, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2360" - }, - { - "fields": { - "System.Id": 2361, - "System.State": "Committed", - "System.Title": "Provide tentative duration for shipping.", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2361, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2361" - }, - { - "fields": { - "System.Id": 2362, - "System.State": "Approved", - "System.Title": "Notify the user about any changes made to the order", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2362, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2362" - }, - { - "fields": { - "System.Id": 2363, - "System.State": "Approved", - "System.Title": "As a admin, I should be able to update prices on ad-hoc condition", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2363, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2363" - }, - { - "fields": { - "System.Id": 2364, - "System.State": "Approved", - "System.Title": "As a customer, I would like to provide my feedback on items that I have purchased", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2364, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2364" - }, - { - "fields": { - "System.Id": 2365, - "System.State": "Approved", - "System.Title": "As a customer, I would like to have a wishlist where I can add items for future purchase", - "System.WorkItemType": "Product Backlog Item" - }, - "id": 2365, - "relations": null, - "rev": 1, - "url": "https://dev.azure.com/codebytes/_apis/wit/workItems/2365" - } -] diff --git a/data/Multimodal_Examples/Financial Market Analysis Report 2023.pdf b/data/Multimodal_Examples/Financial Market Analysis Report 2023.pdf deleted file mode 100644 index eef17aad75..0000000000 Binary files a/data/Multimodal_Examples/Financial Market Analysis Report 2023.pdf and /dev/null differ diff --git a/data/Northwind_Health_Plus_Benefits_Details.pdf b/data/Northwind_Health_Plus_Benefits_Details.pdf deleted file mode 100644 index 97579a4fb5..0000000000 Binary files a/data/Northwind_Health_Plus_Benefits_Details.pdf and /dev/null differ diff --git a/data/Northwind_Standard_Benefits_Details.pdf b/data/Northwind_Standard_Benefits_Details.pdf deleted file mode 100644 index 7d50ff8c02..0000000000 Binary files a/data/Northwind_Standard_Benefits_Details.pdf and /dev/null differ diff --git a/data/PerksPlus.pdf b/data/PerksPlus.pdf deleted file mode 100644 index 2e167a2a6a..0000000000 Binary files a/data/PerksPlus.pdf and /dev/null differ diff --git a/data/Policies/Acceptable Use of AI and ML Tools Policy.pdf b/data/Policies/Acceptable Use of AI and ML Tools Policy.pdf new file mode 100644 index 0000000000..1e71d3ebe3 Binary files /dev/null and b/data/Policies/Acceptable Use of AI and ML Tools Policy.pdf differ diff --git a/data/Policies/Anti-Bribery Policy.pdf b/data/Policies/Anti-Bribery Policy.pdf new file mode 100644 index 0000000000..6252711d1c Binary files /dev/null and b/data/Policies/Anti-Bribery Policy.pdf differ diff --git a/data/Policies/Code of Conduct.pdf b/data/Policies/Code of Conduct.pdf new file mode 100644 index 0000000000..92c06a6797 Binary files /dev/null and b/data/Policies/Code of Conduct.pdf differ diff --git a/data/Policies/Conflict of Interest Policy.pdf b/data/Policies/Conflict of Interest Policy.pdf new file mode 100644 index 0000000000..a291113686 Binary files /dev/null and b/data/Policies/Conflict of Interest Policy.pdf differ diff --git a/data/Policies/Daubert Motion Reporting Protocol.pdf b/data/Policies/Daubert Motion Reporting Protocol.pdf new file mode 100644 index 0000000000..e8e8c3e838 Binary files /dev/null and b/data/Policies/Daubert Motion Reporting Protocol.pdf differ diff --git a/data/Policies/Dos and Don'ts for Email.pdf b/data/Policies/Dos and Don'ts for Email.pdf new file mode 100644 index 0000000000..93be25057b Binary files /dev/null and b/data/Policies/Dos and Don'ts for Email.pdf differ diff --git a/data/Policies/EU US Data Privacy Framework.pdf b/data/Policies/EU US Data Privacy Framework.pdf new file mode 100644 index 0000000000..bcabed45a4 Binary files /dev/null and b/data/Policies/EU US Data Privacy Framework.pdf differ diff --git a/data/Policies/Engagement Conflicts of Interest Policy.pdf b/data/Policies/Engagement Conflicts of Interest Policy.pdf new file mode 100644 index 0000000000..7bb6a5d2c7 Binary files /dev/null and b/data/Policies/Engagement Conflicts of Interest Policy.pdf differ diff --git a/data/Policies/Engagement Letter Policy.pdf b/data/Policies/Engagement Letter Policy.pdf new file mode 100644 index 0000000000..1a75fe4a23 Binary files /dev/null and b/data/Policies/Engagement Letter Policy.pdf differ diff --git a/data/Policies/Engagement and Client Records Retention Policy.pdf b/data/Policies/Engagement and Client Records Retention Policy.pdf new file mode 100644 index 0000000000..8f91f6b8e6 Binary files /dev/null and b/data/Policies/Engagement and Client Records Retention Policy.pdf differ diff --git a/data/Policies/Guidelines for Responsible Use of AI.pdf b/data/Policies/Guidelines for Responsible Use of AI.pdf new file mode 100644 index 0000000000..e9e905a3ac Binary files /dev/null and b/data/Policies/Guidelines for Responsible Use of AI.pdf differ diff --git a/data/Policies/Insider TradingPolicy.pdf b/data/Policies/Insider TradingPolicy.pdf new file mode 100644 index 0000000000..9cca3d590e Binary files /dev/null and b/data/Policies/Insider TradingPolicy.pdf differ diff --git a/data/Policies/Modern Slavery Policy.pdf b/data/Policies/Modern Slavery Policy.pdf new file mode 100644 index 0000000000..a39d2579a0 Binary files /dev/null and b/data/Policies/Modern Slavery Policy.pdf differ diff --git a/data/Policies/Privacy Statement.pdf b/data/Policies/Privacy Statement.pdf new file mode 100644 index 0000000000..9580686651 Binary files /dev/null and b/data/Policies/Privacy Statement.pdf differ diff --git a/data/Policies/Social Media Policy.pdf b/data/Policies/Social Media Policy.pdf new file mode 100644 index 0000000000..14ef7a5d94 Binary files /dev/null and b/data/Policies/Social Media Policy.pdf differ diff --git a/data/employee_handbook.pdf b/data/employee_handbook.pdf deleted file mode 100644 index 878f36f7dd..0000000000 Binary files a/data/employee_handbook.pdf and /dev/null differ diff --git a/data/role_library.pdf b/data/role_library.pdf deleted file mode 100644 index ff70c65651..0000000000 Binary files a/data/role_library.pdf and /dev/null differ diff --git a/infra/core/host/container-app.bicep b/infra/core/host/container-app.bicep index dc103e7ead..033fe761b3 100644 --- a/infra/core/host/container-app.bicep +++ b/infra/core/host/container-app.bicep @@ -19,8 +19,8 @@ param containerMaxReplicas int = 10 @description('Memory allocated to a single container instance, e.g., 1Gi') param containerMemory string = '1.0Gi' -@description('The minimum number of replicas to run. Must be at least 1.') -param containerMinReplicas int = 1 +@description('The minimum number of replicas to run. Must be at least 2.') +param containerMinReplicas int = 2 @description('The name of the container') param containerName string = 'main' diff --git a/infra/main.bicep b/infra/main.bicep index 030acab981..ccd0d94d3a 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -69,9 +69,9 @@ param environmentName string }) param location string -param appServicePlanName string = '' // Set in main.parameters.json +param appServicePlanName string = 'P1V3' // Set in main.parameters.json param backendServiceName string = '' // Set in main.parameters.json -param resourceGroupName string = '' // Set in main.parameters.json +param resourceGroupName string = '2' // Set in main.parameters.json param applicationInsightsDashboardName string = '' // Set in main.parameters.json param applicationInsightsName string = '' // Set in main.parameters.json @@ -215,7 +215,7 @@ var chatGpt = { deploymentName: !empty(chatGptDeploymentName) ? chatGptDeploymentName : 'gpt-4.1-mini' deploymentVersion: !empty(chatGptDeploymentVersion) ? chatGptDeploymentVersion : '2025-04-14' deploymentSkuName: !empty(chatGptDeploymentSkuName) ? chatGptDeploymentSkuName : 'GlobalStandard' - deploymentCapacity: chatGptDeploymentCapacity != 0 ? chatGptDeploymentCapacity : 30 + deploymentCapacity: chatGptDeploymentCapacity != 0 ? chatGptDeploymentCapacity : 1000 } param embeddingModelName string = '' @@ -229,7 +229,7 @@ var embedding = { deploymentName: !empty(embeddingDeploymentName) ? embeddingDeploymentName : 'text-embedding-3-large' deploymentVersion: !empty(embeddingDeploymentVersion) ? embeddingDeploymentVersion : (embeddingModelName == 'text-embedding-ada-002' ? '2' : '1') deploymentSkuName: !empty(embeddingDeploymentSkuName) ? embeddingDeploymentSkuName : (embeddingModelName == 'text-embedding-ada-002' ? 'Standard' : 'GlobalStandard') - deploymentCapacity: embeddingDeploymentCapacity != 0 ? embeddingDeploymentCapacity : 30 + deploymentCapacity: embeddingDeploymentCapacity != 0 ? embeddingDeploymentCapacity : 100 dimensions: embeddingDimensions != 0 ? embeddingDimensions : 3072 } @@ -331,7 +331,13 @@ param useAiProject bool = false var abbrs = loadJsonContent('abbreviations.json') var resourceToken = toLower(uniqueString(subscription().id, environmentName, location)) -var tags = { 'azd-env-name': environmentName } +var tags = { + 'azd-env-name': environmentName + BRGOWNER: 'AALETTO' + BRGITLEAD: 'ASCHUYLER' + BRGMATTER: '999964' + BRGDESCRIPTION: 'Azure AI Search Demo development' +} var tenantIdForAuth = !empty(authTenantId) ? authTenantId : tenantId var authenticationIssuerUri = '${environment().authentication.loginEndpoint}${tenantIdForAuth}/v2.0' @@ -361,12 +367,13 @@ param ragSendTextSources bool = true @description('Whether to send image sources to LLM for RAG responses') param ragSendImageSources bool = true -param acaIdentityName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-identity' : '' -param acaManagedEnvironmentName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-env' : '' +param acaIdentityName string = deploymentTarget == 'containerapps' + ? 'mgid-rag-${toLower(replace(environmentName, '-', ''))}-03' + : '' +param acaManagedEnvironmentName string = deploymentTarget == 'containerapps' ? 'caen-rag-${toLower(replace(environmentName, '-', ''))}-03' : '' param containerRegistryName string = deploymentTarget == 'containerapps' - ? '${replace(toLower(environmentName), '-', '')}acr' + ? 'cregrag${toLower(replace(environmentName, '-', ''))}03' : '' - // Configure CORS for allowing different web apps to use the backend // For more information please see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS var msftAllowedOrigins = [ 'https://portal.azure.com', 'https://ms.portal.azure.com' ] @@ -592,7 +599,7 @@ module containerApps 'core/host/container-apps.bicep' = if (deploymentTarget == tags: tags location: location containerAppsEnvironmentName: acaManagedEnvironmentName - containerRegistryName: '${containerRegistryName}${resourceToken}' + containerRegistryName: '${containerRegistryName}' logAnalyticsWorkspaceName: useApplicationInsights ? monitoring.outputs.logAnalyticsWorkspaceName : '' subnetResourceId: usePrivateEndpoint ? isolation.outputs.appSubnetId : '' usePrivateIngress: usePrivateEndpoint @@ -625,11 +632,11 @@ module acaBackend 'core/host/container-app-upsert.bicep' = if (deploymentTarget // For using managed identity to access Azure resources. See https://github.com/microsoft/azure-container-apps/issues/442 AZURE_CLIENT_ID: (deploymentTarget == 'containerapps') ? acaIdentity.outputs.clientId : '' }) - secrets: useAuthentication ? { + secrets: !empty(clientAppId) ? { azureclientappsecret: clientAppSecret azureserverappsecret: serverAppSecret } : {} - envSecrets: useAuthentication ? [ + envSecrets: !empty(clientAppId) ? [ { name: 'AZURE_CLIENT_APP_SECRET' secretRef: 'azureclientappsecret' @@ -864,7 +871,7 @@ module storage 'core/storage/storage-account.bicep' = { allowBlobPublicAccess: false allowSharedKeyAccess: false sku: { - name: storageSkuName + name: 'Standard_ZRS' } deleteRetentionPolicy: { enabled: true diff --git a/locustfile.py b/locustfile.py index 561d342f19..8014907890 100644 --- a/locustfile.py +++ b/locustfile.py @@ -9,11 +9,15 @@ class ChatUser(HttpUser): @task def ask_question(self): - self.client.get( - "/", - name="home", - ) + # Test home page + with self.client.get("/", name="home", catch_response=True) as home_response: + if home_response.status_code != 200: + home_response.failure(f"Home page returned {home_response.status_code}: {home_response.text[:500]}") + return + home_response.success() + time.sleep(self.wait_time()) + first_question = random.choice( [ "What is included in my Northwind Health Plus plan that is not in standard?", @@ -23,7 +27,8 @@ def ask_question(self): ] ) - response = self.client.post( + # Send initial chat request + with self.client.post( "/chat", name="initial chat", json={ @@ -43,13 +48,39 @@ def ask_question(self): }, }, }, - ) + catch_response=True, + ) as response: + # Check if the response is successful + if response.status_code != 200: + response.failure(f"Chat request failed with {response.status_code}: {response.text[:500]}") + return + + # Try to parse JSON + try: + response_data = response.json() + except Exception as e: + response.failure(f"Failed to parse JSON: {str(e)}, Response: {response.text[:500]}") + return + + # Check if response has the expected structure + if "context" not in response_data or "followup_questions" not in response_data.get("context", {}): + response.failure(f"Response missing expected fields: {response.text[:500]}") + return + + if not response_data["context"]["followup_questions"]: + # No follow-up questions, just mark as success and return + response.success() + return + + response.success() + # Use one of the follow up questions + follow_up_question = random.choice(response_data["context"]["followup_questions"]) + result_message = response_data["message"]["content"] + time.sleep(self.wait_time()) - # use one of the follow up questions. - follow_up_question = random.choice(response.json()["context"]["followup_questions"]) - result_message = response.json()["message"]["content"] - self.client.post( + # Send follow-up chat request + with self.client.post( "/chat", name="follow up chat", json={ @@ -71,4 +102,9 @@ def ask_question(self): }, }, }, - ) + catch_response=True, + ) as followup_response: + if followup_response.status_code == 200: + followup_response.success() + else: + followup_response.failure(f"Follow-up failed with {followup_response.status_code}: {followup_response.text[:500]}") diff --git a/scripts/build_frontend.ps1 b/scripts/build_frontend.ps1 new file mode 100644 index 0000000000..263cbcbd8f --- /dev/null +++ b/scripts/build_frontend.ps1 @@ -0,0 +1,9 @@ +#!/usr/bin/env pwsh + +# Script to build the frontend for Azure deployment +Set-Location -Path (Join-Path $PSScriptRoot "../app/frontend") +Write-Host "Installing frontend dependencies..." +npm install +Write-Host "Building frontend..." +npm run build +Write-Host "Frontend build completed successfully!" diff --git a/scripts/build_frontend.sh b/scripts/build_frontend.sh new file mode 100644 index 0000000000..a7528849b6 --- /dev/null +++ b/scripts/build_frontend.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Script to build the frontend for Azure deployment +cd "$(dirname "$0")/../app/frontend" +echo "Installing frontend dependencies..." +npm install +echo "Building frontend..." +npm run build +echo "Frontend build completed successfully!" diff --git a/test.txt b/test.txt new file mode 100644 index 0000000000..e69de29bb2