Skip to content

Commit 2382831

Browse files
Roopan-MicrosoftAjitPadhi-MicrosoftPavan-Microsoftross-p-smithgpickett
authored
fix: merging dev changes to main branch (#1629)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Ajit Padhi <[email protected]> Co-authored-by: Pavan-Microsoft <[email protected]> Co-authored-by: Ross Smith <[email protected]> Co-authored-by: gpickett <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Prajwal D C <[email protected]> Co-authored-by: Harmanpreet-Microsoft <[email protected]> Co-authored-by: UtkarshMishra-Microsoft <[email protected]> Co-authored-by: Priyanka-Microsoft <[email protected]> Co-authored-by: Prasanjeet-Microsoft <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiran-Siluveru-Microsoft <[email protected]> Co-authored-by: Prashant-Microsoft <[email protected]> Co-authored-by: Rohini-Microsoft <[email protected]> Co-authored-by: Avijit-Microsoft <[email protected]> Co-authored-by: RaviKiran-Microsoft <[email protected]> Co-authored-by: Somesh Joshi <[email protected]> Co-authored-by: Himanshi Agrawal <[email protected]> Co-authored-by: pradeepjha-microsoft <[email protected]> Co-authored-by: Harmanpreet Kaur <[email protected]> Co-authored-by: Bangarraju-Microsoft <[email protected]> Co-authored-by: Harsh-Microsoft <[email protected]>
1 parent c5fda01 commit 2382831

File tree

64 files changed

+11091
-1876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+11091
-1876
lines changed

.env.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ AZURE_SEARCH_DATASOURCE_NAME=
2222
# Azure OpenAI for generating the answer and computing the embedding of the documents
2323
AZURE_OPENAI_RESOURCE=
2424
AZURE_OPENAI_API_KEY=
25-
AZURE_OPENAI_MODEL=gpt-35-turbo
26-
AZURE_OPENAI_MODEL_NAME=gpt-35-turbo
25+
AZURE_OPENAI_MODEL=gpt-4o
26+
AZURE_OPENAI_MODEL_NAME=gpt-4o
2727
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
2828
AZURE_OPENAI_TEMPERATURE=0
2929
AZURE_OPENAI_TOP_P=1.0

.github/workflows/bicep-audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Validate bicep templates
22
on:
33
push:
4-
branches:
4+
branches:
55
- main
66
paths:
77
- "**/*.bicep"
88
pull_request:
9-
branches:
9+
branches:
1010
- main
1111
paths:
1212
- "**/*.bicep"

.github/workflows/build-docker-images.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ on:
1212
- dev
1313
- demo
1414
types:
15-
- opened
16-
- ready_for_review
17-
- reopened
18-
- synchronize
15+
- opened
16+
- ready_for_review
17+
- reopened
18+
- synchronize
1919
merge_group:
2020
workflow_dispatch:
2121

@@ -32,8 +32,10 @@ jobs:
3232
dockerfile: docker/Frontend.Dockerfile
3333
uses: ./.github/workflows/build-docker.yml
3434
with:
35-
registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
36-
username: ${{ github.ref_name == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
35+
old_registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' }}
36+
new_registry: 'cwydcontainerreg.azurecr.io'
37+
old_username: ${{ github.ref_name == 'main' && 'fruoccopublic' }}
38+
new_username: 'cwydcontainerreg'
3739
app_name: ${{ matrix.app_name }}
3840
dockerfile: ${{ matrix.dockerfile }}
3941
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}

.github/workflows/build-docker.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Reusable Docker build and push workflow
33
on:
44
workflow_call:
55
inputs:
6-
registry:
6+
old_registry:
77
required: true
88
type: string
9-
username:
9+
old_username:
10+
required: true
11+
type: string
12+
new_registry:
13+
required: true
14+
type: string
15+
new_username:
1016
required: true
1117
type: string
1218
app_name:
@@ -31,20 +37,30 @@ jobs:
3137
- name: Checkout
3238
uses: actions/checkout@v4
3339

34-
- name: Docker Login
40+
# Login for 'main' branch to both registries
41+
- name: Docker Login to fruoccopublic (Main)
3542
if: ${{ inputs.push == true && github.ref_name == 'main' }}
3643
uses: docker/login-action@v3
3744
with:
38-
registry: ${{ inputs.registry }}
39-
username: ${{ inputs.username }}
45+
registry: ${{ inputs.old_registry }}
46+
username: ${{ inputs.old_username }}
4047
password: ${{ secrets.DOCKER_PASSWORD }}
4148

42-
- name: Dev Docker Login
49+
- name: Docker Login to cwydcontainerreg (Main)
50+
if: ${{ inputs.push == true && github.ref_name == 'main' }}
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ${{ inputs.new_registry }}
54+
username: ${{ inputs.new_username }}
55+
password: ${{ secrets.DEV_DOCKER_PASSWORD }}
56+
57+
# Login for 'dev' and 'demo' branches to cwydcontainerreg only
58+
- name: Docker Login to cwydcontainerreg (Dev/Demo)
4359
if: ${{ inputs.push == true && (github.ref_name == 'dev' || github.ref_name == 'demo') }}
4460
uses: docker/login-action@v3
4561
with:
46-
registry: ${{ inputs.registry }}
47-
username: ${{ inputs.username }}
62+
registry: ${{ inputs.new_registry }}
63+
username: ${{ inputs.new_username }}
4864
password: ${{ secrets.DEV_DOCKER_PASSWORD }}
4965

5066
- name: Set up Docker Buildx
@@ -54,13 +70,26 @@ jobs:
5470
id: date
5571
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
5672

57-
- name: Build Docker Image and optionally push
73+
- name: Build Docker Image and optionally push (Old Registry)
74+
if: ${{ github.ref_name == 'main' }}
75+
uses: docker/build-push-action@v6
76+
with:
77+
context: .
78+
file: ${{ inputs.dockerfile }}
79+
push: ${{ inputs.push }}
80+
cache-from: type=registry,ref=${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || github.ref_name }}
81+
tags: |
82+
${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || 'default' }}
83+
${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ steps.date.outputs.date }}_${{ github.run_number }}
84+
85+
- name: Build Docker Image and optionally push (New Registry)
86+
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
5887
uses: docker/build-push-action@v6
5988
with:
6089
context: .
6190
file: ${{ inputs.dockerfile }}
6291
push: ${{ inputs.push }}
63-
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 }}
92+
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.head_ref || github.ref_name }}
6493
tags: |
65-
${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || 'default' }}
66-
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.date.outputs.date }}_${{ github.run_number }}
94+
${{ inputs.new_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || 'default' }}
95+
${{ inputs.new_registry }}/${{ inputs.app_name }}:${{ steps.date.outputs.date }}_${{ github.run_number }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# generated frontend files
77
code/dist/
8+
code/frontend/coverage
89

910
# User-specific files
1011
*.rsuser

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ Select either "PostgreSQL" or "Cosmos DB":
194194

195195
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
196196

197-
**Note**: The default configuration deploys an OpenAI Model "gpt-35-turbo" with version 0613. However, not all
198-
locations support this version. If you're deploying to a location that doesn't support version 0613, you'll need to
197+
**Note**: The default configuration deploys an OpenAI Model "gpt-4o" with version 2024-05-13. However, not all
198+
locations support this version. If you're deploying to a location that doesn't support version 2024-05-13, you'll need to
199199
switch to a lower version. To find out which versions are supported in different regions, visit the
200-
[GPT-35 Turbo Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35-turbo-model-availability) page.
200+
[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.
201201

202202
### Testing the deployment
203203
1. Navigate to the admin site, where you can upload documents. It will be located at:

code/backend/batch/utilities/helpers/env_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def __load_config(self, **kwargs) -> None:
174174
else:
175175
# Otherwise, fallback to individual environment variables
176176
self.AZURE_OPENAI_MODEL = os.getenv(
177-
"AZURE_OPENAI_MODEL", "gpt-35-turbo-16k"
177+
"AZURE_OPENAI_MODEL", "gpt-4o"
178178
)
179179
self.AZURE_OPENAI_MODEL_NAME = os.getenv(
180-
"AZURE_OPENAI_MODEL_NAME", "gpt-35-turbo-16k"
180+
"AZURE_OPENAI_MODEL_NAME", "gpt-4o"
181181
)
182182

183183
self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4")

code/backend/pages/04_Configuration.py

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,21 @@ def validate_documents():
410410

411411
if st.form_submit_button("Save configuration"):
412412
document_processors = []
413+
should_save = True
413414
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION is False:
414415
valid = all(
415416
row["document_type"]
416417
and row["chunking_strategy"]
418+
and row["chunking_size"]
419+
and row["chunking_overlap"]
417420
and row["loading_strategy"]
418421
for row in edited_document_processors
419422
)
420423
if not valid:
421424
st.error(
422425
"Please ensure all fields are selected and not left blank in Document processing configuration."
423426
)
427+
should_save = False
424428
document_processors = list(
425429
map(
426430
lambda x: {
@@ -440,51 +444,52 @@ def validate_documents():
440444
edited_document_processors,
441445
)
442446
)
443-
current_config = {
444-
"prompts": {
445-
"condense_question_prompt": "", # st.session_state['condense_question_prompt'],
446-
"answering_system_prompt": st.session_state[
447-
"answering_system_prompt"
448-
],
449-
"answering_user_prompt": st.session_state["answering_user_prompt"],
450-
"use_on_your_data_format": st.session_state[
451-
"use_on_your_data_format"
452-
],
453-
"post_answering_prompt": st.session_state["post_answering_prompt"],
454-
"enable_post_answering_prompt": st.session_state[
455-
"enable_post_answering_prompt"
456-
],
457-
"enable_content_safety": st.session_state["enable_content_safety"],
458-
"ai_assistant_type": st.session_state["ai_assistant_type"],
459-
"conversational_flow": st.session_state["conversational_flow"],
460-
},
461-
"messages": {
462-
"post_answering_filter": st.session_state[
463-
"post_answering_filter_message"
464-
]
465-
},
466-
"example": {
467-
"documents": st.session_state["example_documents"],
468-
"user_question": st.session_state["example_user_question"],
469-
"answer": st.session_state["example_answer"],
470-
},
471-
"document_processors": document_processors,
472-
"logging": {
473-
"log_user_interactions": st.session_state["log_user_interactions"],
474-
"log_tokens": st.session_state["log_tokens"],
475-
},
476-
"orchestrator": {"strategy": st.session_state["orchestrator_strategy"]},
477-
"integrated_vectorization_config": (
478-
integrated_vectorization_config
479-
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION
480-
else None
481-
),
482-
"enable_chat_history": st.session_state["enable_chat_history"],
483-
}
484-
ConfigHelper.save_config_as_active(current_config)
485-
st.success(
486-
"Configuration saved successfully! Please restart the chat service for these changes to take effect."
487-
)
447+
if should_save:
448+
current_config = {
449+
"prompts": {
450+
"condense_question_prompt": "", # st.session_state['condense_question_prompt'],
451+
"answering_system_prompt": st.session_state[
452+
"answering_system_prompt"
453+
],
454+
"answering_user_prompt": st.session_state["answering_user_prompt"],
455+
"use_on_your_data_format": st.session_state[
456+
"use_on_your_data_format"
457+
],
458+
"post_answering_prompt": st.session_state["post_answering_prompt"],
459+
"enable_post_answering_prompt": st.session_state[
460+
"enable_post_answering_prompt"
461+
],
462+
"enable_content_safety": st.session_state["enable_content_safety"],
463+
"ai_assistant_type": st.session_state["ai_assistant_type"],
464+
"conversational_flow": st.session_state["conversational_flow"],
465+
},
466+
"messages": {
467+
"post_answering_filter": st.session_state[
468+
"post_answering_filter_message"
469+
]
470+
},
471+
"example": {
472+
"documents": st.session_state["example_documents"],
473+
"user_question": st.session_state["example_user_question"],
474+
"answer": st.session_state["example_answer"],
475+
},
476+
"document_processors": document_processors,
477+
"logging": {
478+
"log_user_interactions": st.session_state["log_user_interactions"],
479+
"log_tokens": st.session_state["log_tokens"],
480+
},
481+
"orchestrator": {"strategy": st.session_state["orchestrator_strategy"]},
482+
"integrated_vectorization_config": (
483+
integrated_vectorization_config
484+
if env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION
485+
else None
486+
),
487+
"enable_chat_history": st.session_state["enable_chat_history"],
488+
}
489+
ConfigHelper.save_config_as_active(current_config)
490+
st.success(
491+
"Configuration saved successfully! Please restart the chat service for these changes to take effect."
492+
)
488493

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

0 commit comments

Comments
 (0)