Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CWYD | Frontend Unit test cases #3

Open
wants to merge 141 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
42fdd7a
added test cases setup chnages and added test cases
Rohini-Microsoft Sep 24, 2024
ee3523d
removed node-fetch
Rohini-Microsoft Sep 24, 2024
282dc68
Added test cases for NoPage Component
Kiran-Siluveru-Microsoft Sep 25, 2024
6bf0846
setup files changes added
Rohini-Microsoft Sep 25, 2024
630ab3e
setup changes added
Rohini-Microsoft Sep 25, 2024
53193fc
updated docker file
Rohini-Microsoft Sep 25, 2024
ed5e7e9
added changes in docker
Rohini-Microsoft Sep 25, 2024
220e232
added package.lock
Rohini-Microsoft Sep 25, 2024
013ef6c
changed docker file
Rohini-Microsoft Sep 25, 2024
ceb56ad
changed docker file
Rohini-Microsoft Sep 25, 2024
b18bfbf
added changes
Rohini-Microsoft Sep 25, 2024
229602a
added changes docker
Rohini-Microsoft Sep 25, 2024
66e1b61
added changes
Rohini-Microsoft Sep 25, 2024
6d81539
changes added
Rohini-Microsoft Sep 25, 2024
8b14486
added changes
Rohini-Microsoft Sep 25, 2024
fd30319
reverted docker changes
Rohini-Microsoft Sep 25, 2024
a67fc66
reverted changes
Rohini-Microsoft Sep 25, 2024
7bf3e88
reverted changes
Rohini-Microsoft Sep 25, 2024
299f9ff
reverted changes
Rohini-Microsoft Sep 25, 2024
deaa400
reverted
Rohini-Microsoft Sep 25, 2024
e68ad13
updated
Rohini-Microsoft Sep 25, 2024
befc881
reverted
Rohini-Microsoft Sep 25, 2024
537b508
reverted
Rohini-Microsoft Sep 25, 2024
0cd7e52
Answer.tsx unit test cases were in progress
Kiran-Siluveru-Microsoft Sep 25, 2024
fb000d5
added package-lock.json
Rohini-Microsoft Sep 25, 2024
b7080c0
added changes
Rohini-Microsoft Sep 25, 2024
72e1c9d
added changes
Rohini-Microsoft Sep 25, 2024
50b89eb
added npm command in docker
Rohini-Microsoft Sep 25, 2024
28d6861
Merge branch 'PSL-BUG-TEST-7937' of https://github.com/Azure-Samples/…
Kiran-Siluveru-Microsoft Sep 26, 2024
1d7138c
Answer Unit test cases in progress
Kiran-Siluveru-Microsoft Sep 26, 2024
806126c
For Answers unit testings added new test cases
Kiran-Siluveru-Microsoft Sep 26, 2024
b750067
Merge branch 'PSL-TS-7938' into PSL-8488-UT-ANSWERS
Kiran-Siluveru-Microsoft Sep 26, 2024
7fb5113
debug and logs removed
Kiran-Siluveru-Microsoft Sep 26, 2024
abc5817
logs removed from no page tests
Kiran-Siluveru-Microsoft Sep 26, 2024
16fa577
moved static data to separate files
Kiran-Siluveru-Microsoft Sep 26, 2024
b4d2de5
Added new test cases for answer component
Kiran-Siluveru-Microsoft Sep 27, 2024
748eacc
Merge branch 'main' of https://github.com/Azure-Samples/chat-with-you…
Kiran-Siluveru-Microsoft Sep 30, 2024
a445521
All Chat test code added and fixed key issues, added test ids
Kiran-Siluveru-Microsoft Sep 30, 2024
006ce35
Added few more unit test cases for chat component
Kiran-Siluveru-Microsoft Oct 1, 2024
3115d9b
Added chat test cases for citation panels view, text reader
Kiran-Siluveru-Microsoft Oct 1, 2024
c1d9dc8
chat component 80% test cases coverage achieved
Kiran-Siluveru-Microsoft Oct 1, 2024
d0231ea
Removed Comments
Kiran-Siluveru-Microsoft Oct 1, 2024
f06ec82
Added Cards Component unit test cases
Kiran-Siluveru-Microsoft Oct 3, 2024
29c6166
Clear Button Branch covered
Kiran-Siluveru-Microsoft Oct 3, 2024
0a64e58
Added accessibility unit test cases
Kiran-Siluveru-Microsoft Oct 3, 2024
f2607a9
ignore paths added to jest config
Kiran-Siluveru-Microsoft Oct 3, 2024
092acf6
Merge branch 'main' of https://github.com/Azure-Samples/chat-with-you…
Kiran-Siluveru-Microsoft Oct 4, 2024
41bf85a
Merge branch 'main' of https://github.com/Azure-Samples/chat-with-you…
Kiran-Siluveru-Microsoft Oct 4, 2024
caf9f59
vite import meta issue fixed for unit testing
Kiran-Siluveru-Microsoft Oct 7, 2024
fd0c002
Commented code for failing unit test cases
Kiran-Siluveru-Microsoft Oct 8, 2024
1eae707
Merge branch 'main' of https://github.com/Azure-Samples/chat-with-you…
Kiran-Siluveru-Microsoft Oct 8, 2024
0e076d2
uncomment the tests.yml code
Rohini-Microsoft Oct 9, 2024
4a25eed
npm ci uncomment
Rohini-Microsoft Oct 9, 2024
eaed0f4
fix testcase issue
Oct 9, 2024
f0d9e9d
fix testcase issue for pr: #1379
Oct 9, 2024
68fed82
removed watchall in package.json
Rohini-Microsoft Oct 9, 2024
eeddf95
fixed lint issue
Rohini-Microsoft Oct 9, 2024
c02fb91
Merge branch 'main' into PSL-8488-UT-ANSWERS
AjitPadhi-Microsoft Oct 10, 2024
3e4062f
Merge branch 'main' of https://github.com/Azure-Samples/chat-with-you…
Kiran-Siluveru-Microsoft Oct 14, 2024
2a42036
Assistant type section component segregated
Kiran-Siluveru-Microsoft Oct 15, 2024
ed5aab9
Segregated ChatMessageContainer component
Kiran-Siluveru-Microsoft Oct 15, 2024
a80ecd2
Citation Panel separated
Kiran-Siluveru-Microsoft Oct 15, 2024
a9e660a
ChatHistory Panel Component is separated from Chat
Kiran-Siluveru-Microsoft Oct 15, 2024
597fddc
Merge branch 'main' into PSL-8488-UT-ANSWERS
ross-p-smith Oct 15, 2024
c62066b
ChatHistoryListItem segregated into groups and cell components
Kiran-Siluveru-Microsoft Oct 16, 2024
3585760
Chat Component Unit test cases in progress
Kiran-Siluveru-Microsoft Oct 16, 2024
9606928
test watch added to package.json
Kiran-Siluveru-Microsoft Oct 17, 2024
4299876
Merge branch 'PSL-8488-UT-ANSWERS' of https://github.com/Azure-Sample…
Kiran-Siluveru-Microsoft Oct 17, 2024
ed1a8b7
"Added new tests for Layout component, including auth branching cases…
Somesh-Microsoft Oct 21, 2024
e9ffaaf
added more test cases in it in order to cover uncovered line
Oct 22, 2024
fec575d
Removed Chat History List component and dependency functions are move…
Kiran-Siluveru-Microsoft Oct 25, 2024
77c00d8
Merge branch 'PSL-8488-UT-ANSWERS' of https://github.com/Azure-Sample…
Somesh-Microsoft Oct 25, 2024
34b59fd
Adding test file for ChatHistoryPanel & Citationpanel
Somesh-Microsoft Nov 6, 2024
1bcd884
"Added mock for microsoft-cognitiveservices-speech-sdk, updated Answe…
Somesh-Microsoft Nov 8, 2024
98af7ac
"Updated ChatHistoryListItemGroups component tests to use new mock da…
Somesh-Microsoft Nov 11, 2024
006f86b
ChatHistoryyListItemCell have covered 83%
Nov 20, 2024
8a42bf8
UT - ChatHistoryItemCell, ChatMessageContainer,HistoryButton, Spinner
Bangarraju-Microsoft Nov 20, 2024
626188c
UT - removed console log and screen debugers
Bangarraju-Microsoft Nov 20, 2024
4b34321
ChatHistoryListItemGroups test
Nov 21, 2024
85411d1
Merge branch 'PSL-8488-UT-ANSWERS' of https://github.com/Azure-Sample…
Nov 21, 2024
dce5000
removed error
Nov 21, 2024
106e346
UT - Spinner, ChatMessageContainer, ChatListItemGroups,AssistantTypeS…
Bangarraju-Microsoft Nov 21, 2024
65456fb
UT - Spinner, ChatMessageContainer, ChatListItemGroups,AssistantTypeS…
Bangarraju-Microsoft Nov 21, 2024
1f294e3
merge conflicts resolved
Bangarraju-Microsoft Nov 21, 2024
9c260c4
one test cases fix
Nov 22, 2024
636101a
Merge branch 'PSL-8488-UT-ANSWERS' of https://github.com/Azure-Sample…
Nov 22, 2024
2dbb0b1
ci: Updated workflow to handle main, dev and demo branch | Dependabot…
Roopan-Microsoft Nov 25, 2024
97ced9f
fix: SFI Fixes & scope reverted to subscription (#1513)
Roopan-Microsoft Nov 25, 2024
903c259
ci: workflow updated for build docker (#1514)
Roopan-Microsoft Nov 25, 2024
4cf2972
ci: build docker updated for dev (#1522)
Roopan-Microsoft Nov 25, 2024
9158819
ci: workflow branch code updated (#1525)
Roopan-Microsoft Nov 25, 2024
4545a48
updated comment
AjitPadhi-Microsoft Nov 25, 2024
84a33b5
updated workflow
AjitPadhi-Microsoft Nov 25, 2024
f8c1c8f
updated workflow
AjitPadhi-Microsoft Nov 25, 2024
e31a661
updated workflow
AjitPadhi-Microsoft Nov 26, 2024
847ce7e
updated bicep for registry
AjitPadhi-Microsoft Nov 26, 2024
8f8cc98
fixed bicep
AjitPadhi-Microsoft Nov 26, 2024
15b948c
fix: bicep updated (#1527)
AjitPadhi-Microsoft Nov 26, 2024
1645e43
Merge branch 'main' into dev
Roopan-Microsoft Nov 27, 2024
8df387a
Merge branch 'dev' of https://github.com/Azure-Samples/chat-with-your…
Roopan-Microsoft Nov 27, 2024
e4dd5f2
fix: Container issue fix for multiple branch (#1539)
AjitPadhi-Microsoft Nov 27, 2024
88d06dc
fix: Updated workflow (#1540)
AjitPadhi-Microsoft Nov 27, 2024
e5cf4dd
ci: Psl container fix for checkout code from head branch (#1541)
Roopan-Microsoft Nov 27, 2024
7e69f5c
ChatHistoryListItemGroups test cases updated
Nov 27, 2024
fcb13da
ChatHistoryItemCell test cases
Nov 28, 2024
d56f098
fix: Auth type set default to rbac and removed resource group from bi…
Roopan-Microsoft Dec 3, 2024
02d0056
fix: multiple container tag issue fix (#1552)
AjitPadhi-Microsoft Dec 9, 2024
90e1040
fix: Workflow issue fix on docker image (#1554)
AjitPadhi-Microsoft Dec 9, 2024
fe6d273
Merge https://github.com/Roopan-Microsoft/psl-cwyd-main into PSL-8488…
Bangarraju-Microsoft Dec 9, 2024
dee02ba
docs: CWYD | Storage Account & Cosmos DB Icons updated (#1467)
Roopan-Microsoft Dec 9, 2024
7fb0636
feat: PostgreSQL implementation for Chat History and Vectorization (…
gpickett Dec 17, 2024
8a5a1cb
fix: Downmerge dev (#1566)
Pavan-Microsoft Dec 18, 2024
131c323
fix: CWYD Citation Links to Documents Break After Specific Timeframe …
Harmanpreet-Microsoft Dec 18, 2024
93b84ed
fix: Commit changes bug (#1568)
UtkarshMishra-Microsoft Dec 18, 2024
0875b92
fix: Post-Deployment Script for Managing Bicep Outputs in .env File …
Pavan-Microsoft Dec 19, 2024
76190b3
fix: import error in env_helper.py (#1571)
Pavan-Microsoft Dec 19, 2024
c65bf01
fix: add conversation flow in environment variable for adminweb app (…
Priyanka-Microsoft Dec 19, 2024
1f326d9
fix: Update Hosting Model Configuration in ARM/Bicep Template (#1570)
Prasanjeet-Microsoft Dec 19, 2024
fc688c2
fix: Update main.json for changes conversation flow changes in bicep …
Priyanka-Microsoft Dec 19, 2024
405d4bc
docs: Update README for PostgreSQL / Cosmos DB Integration (#1576)
Fr4nc3 Dec 20, 2024
56adb59
Merge branch 'main' into dev
Roopan-Microsoft Dec 24, 2024
afaabdc
build: Dependabotchanges merge to Dev branch (#1602)
Roopan-Microsoft Dec 30, 2024
03f52b3
feat: Configurable System Prompts for Flexibility and Maintenance - C…
Pavan-Microsoft Dec 31, 2024
e92eba1
fix: Add Missing Logs (#1609)
Pavan-Microsoft Jan 2, 2025
b0860ee
commented the prompt flow in azure yaml file
Roopan-Microsoft Jan 3, 2025
983b1f7
Merge branches 'dev' and 'dev' of https://github.com/Azure-Samples/ch…
Roopan-Microsoft Jan 3, 2025
dae4043
Add execute permissions parse_env.sh in postprovision hook
Pavan-Microsoft Jan 3, 2025
08ad207
fix: Build issue with docker
Prajwal-Microsoft Jan 4, 2025
c49ddfd
Update build-docker.yml
Prajwal-Microsoft Jan 5, 2025
5994f99
fix: Docker file failure issue
Prajwal-Microsoft Jan 5, 2025
6a4cebb
build: merging dev changes to main branch (#1599)
Roopan-Microsoft Jan 5, 2025
99d10df
Merge branch 'dev' of https://github.com/Azure-Samples/chat-with-your…
Bangarraju-Microsoft Jan 6, 2025
76e0093
merge issue fixed
Bangarraju-Microsoft Jan 6, 2025
9e4cb83
removed debuger from test files
Bangarraju-Microsoft Jan 6, 2025
e3cf7ed
package lock file pushed due to docker image build failing
Bangarraju-Microsoft Jan 6, 2025
a13551b
chore: Delete .github/workflows/sync-branches.yml (#1617)
Harmanpreet-Microsoft Jan 7, 2025
20f176d
Merge branch 'main' into PSL-8488-UT-ANSWERS
Roopan-Microsoft Jan 8, 2025
87c2474
package lock updated
Roopan-Microsoft Jan 8, 2025
93a1310
UI - duplicate code added due to merge
Bangarraju-Microsoft Jan 9, 2025
6aac7c1
version downgraded for build push actions
Roopan-Microsoft Jan 10, 2025
604111e
Merge branch 'PSL-8488-UT-ANSWERS' of https://github.com/Azure-Sample…
Roopan-Microsoft Jan 10, 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
15 changes: 10 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ AZURE_SEARCH_DATASOURCE_NAME=
# Azure OpenAI for generating the answer and computing the embedding of the documents
AZURE_OPENAI_RESOURCE=
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_MODEL_INFO="{\"model\":\"gpt-35-turbo-16k\",\"modelName\":\"gpt-35-turbo-16k\",\"modelVersion\":\"0613\"}"
AZURE_OPENAI_EMBEDDING_MODEL_INFO="{\"model\":\"text-embedding-ada-002\",\"modelName\":\"text-embedding-ada-002\",\"modelVersion\":\"2\"}"
AZURE_OPENAI_MODEL=gpt-35-turbo
AZURE_OPENAI_MODEL_NAME=gpt-35-turbo
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
AZURE_OPENAI_TEMPERATURE=0
AZURE_OPENAI_TOP_P=1.0
AZURE_OPENAI_MAX_TOKENS=1000
Expand All @@ -35,7 +36,6 @@ AZURE_OPENAI_STREAM=True
AzureWebJobsStorage=
BACKEND_URL=http://localhost:7071
DOCUMENT_PROCESSING_QUEUE_NAME=
# Azure Blob Storage for storing the original documents to be processed
AZURE_BLOB_ACCOUNT_NAME=
AZURE_BLOB_ACCOUNT_KEY=
AZURE_BLOB_CONTAINER_NAME=
Expand Down Expand Up @@ -63,6 +63,11 @@ AZURE_KEY_VAULT_ENDPOINT=
# Chat conversation type to decide between custom or byod (bring your own data) conversation type
CONVERSATION_FLOW=
# Chat History CosmosDB Integration Settings
AZURE_COSMOSDB_INFO="{\"accountName\":\"cosmos-abc123\",\"databaseName\":\"db_conversation_history\",\"containerName\":\"conversations\"}"
AZURE_COSMOSDB_ACCOUNT_KEY=
AZURE_COSMOSDB_ACCOUNT_NAME=
AZURE_COSMOSDB_DATABASE_NAME=
AZURE_COSMOSDB_CONVERSATIONS_CONTAINER_NAME=
AZURE_COSMOSDB_ENABLE_FEEDBACK=
AZURE_POSTGRESQL_HOST_NAME=
AZURE_POSTGRESQL_DATABASE_NAME=
AZURE_POSTGRESQL_USER=
DATABASE_TYPE="CosmosDB"
11 changes: 4 additions & 7 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Build Docker Images

on:
workflow_run:
workflows: [Tests]
types: [completed]
push:
branches:
- main
- dev
Expand All @@ -22,7 +20,6 @@ on:

jobs:
docker-build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
Expand All @@ -34,9 +31,9 @@ jobs:
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.ref_name == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'dev' || github.event.workflow_run.head_branch == 'demo' }}
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
secrets: inherit
7 changes: 3 additions & 4 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
docker-build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -56,12 +55,12 @@ jobs:
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Build Docker Image and optionally push
uses: docker/build-push-action@v6
uses: docker/build-push-action@v5
with:
context: .
file: ${{ inputs.dockerfile }}
push: ${{ inputs.push }}
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || github.ref_name }}
tags: |
${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || 'default' }}
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.date.outputs.date }}_${{ github.run_number }}
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
env:
AZURE_ENV_NAME: ${{ github.run_id }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
with:
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
cacheFrom: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
Expand All @@ -66,15 +65,12 @@ jobs:
AZURE_SUBSCRIPTION_ID
AZURE_ENV_NAME
AZURE_LOCATION
AZURE_RESOURCE_GROUP

- name: Tidy up
uses: devcontainers/[email protected]
if: always()
env:
AZURE_ENV_NAME: ${{ github.run_id }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
with:
push: never
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
Expand All @@ -87,7 +83,7 @@ jobs:
AZURE_SUBSCRIPTION_ID
AZURE_ENV_NAME
AZURE_LOCATION

- name: Send Notification on Failure
if: failure()
run: |
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/sync-branches.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# generated frontend files
code/dist/
code/frontend/coverage

# User-specific files
*.rsuser
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ azd-login: ## 🔑 Login to Azure with azd and a SPN
@echo -e "\e[34m$@\e[0m" || true
@azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID}

az-login: ## 🔑 Login to Azure with az and a SPN
az login --service-principal -u ${AZURE_CLIENT_ID} -p ${AZURE_CLIENT_SECRET} --tenant ${AZURE_TENANT_ID}

deploy: azd-login az-login ## 🚀 Deploy everything to Azure
deploy: azd-login ## 🚀 Deploy everything to Azure
@echo -e "\e[34m$@\e[0m" || true
@azd env new ${AZURE_ENV_NAME}
@azd env set AZURE_APP_SERVICE_HOSTING_MODEL code --no-prompt
@az group create --name ${AZURE_RESOURCE_GROUP} --location ${AZURE_LOCATION}
@azd provision --no-prompt
@azd deploy web --no-prompt
@azd deploy function --no-prompt
Expand Down
47 changes: 35 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ urlFragment: chat-with-your-data-solution-accelerator
## User story
Welcome to the *Chat with your data* Solution accelerator repository! The *Chat with your data* Solution accelerator is a powerful tool that combines the capabilities of Azure AI Search and Large Language Models (LLMs) to create a conversational search experience. This solution accelerator uses an Azure OpenAI GPT model and an Azure AI Search index generated from your data, which is integrated into a web application to provide a natural language interface, including [speech-to-text](docs/speech_to_text.md) functionality, for search queries. Users can drag and drop files, point to storage, and take care of technical setup to transform documents. Everything can be deployed in your own subscription to accelerate your use of this technology.

![Solution Architecture - Chat with your data](/docs/images/cwyd-solution-architecture.png)



### About this repo

Expand Down Expand Up @@ -91,12 +92,15 @@ Here is a comparison table with a few features offered by Azure, an available Gi
- **Single application access to your full data set**: Minimize endpoints required to access internal company knowledgebases. Reuse the same backend with the [Microsoft Teams Extension](docs/teams_extension.md)
- **Natural language interaction with your unstructured data**: Use natural language to quickly find the answers you need and ask follow-up queries to get the supplemental details, including [Speech-to-text](docs/speech_to_text.md).
- **Easy access to source documentation when querying**: Review referenced documents in the same chat window for additional context.
- **Chat history**: Prior conversations and context are maintained and accessible through chat history.
- **Data upload**: Batch upload documents of [various file types](docs/supported_file_types.md)
- **Accessible orchestration**: Prompt and document configuration (prompt engineering, document processing, and data retrieval)
- **Database flexibility**: Dynamic database switching allows users to choose between PostgreSQL and Cosmos DB based on their requirements. If no preference is specified the platform defaults to PostgreSQL.


**Note**: The current model allows users to ask questions about unstructured data, such as PDF, text, and docx files. See the [supported file types](docs/supported_file_types.md).


### Target end users
Company personnel (employees, executives) looking to research against internal unstructured company data would leverage this accelerator using natural language to find what they need quickly.

Expand All @@ -107,6 +111,11 @@ Tech administrators can use this accelerator to give their colleagues easy acces

### Use Case scenarios

#### Employee Onboarding Scenario
The sample data illustrates how this accelerator could be used for an employee onboarding scenario in across industries.

In this scenario, a newly hired employee is in the process of onboarding to their organization. Leveraging the solution accelerator, she navigates through the extensive offerings of her organization’s health and retirement benefits. With the newly integrated chat history capabilities, they can revisit previous conversations, ensuring continuity and context across multiple days of research. This functionality allows the new employee to efficiently gather and consolidate information, streamlining their onboarding experience. [For more details, refer to the README](docs/employee_assistance.md).

#### Financial Advisor Scenario
The sample data illustrates how this accelerator could be used in the financial services industry (FSI).

Expand All @@ -120,12 +129,6 @@ Additionally, we have implemented a Legal Review and Summarization Assistant sce
Note: Some of the sample data included with this accelerator was generated using AI and is for illustrative purposes only.


#### Employee Onboarding Scenario
The sample data illustrates how this accelerator could be used for an employee onboarding scenario in across industries.

In this scenario, a newly hired employee is in the process of onboarding to their organization. Leveraging the solution accelerator, she navigates through the extensive offerings of her organization’s health and retirement benefits. With the newly integrated chat history capabilities, they can revisit previous conversations, ensuring continuity and context across multiple days of research. This functionality allows the new employee to efficiently gather and consolidate information, streamlining their onboarding experience. [For more details, refer to the README](docs/employee_assistance.md).


---

![One-click Deploy](/docs/images/oneClickDeploy.png)
Expand All @@ -146,6 +149,7 @@ In this scenario, a newly hired employee is in the process of onboarding to thei
- Azure Storage Account
- Azure Speech Service
- Azure CosmosDB
- Azure PostgreSQL
- Teams (optional: Teams extension only)

### Required licenses
Expand All @@ -163,13 +167,30 @@ The following are links to the pricing details for some of the resources:
- [Azure AI Document Intelligence pricing](https://azure.microsoft.com/pricing/details/ai-document-intelligence/)
- [Azure Web App Pricing](https://azure.microsoft.com/pricing/details/app-service/windows/)

### Deployment options: PostgreSQL or Cosmos DB
With the addition of PostgreSQL, customers can leverage the power of a relationship-based AI solution to enhance historical conversation access, improve data privacy, and open the possibilities for scalability.

Customers have the option to deploy this solution with PostgreSQL or Cosmos DB. Consider the following when deciding which database to use:
- PostgreSQL enables a relationship-based AI solution and search indexing for Retrieval Augmented Generation (RAG)
- Cosmos DB enables chat history and is a NoSQL-based solution. With Cosmos DB, Azure AI Search is used for storing extracted documents and embeddings.


To review PostgreSQL configuration overview and steps, follow the link [here](docs/postgreSQL.md).
![Solution Architecture - Chat with your data PostgreSQL](/docs/images/architrecture_pg.png)

To review Cosmos DB configuration overview and steps, follow the link [here](docs/employee_assistance.md).
![Solution Architecture - Chat with your data CosmosDB](/docs/images/architecture_cdb.png)

### Deploy instructions
The "Deploy to Azure" button offers a one-click deployment where you don’t have to clone the code. If you would like a developer experience instead, follow the [local deployment instructions](./docs/LOCAL_DEPLOYMENT.md).

Once you deploy to Azure, you will have the option to select PostgreSQL or Cosmos DB, see screenshot below.

There are two choices; the "Deploy to Azure" offers a one click deployment where you don't have to clone the code, alternatively if you would like a developer experience, follow the [Local deployment instructions](./docs/LOCAL_DEPLOYMENT.md).
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fchat-with-your-data-solution-accelerator%2Frefs%2Fheads%2Fmain%2Finfra%2Fmain.json)

The demo, which uses containers pre-built from the main branch is available by clicking this button:
Select either "PostgreSQL" or "Cosmos DB":
![Solution Architecture - DB Selection](/docs/images/db_selection.png)

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fchat-with-your-data-solution-accelerator%2Fmain%2Finfra%2Fmain.json)

When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](./docs/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service

Expand All @@ -195,9 +216,11 @@ switch to a lower version. To find out which versions are supported in different

![A screenshot of the chat app.](./docs/images/web-unstructureddata.png)

\
\



![Supporting documentation](/docs/images/supportingDocuments.png)

## Supporting documentation

### Resource links
Expand Down
8 changes: 7 additions & 1 deletion azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ metadata:
template: [email protected]
hooks:
postprovision:
run: ./infra/prompt-flow/create-prompt-flow.sh
# run: ./infra/prompt-flow/create-prompt-flow.sh
posix:
shell: sh
run: chmod +x ./scripts/parse_env.sh && ./scripts/parse_env.sh
windows:
shell: pwsh
run: ./scripts/parse_env.ps1
services:
web:
project: ./code
Expand Down
Loading
Loading