Skip to content

Commit e873ba9

Browse files
authored
Evaluation workflow for GitHub Actions (Azure-Samples#2350)
* Add evaluation workflow * Trying to trigger workflow * Remove conditional * Update workflow * Add back old python file * New branch for eval * Fix uv * Remove python tests for now * New PR for eval * Add debug * Add workflow dispatch * Add workflow dispatch * Remove comment for now * Add workflow push * Add checkout * Try azd env new first * Try refresh * Add env config * Fix the action vars * Fix local server start * Fix app run * logs pos * Run app directly * nohup * Log more * Logger calls * Fix log calls * Remove empty string values * Ask less questions * Evaluate all questions * Base on comment * Base on comment * Revert unneeded changes * Add note, link eval docs in more places, link to videos
1 parent a54e8eb commit e873ba9

22 files changed

+530
-75
lines changed

.github/workflows/azure-dev.yml

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ jobs:
6969
AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY }}
7070
AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION }}
7171
AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU }}
72+
USE_EVAL: ${{ vars.USE_EVAL }}
73+
AZURE_OPENAI_EVAL_MODEL: ${{ vars.AZURE_OPENAI_EVAL_MODEL }}
74+
AZURE_OPENAI_EVAL_MODEL_VERSION: ${{ vars.AZURE_OPENAI_EVAL_MODEL_VERSION }}
75+
AZURE_OPENAI_EVAL_DEPLOYMENT: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT }}
76+
AZURE_OPENAI_EVAL_DEPLOYMENT_SKU: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT_SKU }}
77+
AZURE_OPENAI_EVAL_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT_CAPACITY }}
7278
AZURE_OPENAI_DISABLE_KEYS: ${{ vars.AZURE_OPENAI_DISABLE_KEYS }}
7379
OPENAI_HOST: ${{ vars.OPENAI_HOST }}
7480
OPENAI_API_KEY: ${{ vars.OPENAI_API_KEY }}

.github/workflows/evaluate.yaml

+243
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
name: Evaluate RAG answer flow
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
# Set up permissions for deploying with secretless Azure federated credentials
8+
# https://learn.microsoft.com/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
9+
permissions:
10+
id-token: write
11+
contents: read
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
evaluate:
17+
if: |
18+
contains('["OWNER", "CONTRIBUTOR", "COLLABORATOR", "MEMBER"]', github.event.comment.author_association) &&
19+
github.event.issue.pull_request &&
20+
github.event.comment.body == '/evaluate'
21+
runs-on: ubuntu-latest
22+
env:
23+
# azd required
24+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
25+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
26+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
27+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
28+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
29+
# project specific
30+
AZURE_OPENAI_SERVICE: ${{ vars.AZURE_OPENAI_SERVICE }}
31+
AZURE_OPENAI_LOCATION: ${{ vars.AZURE_OPENAI_LOCATION }}
32+
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
33+
AZURE_OPENAI_RESOURCE_GROUP: ${{ vars.AZURE_OPENAI_RESOURCE_GROUP }}
34+
AZURE_DOCUMENTINTELLIGENCE_SERVICE: ${{ vars.AZURE_DOCUMENTINTELLIGENCE_SERVICE }}
35+
AZURE_DOCUMENTINTELLIGENCE_RESOURCE_GROUP: ${{ vars.AZURE_DOCUMENTINTELLIGENCE_RESOURCE_GROUP }}
36+
AZURE_DOCUMENTINTELLIGENCE_SKU: ${{ vars.AZURE_DOCUMENTINTELLIGENCE_SKU }}
37+
AZURE_DOCUMENTINTELLIGENCE_LOCATION: ${{ vars.AZURE_DOCUMENTINTELLIGENCE_LOCATION }}
38+
AZURE_COMPUTER_VISION_SERVICE: ${{ vars.AZURE_COMPUTER_VISION_SERVICE }}
39+
AZURE_COMPUTER_VISION_RESOURCE_GROUP: ${{ vars.AZURE_COMPUTER_VISION_RESOURCE_GROUP }}
40+
AZURE_COMPUTER_VISION_LOCATION: ${{ vars.AZURE_COMPUTER_VISION_LOCATION }}
41+
AZURE_COMPUTER_VISION_SKU: ${{ vars.AZURE_COMPUTER_VISION_SKU }}
42+
AZURE_SEARCH_INDEX: ${{ vars.AZURE_SEARCH_INDEX }}
43+
AZURE_SEARCH_SERVICE: ${{ vars.AZURE_SEARCH_SERVICE }}
44+
AZURE_SEARCH_SERVICE_RESOURCE_GROUP: ${{ vars.AZURE_SEARCH_SERVICE_RESOURCE_GROUP }}
45+
AZURE_SEARCH_SERVICE_LOCATION: ${{ vars.AZURE_SEARCH_SERVICE_LOCATION }}
46+
AZURE_SEARCH_SERVICE_SKU: ${{ vars.AZURE_SEARCH_SERVICE_SKU }}
47+
AZURE_SEARCH_QUERY_LANGUAGE: ${{ vars.AZURE_SEARCH_QUERY_LANGUAGE }}
48+
AZURE_SEARCH_QUERY_SPELLER: ${{ vars.AZURE_SEARCH_QUERY_SPELLER }}
49+
AZURE_SEARCH_SEMANTIC_RANKER: ${{ vars.AZURE_SEARCH_SEMANTIC_RANKER }}
50+
AZURE_STORAGE_ACCOUNT: ${{ vars.AZURE_STORAGE_ACCOUNT }}
51+
AZURE_STORAGE_RESOURCE_GROUP: ${{ vars.AZURE_STORAGE_RESOURCE_GROUP }}
52+
AZURE_STORAGE_SKU: ${{ vars.AZURE_STORAGE_SKU }}
53+
AZURE_APP_SERVICE_PLAN: ${{ vars.AZURE_APP_SERVICE_PLAN }}
54+
AZURE_APP_SERVICE_SKU: ${{ vars.AZURE_APP_SERVICE_SKU }}
55+
AZURE_APP_SERVICE: ${{ vars.AZURE_APP_SERVICE }}
56+
AZURE_OPENAI_CHATGPT_MODEL: ${{ vars.AZURE_OPENAI_CHATGPT_MODEL }}
57+
AZURE_OPENAI_CHATGPT_DEPLOYMENT: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT }}
58+
AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY }}
59+
AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION }}
60+
AZURE_OPENAI_EMB_MODEL_NAME: ${{ vars.AZURE_OPENAI_EMB_MODEL_NAME }}
61+
AZURE_OPENAI_EMB_DEPLOYMENT: ${{ vars.AZURE_OPENAI_EMB_DEPLOYMENT }}
62+
AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY }}
63+
AZURE_OPENAI_EMB_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_EMB_DEPLOYMENT_VERSION }}
64+
AZURE_OPENAI_EMB_DIMENSIONS: ${{ vars.AZURE_OPENAI_EMB_DIMENSIONS }}
65+
AZURE_OPENAI_GPT4V_MODEL: ${{ vars.AZURE_OPENAI_GPT4V_MODEL }}
66+
AZURE_OPENAI_GPT4V_DEPLOYMENT: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT }}
67+
AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY }}
68+
AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION }}
69+
AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU }}
70+
USE_EVAL: ${{ vars.USE_EVAL }}
71+
AZURE_OPENAI_EVAL_MODEL: ${{ vars.AZURE_OPENAI_EVAL_MODEL }}
72+
AZURE_OPENAI_EVAL_MODEL_VERSION: ${{ vars.AZURE_OPENAI_EVAL_MODEL_VERSION }}
73+
AZURE_OPENAI_EVAL_DEPLOYMENT: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT }}
74+
AZURE_OPENAI_EVAL_DEPLOYMENT_SKU: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT_SKU }}
75+
AZURE_OPENAI_EVAL_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_EVAL_DEPLOYMENT_CAPACITY }}
76+
AZURE_OPENAI_DISABLE_KEYS: ${{ vars.AZURE_OPENAI_DISABLE_KEYS }}
77+
OPENAI_HOST: ${{ vars.OPENAI_HOST }}
78+
OPENAI_API_KEY: ${{ vars.OPENAI_API_KEY }}
79+
OPENAI_ORGANIZATION: ${{ vars.OPENAI_ORGANIZATION }}
80+
AZURE_USE_APPLICATION_INSIGHTS: ${{ vars.AZURE_USE_APPLICATION_INSIGHTS }}
81+
AZURE_APPLICATION_INSIGHTS: ${{ vars.AZURE_APPLICATION_INSIGHTS }}
82+
AZURE_APPLICATION_INSIGHTS_DASHBOARD: ${{ vars.AZURE_APPLICATION_INSIGHTS_DASHBOARD }}
83+
AZURE_LOG_ANALYTICS: ${{ vars.AZURE_LOG_ANALYTICS }}
84+
USE_VECTORS: ${{ vars.USE_VECTORS }}
85+
USE_GPT4V: ${{ vars.USE_GPT4V }}
86+
AZURE_VISION_ENDPOINT: ${{ vars.AZURE_VISION_ENDPOINT }}
87+
VISION_SECRET_NAME: ${{ vars.VISION_SECRET_NAME }}
88+
ENABLE_LANGUAGE_PICKER: ${{ vars.ENABLE_LANGUAGE_PICKER }}
89+
USE_SPEECH_INPUT_BROWSER: ${{ vars.USE_SPEECH_INPUT_BROWSER }}
90+
USE_SPEECH_OUTPUT_BROWSER: ${{ vars.USE_SPEECH_OUTPUT_BROWSER }}
91+
USE_SPEECH_OUTPUT_AZURE: ${{ vars.USE_SPEECH_OUTPUT_AZURE }}
92+
AZURE_SPEECH_SERVICE: ${{ vars.AZURE_SPEECH_SERVICE }}
93+
AZURE_SPEECH_SERVICE_RESOURCE_GROUP: ${{ vars.AZURE_SPEECH_RESOURCE_GROUP }}
94+
AZURE_SPEECH_SERVICE_LOCATION: ${{ vars.AZURE_SPEECH_SERVICE_LOCATION }}
95+
AZURE_SPEECH_SERVICE_SKU: ${{ vars.AZURE_SPEECH_SERVICE_SKU }}
96+
AZURE_SPEECH_SERVICE_VOICE: ${{ vars.AZURE_SPEECH_SERVICE_VOICE }}
97+
AZURE_KEY_VAULT_NAME: ${{ vars.AZURE_KEY_VAULT_NAME }}
98+
AZURE_USE_AUTHENTICATION: ${{ vars.AZURE_USE_AUTHENTICATION }}
99+
AZURE_ENFORCE_ACCESS_CONTROL: ${{ vars.AZURE_ENFORCE_ACCESS_CONTROL }}
100+
AZURE_ENABLE_GLOBAL_DOCUMENT_ACCESS: ${{ vars.AZURE_ENABLE_GLOBAL_DOCUMENT_ACCESS }}
101+
AZURE_ENABLE_UNAUTHENTICATED_ACCESS: ${{ vars.AZURE_ENABLE_UNAUTHENTICATED_ACCESS }}
102+
AZURE_AUTH_TENANT_ID: ${{ vars.AZURE_AUTH_TENANT_ID }}
103+
AZURE_SERVER_APP_ID: ${{ vars.AZURE_SERVER_APP_ID }}
104+
AZURE_CLIENT_APP_ID: ${{ vars.AZURE_CLIENT_APP_ID }}
105+
ALLOWED_ORIGIN: ${{ vars.ALLOWED_ORIGIN }}
106+
AZURE_ADLS_GEN2_STORAGE_ACCOUNT: ${{ vars.AZURE_ADLS_GEN2_STORAGE_ACCOUNT }}
107+
AZURE_ADLS_GEN2_FILESYSTEM_PATH: ${{ vars.AZURE_ADLS_GEN2_FILESYSTEM_PATH }}
108+
AZURE_ADLS_GEN2_FILESYSTEM: ${{ vars.AZURE_ADLS_GEN2_FILESYSTEM }}
109+
DEPLOYMENT_TARGET: ${{ vars.DEPLOYMENT_TARGET }}
110+
AZURE_CONTAINER_APPS_WORKLOAD_PROFILE: ${{ vars.AZURE_CONTAINER_APPS_WORKLOAD_PROFILE }}
111+
USE_CHAT_HISTORY_BROWSER: ${{ vars.USE_CHAT_HISTORY_BROWSER }}
112+
USE_MEDIA_DESCRIBER_AZURE_CU: ${{ vars.USE_MEDIA_DESCRIBER_AZURE_CU }}
113+
steps:
114+
115+
- name: Comment on pull request
116+
uses: actions/github-script@v7
117+
with:
118+
script: |
119+
github.rest.issues.createComment({
120+
issue_number: context.issue.number,
121+
owner: context.repo.owner,
122+
repo: context.repo.repo,
123+
body: "Starting evaluation! Check the Actions tab for progress, or wait for a comment with the results."
124+
})
125+
126+
- name: Checkout pull request
127+
uses: actions/checkout@v4
128+
with:
129+
ref: refs/pull/${{ github.event.issue.number }}/head
130+
131+
- name: Install uv
132+
uses: astral-sh/setup-uv@v5
133+
with:
134+
enable-cache: true
135+
version: "0.4.20"
136+
cache-dependency-glob: "requirements**.txt"
137+
python-version: "3.11"
138+
139+
- name: Setup node
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: 18
143+
144+
- name: Install azd
145+
uses: Azure/[email protected]
146+
147+
- name: Login to Azure with az CLI
148+
uses: azure/login@v2
149+
with:
150+
client-id: ${{ env.AZURE_CLIENT_ID }}
151+
tenant-id: ${{ env.AZURE_TENANT_ID }}
152+
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
153+
154+
- name: Set az account
155+
uses: azure/CLI@v2
156+
with:
157+
inlineScript: |
158+
az account set --subscription ${{env.AZURE_SUBSCRIPTION_ID}}
159+
160+
- name: Login to with Azure with azd (Federated Credentials)
161+
if: ${{ env.AZURE_CLIENT_ID != '' }}
162+
run: |
163+
azd auth login `
164+
--client-id "$Env:AZURE_CLIENT_ID" `
165+
--federated-credential-provider "github" `
166+
--tenant-id "$Env:AZURE_TENANT_ID"
167+
shell: pwsh
168+
169+
- name: Refresh azd environment variables
170+
run: |
171+
azd env refresh -e $AZURE_ENV_NAME --no-prompt
172+
env:
173+
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
174+
175+
- name: Build frontend
176+
run: |
177+
cd ./app/frontend
178+
npm install
179+
npm run build
180+
181+
- name: Install dependencies
182+
run: |
183+
uv pip install -r requirements-dev.txt
184+
185+
- name: Run local server in background
186+
run: |
187+
cd app/backend
188+
RUNNER_TRACKING_ID="" && (nohup python3 -m quart --app main:app run --port 50505 > serverlogs.out 2> serverlogs.err &)
189+
cd ../..
190+
191+
- name: Install evaluate dependencies
192+
run: |
193+
uv pip install -r evals/requirements.txt
194+
195+
- name: Evaluate local RAG flow
196+
run: |
197+
python evals/evaluate.py --targeturl=http://127.0.0.1:50505/chat --resultsdir=evals/results/pr${{ github.event.issue.number }}
198+
199+
- name: Upload eval results as build artifact
200+
if: ${{ success() }}
201+
uses: actions/upload-artifact@v4
202+
with:
203+
name: eval_result
204+
path: ./evals/results/pr${{ github.event.issue.number }}
205+
206+
- name: Upload server logs as build artifact
207+
uses: actions/upload-artifact@v4
208+
with:
209+
name: server_logs
210+
path: ./app/backend/serverlogs.out
211+
212+
- name: Upload server error logs as build artifact
213+
uses: actions/upload-artifact@v4
214+
with:
215+
name: server_error_logs
216+
path: ./app/backend/serverlogs.err
217+
218+
- name: Summarize results
219+
if: ${{ success() }}
220+
run: |
221+
echo "## Evaluation results" >> eval-summary.md
222+
python -m evaltools summary evals/results --output=markdown >> eval-summary.md
223+
echo "## Answer differences across runs" >> run-diff.md
224+
python -m evaltools diff evals/results/baseline evals/results/pr${{ github.event.issue.number }} --output=markdown >> run-diff.md
225+
cat eval-summary.md >> $GITHUB_STEP_SUMMARY
226+
cat run-diff.md >> $GITHUB_STEP_SUMMARY
227+
228+
- name: Comment on pull request
229+
uses: actions/github-script@v7
230+
with:
231+
script: |
232+
const fs = require('fs');
233+
const summaryPath = "eval-summary.md";
234+
const summary = fs.readFileSync(summaryPath, 'utf8');
235+
const runId = process.env.GITHUB_RUN_ID;
236+
const repo = process.env.GITHUB_REPOSITORY;
237+
const actionsUrl = `https://github.com/${repo}/actions/runs/${runId}`;
238+
github.rest.issues.createComment({
239+
issue_number: context.issue.number,
240+
owner: context.repo.owner,
241+
repo: context.repo.repo,
242+
body: `${summary}\n\n[Check the workflow run for more details](${actionsUrl}).`
243+
})

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,15 @@ You can find extensive documentation in the [docs](docs/README.md) folder:
253253
- [Deploying with existing Azure resources](docs/deploy_existing.md)
254254
- [Deploying from a free account](docs/deploy_lowcost.md)
255255
- [Enabling optional features](docs/deploy_features.md)
256+
- [All features](docs/deploy_features.md)
256257
- [Login and access control](docs/login_and_acl.md)
257258
- [GPT-4 Turbo with Vision](docs/gpt4v.md)
258259
- [Private endpoints](docs/deploy_private.md)
259260
- [Sharing deployment environments](docs/sharing_environments.md)
260261
- [Local development](docs/localdev.md)
261262
- [Customizing the app](docs/customization.md)
262263
- [Data ingestion](docs/data_ingestion.md)
264+
- [Evaluation](docs/evaluation.md)
263265
- [Monitoring with Application Insights](docs/monitoring.md)
264266
- [Productionizing](docs/productionizing.md)
265267
- [Alternative RAG chat samples](docs/other_samples.md)

app/backend/app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ async def setup_clients():
420420
OPENAI_HOST = os.getenv("OPENAI_HOST", "azure")
421421
OPENAI_CHATGPT_MODEL = os.environ["AZURE_OPENAI_CHATGPT_MODEL"]
422422
OPENAI_EMB_MODEL = os.getenv("AZURE_OPENAI_EMB_MODEL_NAME", "text-embedding-ada-002")
423-
OPENAI_EMB_DIMENSIONS = int(os.getenv("AZURE_OPENAI_EMB_DIMENSIONS", 1536))
423+
OPENAI_EMB_DIMENSIONS = int(os.getenv("AZURE_OPENAI_EMB_DIMENSIONS") or 1536)
424424
# Used with Azure OpenAI deployments
425425
AZURE_OPENAI_SERVICE = os.getenv("AZURE_OPENAI_SERVICE")
426426
AZURE_OPENAI_GPT4V_DEPLOYMENT = os.environ.get("AZURE_OPENAI_GPT4V_DEPLOYMENT")
@@ -450,8 +450,8 @@ async def setup_clients():
450450
KB_FIELDS_CONTENT = os.getenv("KB_FIELDS_CONTENT", "content")
451451
KB_FIELDS_SOURCEPAGE = os.getenv("KB_FIELDS_SOURCEPAGE", "sourcepage")
452452

453-
AZURE_SEARCH_QUERY_LANGUAGE = os.getenv("AZURE_SEARCH_QUERY_LANGUAGE", "en-us")
454-
AZURE_SEARCH_QUERY_SPELLER = os.getenv("AZURE_SEARCH_QUERY_SPELLER", "lexicon")
453+
AZURE_SEARCH_QUERY_LANGUAGE = os.getenv("AZURE_SEARCH_QUERY_LANGUAGE") or "en-us"
454+
AZURE_SEARCH_QUERY_SPELLER = os.getenv("AZURE_SEARCH_QUERY_SPELLER") or "lexicon"
455455
AZURE_SEARCH_SEMANTIC_RANKER = os.getenv("AZURE_SEARCH_SEMANTIC_RANKER", "free").lower()
456456

457457
AZURE_SPEECH_SERVICE_ID = os.getenv("AZURE_SPEECH_SERVICE_ID")

azure.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ pipeline:
7373
- AZURE_OPENAI_EMB_DEPLOYMENT_VERSION
7474
- AZURE_OPENAI_EMB_DEPLOYMENT_SKU
7575
- AZURE_OPENAI_EMB_DIMENSIONS
76+
- USE_EVAL
77+
- AZURE_OPENAI_EVAL_MODEL
78+
- AZURE_OPENAI_EVAL_MODEL_VERSION
79+
- AZURE_OPENAI_EVAL_DEPLOYMENT
80+
- AZURE_OPENAI_EVAL_DEPLOYMENT_SKU
81+
- AZURE_OPENAI_EVAL_DEPLOYMENT_CAPACITY
7682
- AZURE_OPENAI_GPT4V_MODEL
7783
- AZURE_OPENAI_GPT4V_DEPLOYMENT
7884
- AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY

docs/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ These are advanced topics that are not necessary for a basic deployment.
1010
- [Deploying with existing Azure resources](deploy_existing.md)
1111
- [Deploying from a free account](deploy_lowcost.md)
1212
- [Enabling optional features](deploy_features.md)
13+
- [All features](docs/deploy_features.md)
1314
- [Login and access control](login_and_acl.md)
1415
- [GPT-4 Turbo with Vision](gpt4v.md)
1516
- [Private endpoints](deploy_private.md)
1617
- [Sharing deployment environments](sharing_environments.md)
1718
- [Local development](localdev.md)
1819
- [Customizing the app](customization.md)
20+
- [Evaluation](docs/evaluation.md)
1921
- [Data ingestion](data_ingestion.md)
2022
- [Monitoring with Application Insights](monitoring.md)
2123
- [Productionizing](productionizing.md)

docs/customization.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# RAG chat: Customizing the chat app
22

3-
This guide provides more details for customizing the Chat App.
3+
[📺 Watch: (RAG Deep Dive series) Customizing the app](https://www.youtube.com/watch?v=D3slfMqydHc)
4+
5+
This guide provides more details for customizing the RAG chat app.
46

57
- [Using your own data](#using-your-own-data)
68
- [Customizing the UI](#customizing-the-ui)
@@ -124,7 +126,7 @@ You can also try changing the ChatCompletion parameters, like temperature, to se
124126

125127
### Improving Azure AI Search results
126128

127-
If the problem is with Azure AI Search (step 2 above), the first step is to check what search parameters you're using. Generally, the best results are found with hybrid search (text + vectors) plus the additional semantic re-ranking step, and that's what we've enabled by default. There may be some domains where that combination isn't optimal, however. Check out this blog post which [evaluates AI search strategies](https://techcommunity.microsoft.com/blog/azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid-retrieval-and-ranking-ca/3929167) for a better understanding of the differences.
129+
If the problem is with Azure AI Search (step 2 above), the first step is to check what search parameters you're using. Generally, the best results are found with hybrid search (text + vectors) plus the additional semantic re-ranking step, and that's what we've enabled by default. There may be some domains where that combination isn't optimal, however. Check out this blog post which [evaluates AI search strategies](https://techcommunity.microsoft.com/blog/azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid-retrieval-and-ranking-ca/3929167) for a better understanding of the differences, or watch this [RAG Deep Dive video on AI Search](https://www.youtube.com/watch?v=ugJy9QkgLYg).
128130

129131
#### Configuring parameters in the app
130132

@@ -175,4 +177,4 @@ Here are additional ways for improving the search results:
175177

176178
### Evaluating answer quality
177179

178-
Once you've made changes to the prompts or settings, you'll want to rigorously evaluate the results to see if they've improved. You can use tools in [the AI RAG Chat evaluator](https://github.com/Azure-Samples/ai-rag-chat-evaluator) repository to run evaluations, review results, and compare answers across runs.
180+
Once you've made changes to the prompts or settings, you'll want to rigorously evaluate the results to see if they've improved. Follow the [evaluation guide](./evaluation.md) to learn how to run evaluations, review results, and compare answers across runs.

docs/deploy_features.md

+4
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Convert them first to PDF or image formats to enable media description.
179179

180180
## Enabling client-side chat history
181181

182+
[📺 Watch: (RAG Deep Dive series) Storing chat history](https://www.youtube.com/watch?v=1YiTFnnLVIA)
183+
182184
This feature allows users to view the chat history of their conversation, stored in the browser using [IndexedDB](https://developer.mozilla.org/docs/Web/API/IndexedDB_API). That means the chat history will be available only on the device where the chat was initiated. To enable browser-stored chat history, run:
183185

184186
```shell
@@ -187,6 +189,8 @@ azd env set USE_CHAT_HISTORY_BROWSER true
187189

188190
## Enabling persistent chat history with Azure Cosmos DB
189191

192+
[📺 Watch: (RAG Deep Dive series) Storing chat history](https://www.youtube.com/watch?v=1YiTFnnLVIA)
193+
190194
This feature allows authenticated users to view the chat history of their conversations, stored in the server-side storage using [Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db/).This option requires that authentication be enabled. The chat history will be persistent and accessible from any device where the user logs in with the same account. To enable server-stored chat history, run:
191195

192196
```shell

0 commit comments

Comments
 (0)