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

build: Merge Dependabot Changes into Dev Branch #1679

Open
wants to merge 71 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
4a13a57
build: bump opentelemetry-instrumentation-httpx from 0.48b0 to 0.50b0…
dependabot[bot] Dec 23, 2024
fcaa562
build: bump azure-ai-ml from 1.21.1 to 1.23.0 (#1559)
dependabot[bot] Dec 23, 2024
0986fe1
Merge branch 'main' into dependabotchanges
Roopan-Microsoft Dec 23, 2024
e1a9ff3
build: bump nanoid from 3.3.7 to 3.3.8 in /code/frontend (#1556)
dependabot[bot] Dec 23, 2024
4c06a4d
build: bump openai from 1.48.0 to 1.58.1 (#1578)
dependabot[bot] Dec 23, 2024
4f1bf6e
build: bump pytest from 8.3.3 to 8.3.4 (#1548)
dependabot[bot] Dec 23, 2024
1d07939
build: bump streamlit from 1.39.0 to 1.41.1 (#1579)
dependabot[bot] Dec 23, 2024
1f3c5d9
build: bump semantic-kernel from 1.3.0 to 1.17.1 (#1580)
dependabot[bot] Dec 23, 2024
c61a308
build: bump @types/node from 22.5.5 to 22.10.1 in /code/frontend (#1547)
dependabot[bot] Dec 23, 2024
2809781
build: bump vite from 5.4.10 to 6.0.1 in /code/frontend (#1546)
dependabot[bot] Dec 23, 2024
0980b69
build: bump vitest from 2.1.4 to 2.1.8 in /code/frontend (#1582)
dependabot[bot] Dec 23, 2024
35d4715
build: bump prettier from 3.3.3 to 3.4.2 in /code/frontend (#1581)
dependabot[bot] Dec 23, 2024
0233fe4
build: bump @vitejs/plugin-react from 4.3.3 to 4.3.4 in /code/fronten…
dependabot[bot] Dec 23, 2024
a247d27
build: bump typescript from 5.5.4 to 5.7.2 in /tests/integration/ui (…
dependabot[bot] Dec 23, 2024
b175a5f
build: bump @fluentui/react-icons from 2.0.265 to 2.0.266 in /code/fr…
dependabot[bot] Dec 23, 2024
7b872cd
build: bump react-router-dom from 6.27.0 to 7.0.1 in /code/frontend (…
dependabot[bot] Dec 23, 2024
a3cbc54
build: bump cypress from 13.15.2 to 13.17.0 in /tests/integration/ui …
dependabot[bot] Dec 23, 2024
e81a965
build: bump @fortawesome/fontawesome-svg-core from 6.6.0 to 6.7.2 in …
dependabot[bot] Dec 23, 2024
610541b
build: bump typescript from 5.6.2 to 5.7.2 in /code/frontend (#1517)
dependabot[bot] Dec 23, 2024
cbba914
build: bump tornado from 6.4.1 to 6.4.2 (#1511)
dependabot[bot] Dec 23, 2024
060ca4e
build: bump cross-spawn from 7.0.3 to 7.0.6 in /tests/integration/ui …
dependabot[bot] Dec 23, 2024
2cbc462
build: bump cross-spawn from 7.0.3 to 7.0.6 in /extensions/teams (#1500)
dependabot[bot] Dec 23, 2024
3184090
build: bump aiohttp from 3.10.2 to 3.10.11 (#1499)
dependabot[bot] Dec 23, 2024
f1f2801
build: bump postcss from 8.4.48 to 8.4.49 in /code/frontend (#1496)
dependabot[bot] Dec 23, 2024
033df75
build: bump uuid from 11.0.2 to 11.0.3 in /code/frontend (#1472)
dependabot[bot] Dec 23, 2024
9792387
build: bump @azure/identity and botbuilder in /extensions/teams (#1282)
dependabot[bot] Dec 23, 2024
2cad336
build: bump @fluentui/react from 8.121.8 to 8.122.2 in /code/frontend…
dependabot[bot] Dec 23, 2024
ae60417
build: bump actions/checkout from 3 to 4 (#1586)
dependabot[bot] Dec 23, 2024
82df7ec
build: bump azure-mgmt-cognitiveservices from 13.5.0 to 13.6.0 (#1595)
dependabot[bot] Dec 23, 2024
3b8e540
build: bump azure-monitor-opentelemetry from 1.6.2 to 1.6.4 (#1596)
dependabot[bot] Dec 23, 2024
a7c356b
build: bump react-router-dom from 7.0.1 to 7.1.0 in /code/frontend (#…
dependabot[bot] Dec 23, 2024
73307a3
build: bump @babel/traverse from 7.25.9 to 7.26.4 in /code/frontend (…
dependabot[bot] Dec 23, 2024
d3a4ed4
build: bump microsoft-cognitiveservices-speech-sdk from 1.41.0 to 1.4…
dependabot[bot] Dec 23, 2024
8a4f11b
build: bump @types/node from 22.10.1 to 22.10.2 in /code/frontend (#1…
dependabot[bot] Dec 23, 2024
9ab4e91
build: bump @fluentui/react-icons from 2.0.266 to 2.0.270 in /code/fr…
dependabot[bot] Dec 23, 2024
4d89338
build: bump @fortawesome/free-solid-svg-icons from 6.6.0 to 6.7.2 in …
dependabot[bot] Dec 23, 2024
f8ba1a5
build: bump vite from 6.0.1 to 6.0.5 in /code/frontend (#1588)
dependabot[bot] Dec 23, 2024
6654030
build: bump pytest-asyncio from 0.24.0 to 0.25.0 (#1594)
dependabot[bot] Dec 23, 2024
483a490
build: bump fake-useragent from 1.5.1 to 2.0.3 (#1597)
dependabot[bot] Dec 23, 2024
0cbbac0
build: bump the langchain group with 2 updates (#1598)
dependabot[bot] Dec 23, 2024
61753fe
Merge branch 'dev' into dependabotchanges
Roopan-Microsoft Dec 30, 2024
6f4cebb
Downgrade semantic-kernel
Pavan-Microsoft Dec 30, 2024
901bd2f
build: bump trustme from 1.2.0 to 1.2.1 (#1635)
dependabot[bot] Feb 4, 2025
93ee6a9
build: bump pytest-httpserver from 1.1.0 to 1.1.1 (#1636)
dependabot[bot] Feb 4, 2025
47dec89
build: bump react-dom and @types/react-dom in /code/frontend (#1657)
dependabot[bot] Feb 4, 2025
a7ab10c
build: bump postcss from 8.4.49 to 8.5.1 in /code/frontend (#1655)
dependabot[bot] Feb 4, 2025
93f9856
build: bump @types/node from 22.10.2 to 22.13.0 in /code/frontend (#1…
dependabot[bot] Feb 4, 2025
4c065a9
build: bump openai from 1.58.1 to 1.61.0 (#1637)
dependabot[bot] Feb 4, 2025
767aca7
build: bump uuid from 11.0.3 to 11.0.5 in /code/frontend (#1648)
dependabot[bot] Feb 4, 2025
266b90e
build: bump vitest from 2.1.8 to 3.0.4 in /code/frontend (#1649)
dependabot[bot] Feb 4, 2025
107104a
build: bump @fluentui/react-icons from 2.0.270 to 2.0.274 in /code/fr…
dependabot[bot] Feb 4, 2025
fd5f0b3
build: bump typescript from 5.7.2 to 5.7.3 in /code/frontend (#1646)
dependabot[bot] Feb 4, 2025
176d9f8
build: bump react-markdown from 9.0.1 to 9.0.3 in /code/frontend (#1654)
dependabot[bot] Feb 4, 2025
73a0d45
build: bump cypress from 13.17.0 to 14.0.1 in /tests/integration/ui (…
dependabot[bot] Feb 4, 2025
7daeefb
build: bump pytest-asyncio from 0.25.0 to 0.25.3 (#1641)
dependabot[bot] Feb 4, 2025
b98a80e
build: bump @babel/traverse from 7.26.4 to 7.26.7 in /code/frontend (…
dependabot[bot] Feb 4, 2025
3b28433
build: bump vite from 6.0.5 to 6.0.11 in /code/frontend (#1652)
dependabot[bot] Feb 4, 2025
78c5561
build: bump typescript from 5.7.2 to 5.7.3 in /tests/integration/ui (…
dependabot[bot] Feb 4, 2025
ccf9228
build: bump react and @types/react in /code/frontend (#1647)
dependabot[bot] Feb 4, 2025
afc9a99
build: bump react-router-dom from 7.1.0 to 7.1.5 in /code/frontend (#…
dependabot[bot] Feb 4, 2025
8697a92
build: bump azure-ai-ml from 1.23.0 to 1.24.0 (#1640)
dependabot[bot] Feb 4, 2025
fad46a3
build: bump @fluentui/react from 8.122.2 to 8.122.9 in /code/frontend…
dependabot[bot] Feb 4, 2025
ed151ac
build: bump black from 24.10.0 to 25.1.0 (#1639)
dependabot[bot] Feb 4, 2025
4f35d46
build: bump pre-commit from 4.0.1 to 4.1.0 (#1642)
dependabot[bot] Feb 4, 2025
27f1161
build: bump azure-storage-blob from 12.20.0 to 12.24.1 (#1638)
dependabot[bot] Feb 4, 2025
fe8311d
Merge branch 'dev' into dependabotchanges
Roopan-Microsoft Feb 6, 2025
7c0f039
fix: Downgrade Packages and Fix Dependency Issues (#1666)
Prasanjeet-Microsoft Feb 13, 2025
2382831
fix: merging dev changes to main branch (#1629)
Roopan-Microsoft Feb 19, 2025
79e0aba
Merge branch 'main' into dependabotchanges
Roopan-Microsoft Feb 21, 2025
2c04ba7
updated package.json lock
Feb 21, 2025
7f922d1
added dependabotchanges
Feb 21, 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
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ 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=gpt-35-turbo
AZURE_OPENAI_MODEL_NAME=gpt-35-turbo
AZURE_OPENAI_MODEL=gpt-4o
AZURE_OPENAI_MODEL_NAME=gpt-4o
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
AZURE_OPENAI_TEMPERATURE=0
AZURE_OPENAI_TOP_P=1.0
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Docker Images
name: Build Docker and Optional Push

on:
push:
Expand All @@ -12,11 +12,12 @@ on:
- dev
- demo
types:
- opened
- ready_for_review
- reopened
- synchronize
- opened
- ready_for_review
- reopened
- synchronize
merge_group:
workflow_dispatch:

jobs:
docker-build:
Expand All @@ -31,9 +32,11 @@ jobs:
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.ref_name == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
old_registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' }}
new_registry: 'cwydcontainerreg.azurecr.io'
old_username: ${{ github.ref_name == 'main' && 'fruoccopublic' }}
new_username: 'cwydcontainerreg'
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo'|| github.ref_name == 'dependabotchanges' }}
secrets: inherit
57 changes: 41 additions & 16 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name: Reusable Docker build and push workflow
on:
workflow_call:
inputs:
registry:
old_registry:
required: true
type: string
username:
old_username:
required: true
type: string
new_registry:
required: true
type: string
new_username:
required: true
type: string
app_name:
Expand All @@ -31,20 +37,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Docker Login
# Login for 'main' branch to both registries
- name: Docker Login to fruoccopublic (Main)
if: ${{ inputs.push == true && github.ref_name == 'main' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
registry: ${{ inputs.old_registry }}
username: ${{ inputs.old_username }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Dev Docker Login
if: ${{ inputs.push == true && (github.ref_name == 'dev' || github.ref_name == 'demo') }}
- name: Docker Login to cwydcontainerreg (Main)
if: ${{ inputs.push == true && github.ref_name == 'main' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
registry: ${{ inputs.new_registry }}
username: ${{ inputs.new_username }}
password: ${{ secrets.DEV_DOCKER_PASSWORD }}

# Login for 'dev' and 'demo' branches to cwydcontainerreg only
- name: Docker Login to cwydcontainerreg (Dev/Demo)
if: ${{ inputs.push == true && (github.ref_name == 'dev' || github.ref_name == 'demo'|| github.ref_name == 'dependabotchanges') }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.new_registry }}
username: ${{ inputs.new_username }}
password: ${{ secrets.DEV_DOCKER_PASSWORD }}

- name: Set up Docker Buildx
Expand All @@ -54,17 +70,26 @@ jobs:
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Determine Tag Name Based on Branch
id: determine_tag
run: echo "tagname=${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || 'default' }}" >> $GITHUB_OUTPUT
- name: Build Docker Image and optionally push (Old Registry)
if: ${{ github.ref_name == 'main' }}
uses: docker/build-push-action@v6
with:
context: .
file: ${{ inputs.dockerfile }}
push: ${{ inputs.push }}
cache-from: type=registry,ref=${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || github.ref_name }}
tags: |
${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || 'default' }}
${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ steps.date.outputs.date }}_${{ github.run_number }}

- name: Build Docker Image and optionally push
- name: Build Docker Image and optionally push (New Registry)
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo'|| github.ref_name == 'dependabotchanges' }}
uses: docker/build-push-action@v6
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' || github.head_ref || github.ref_name }}
cache-from: type=registry,ref=${{ inputs.new_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo'|| github.ref_name == 'dependabotchanges' && 'dependabotchanges' || github.head_ref || github.ref_name }}
tags: |
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.determine_tag.outputs.tagname }}
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
${{ inputs.new_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo'|| github.ref_name == 'dependabotchanges' && 'dependabotchanges' || github.head_ref || 'default' }}
${{ inputs.new_registry }}/${{ inputs.app_name }}:${{ steps.date.outputs.date }}_${{ github.run_number }}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Validate Deployment

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
- dev
- demo
schedule:
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
- cron: '0 8,20 * * *' # Runs at 8:00 AM and 8:00 PM GMT

permissions:
contents: read
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
AZURE_SUBSCRIPTION_ID
AZURE_ENV_NAME
AZURE_LOCATION

- name: Send Notification on Failure
if: failure()
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: write
pull-requests: write

name: create-release
name: Create-Release

jobs:
create-release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "pr-title-checker"
name: "PR Title Checker"

on:
pull_request_target:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-bot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Close stale issues and PRs'
name: 'Stale Bot'
on:
schedule:
- cron: '30 1 * * *'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Test Workflow with Coverage

on:
push:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Here is a comparison table with a few features offered by Azure, an available Gi
| Name | Feature or Sample? | What is it? | When to use? |
| ---------|---------|---------|---------|
|["Chat with your data" Solution Accelerator](https://aka.ms/ChatWithYourDataSolutionAccelerator) - (This repo) | Azure sample | End-to-end baseline RAG pattern sample that uses Azure AI Search as a retriever. | This sample should be used by Developers when the RAG pattern implementations provided by Azure are not able to satisfy business requirements. This sample provides a means to customize the solution. Developers must add their own code to meet requirements, and adapt with best practices according to individual company policies. |
|[Azure OpenAI on your data](https://learn.microsoft.com/azure/ai-services/openai/concepts/use-your-data) | Azure feature | Azure OpenAI Service offers out-of-the-box, end-to-end RAG implementation that uses a REST API or the web-based interface in the Azure AI Studio to create a solution that connects to your data to enable an enhanced chat experience with Azure OpenAI ChatGPT models and Azure AI Search. | This should be the first option considered for developers that need an end-to-end solution for Azure OpenAI Service with an Azure AI Search retriever. Simply select supported data sources, that ChatGPT model in Azure OpenAI Service , and any other Azure resources needed to configure your enterprise application needs. |
|[Azure OpenAI on your data](https://learn.microsoft.com/azure/ai-services/openai/concepts/use-your-data) | Azure feature | Azure OpenAI Service offers out-of-the-box, end-to-end RAG implementation that uses a REST API or the web-based interface in the Azure AI Foundry to create a solution that connects to your data to enable an enhanced chat experience with Azure OpenAI ChatGPT models and Azure AI Search. | This should be the first option considered for developers that need an end-to-end solution for Azure OpenAI Service with an Azure AI Search retriever. Simply select supported data sources, that ChatGPT model in Azure OpenAI Service , and any other Azure resources needed to configure your enterprise application needs. |
|[Azure Machine Learning prompt flow](https://learn.microsoft.com/azure/machine-learning/concept-retrieval-augmented-generation) | Azure feature | RAG in Azure Machine Learning is enabled by integration with Azure OpenAI Service for large language models and vectorization. It includes support for Faiss and Azure AI Search as vector stores, as well as support for open-source offerings, tools, and frameworks such as LangChain for data chunking. Azure Machine Learning prompt flow offers the ability to test data generation, automate prompt creation, visualize prompt evaluation metrics, and integrate RAG workflows into MLOps using pipelines. | When Developers need more control over processes involved in the development cycle of LLM-based AI applications, they should use Azure Machine Learning prompt flow to create executable flows and evaluate performance through large-scale testing. |
|[ChatGPT + Enterprise data with Azure OpenAI and AI Search demo](https://github.com/Azure-Samples/azure-search-openai-demo) | Azure sample | RAG pattern demo that uses Azure AI Search as a retriever. | Developers who would like to use or present an end-to-end demonstration of the RAG pattern should use this sample. This includes the ability to deploy and test different retrieval modes, and prompts to support business use cases. |
|[RAG Experiment Accelerator](https://github.com/microsoft/rag-experiment-accelerator) | Tool |The RAG Experiment Accelerator is a versatile tool that helps you conduct experiments and evaluations using Azure AI Search and RAG pattern. | RAG Experiment Accelerator is to make it easier and faster to run experiments and evaluations of search queries and quality of response from OpenAI. This tool is useful for researchers, data scientists, and developers who want to, Test the performance of different Search and OpenAI related hyperparameters. |
Expand Down Expand Up @@ -194,10 +194,10 @@ Select either "PostgreSQL" or "Cosmos DB":

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

**Note**: The default configuration deploys an OpenAI Model "gpt-35-turbo" with version 0613. However, not all
locations support this version. If you're deploying to a location that doesn't support version 0613, you'll need to
**Note**: The default configuration deploys an OpenAI Model "gpt-4o" with version 2024-05-13. However, not all
locations support this version. If you're deploying to a location that doesn't support version 2024-05-13, you'll need to
switch to a lower version. To find out which versions are supported in different regions, visit the
[GPT-35 Turbo Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35-turbo-model-availability) page.
[GPT-4o Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#global-standard-model-availability) page.

### Testing the deployment
1. Navigate to the admin site, where you can upload documents. It will be located at:
Expand Down
4 changes: 2 additions & 2 deletions code/backend/batch/utilities/helpers/env_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def __load_config(self, **kwargs) -> None:
else:
# Otherwise, fallback to individual environment variables
self.AZURE_OPENAI_MODEL = os.getenv(
"AZURE_OPENAI_MODEL", "gpt-35-turbo-16k"
"AZURE_OPENAI_MODEL", "gpt-4o"
)
self.AZURE_OPENAI_MODEL_NAME = os.getenv(
"AZURE_OPENAI_MODEL_NAME", "gpt-35-turbo-16k"
"AZURE_OPENAI_MODEL_NAME", "gpt-4o"
)

self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4")
Expand Down
95 changes: 50 additions & 45 deletions code/backend/pages/04_Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,17 +410,21 @@ def validate_documents():

if st.form_submit_button("Save configuration"):
document_processors = []
should_save = True
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION is False:
valid = all(
row["document_type"]
and row["chunking_strategy"]
and row["chunking_size"]
and row["chunking_overlap"]
and row["loading_strategy"]
for row in edited_document_processors
)
if not valid:
st.error(
"Please ensure all fields are selected and not left blank in Document processing configuration."
)
should_save = False
document_processors = list(
map(
lambda x: {
Expand All @@ -440,51 +444,52 @@ def validate_documents():
edited_document_processors,
)
)
current_config = {
"prompts": {
"condense_question_prompt": "", # st.session_state['condense_question_prompt'],
"answering_system_prompt": st.session_state[
"answering_system_prompt"
],
"answering_user_prompt": st.session_state["answering_user_prompt"],
"use_on_your_data_format": st.session_state[
"use_on_your_data_format"
],
"post_answering_prompt": st.session_state["post_answering_prompt"],
"enable_post_answering_prompt": st.session_state[
"enable_post_answering_prompt"
],
"enable_content_safety": st.session_state["enable_content_safety"],
"ai_assistant_type": st.session_state["ai_assistant_type"],
"conversational_flow": st.session_state["conversational_flow"],
},
"messages": {
"post_answering_filter": st.session_state[
"post_answering_filter_message"
]
},
"example": {
"documents": st.session_state["example_documents"],
"user_question": st.session_state["example_user_question"],
"answer": st.session_state["example_answer"],
},
"document_processors": document_processors,
"logging": {
"log_user_interactions": st.session_state["log_user_interactions"],
"log_tokens": st.session_state["log_tokens"],
},
"orchestrator": {"strategy": st.session_state["orchestrator_strategy"]},
"integrated_vectorization_config": (
integrated_vectorization_config
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION
else None
),
"enable_chat_history": st.session_state["enable_chat_history"],
}
ConfigHelper.save_config_as_active(current_config)
st.success(
"Configuration saved successfully! Please restart the chat service for these changes to take effect."
)
if should_save:
current_config = {
"prompts": {
"condense_question_prompt": "", # st.session_state['condense_question_prompt'],
"answering_system_prompt": st.session_state[
"answering_system_prompt"
],
"answering_user_prompt": st.session_state["answering_user_prompt"],
"use_on_your_data_format": st.session_state[
"use_on_your_data_format"
],
"post_answering_prompt": st.session_state["post_answering_prompt"],
"enable_post_answering_prompt": st.session_state[
"enable_post_answering_prompt"
],
"enable_content_safety": st.session_state["enable_content_safety"],
"ai_assistant_type": st.session_state["ai_assistant_type"],
"conversational_flow": st.session_state["conversational_flow"],
},
"messages": {
"post_answering_filter": st.session_state[
"post_answering_filter_message"
]
},
"example": {
"documents": st.session_state["example_documents"],
"user_question": st.session_state["example_user_question"],
"answer": st.session_state["example_answer"],
},
"document_processors": document_processors,
"logging": {
"log_user_interactions": st.session_state["log_user_interactions"],
"log_tokens": st.session_state["log_tokens"],
},
"orchestrator": {"strategy": st.session_state["orchestrator_strategy"]},
"integrated_vectorization_config": (
integrated_vectorization_config
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION
else None
),
"enable_chat_history": st.session_state["enable_chat_history"],
}
ConfigHelper.save_config_as_active(current_config)
st.success(
"Configuration saved successfully! Please restart the chat service for these changes to take effect."
)

with st.popover(":red[Reset configuration to defaults]"):

Expand Down
Loading
Loading