Vineetiitg commited on
Commit
4ce35de
·
1 Parent(s): 850d07f

feat(ui): add 1-click evaluation log download button in Admin RAGAS portal

Browse files
Files changed (3) hide show
  1. git_commands.md +6 -0
  2. reports/eval_report.md +42 -4
  3. ui/app.py +14 -1
git_commands.md CHANGED
@@ -138,4 +138,10 @@ git add data/docs/rest_endpoints_guide.md data/docs/redis_worker_architecture.md
138
  git commit -m "docs(benchmark): add REST/worker architecture documentation and 5-case HF readiness benchmark suite"
139
  ```
140
 
 
 
 
 
 
 
141
 
 
138
  git commit -m "docs(benchmark): add REST/worker architecture documentation and 5-case HF readiness benchmark suite"
139
  ```
140
 
141
+ ### 5. 1-Click RAG Evaluation Report Download in UI
142
+ ```bash
143
+ git add ui/app.py reports/eval_report.md git_commands.md
144
+ git commit -m "feat(ui): add 1-click evaluation log download button in Admin RAGAS portal"
145
+ ```
146
+
147
 
reports/eval_report.md CHANGED
@@ -1,9 +1,47 @@
1
  # RAG Evaluation Report
2
 
3
- Run the local benchmark with:
4
 
5
- ```powershell
6
- .\.venv\Scripts\python.exe -m app.tests.eval_rag
 
 
 
 
 
 
 
 
7
  ```
8
 
9
- This report is regenerated from `datasets/golden_qa.csv` and captures answer overlap, source hit rate, retrieved context count, and latency.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # RAG Evaluation Report
2
 
3
+ Generated: 2026-07-04T11:31:04.338800+00:00
4
 
5
+ ## Overall Metrics
6
+ - **Questions Evaluated:** 5
7
+ - **Source Hit Rate:** 0.6
8
+ - **Average Latency:** 13929.41 ms
9
+
10
+ ### Ragas Scores
11
+ ```json
12
+ {
13
+ "error": "'ChatOpenAI' object has no attribute 'set_run_config'"
14
+ }
15
  ```
16
 
17
+ ## Question Results
18
+
19
+ ### Q: What is Error Code 404?
20
+ **A:** Error Code 404 indicates that the requested server resource was not found, and you should check your network router configuration [sample_error.txt][api_docs.md].
21
+ - Source hit: True
22
+ - Retrieved contexts: 3
23
+ - Latency ms: 39687.2
24
+
25
+ ### Q: What does this support copilot do?
26
+ **A:** This support copilot is designed to answer support documentation queries using retrieved context, currently handling each query independently without conversation memory [implementation_plan.md].
27
+ - Source hit: False
28
+ - Retrieved contexts: 3
29
+ - Latency ms: 12167.86
30
+
31
+ ### Q: How do I reset my password?
32
+ **A:**
33
+ - Source hit: False
34
+ - Retrieved contexts: 0
35
+ - Latency ms: 5999.2
36
+
37
+ ### Q: What is the default rate limit?
38
+ **A:** The default API rate limit is 100 requests per minute per IP address. [api_docs.md]
39
+ - Source hit: True
40
+ - Retrieved contexts: 3
41
+ - Latency ms: 5868.04
42
+
43
+ ### Q: How can I contact support?
44
+ **A:** You can contact support via email at support@example.com or by phone at 1-800-555-0199, available Monday–Friday, 9 AM – 5 PM EST. [contact_info.html] For urgent issues, call the phone number above and press 1 for priority routing. [contact_info.html]
45
+ - Source hit: True
46
+ - Retrieved contexts: 3
47
+ - Latency ms: 5924.76
ui/app.py CHANGED
@@ -411,12 +411,25 @@ def render_evaluation_tab():
411
  st.markdown('</div>', unsafe_allow_html=True)
412
 
413
  st.divider()
414
- st.markdown("#### 📑 Latest Evaluation Report")
415
  try:
416
  res = get_json("/admin/eval")
417
  report_text = res.get("report", "No evaluation report available.")
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  st.markdown(f'<div class="glass-card">{report_text}</div>', unsafe_allow_html=True)
419
  except requests.RequestException:
 
420
  st.info("💡 No evaluation report available yet. Click the button above to run your first evaluation!")
421
 
422
 
 
411
  st.markdown('</div>', unsafe_allow_html=True)
412
 
413
  st.divider()
 
414
  try:
415
  res = get_json("/admin/eval")
416
  report_text = res.get("report", "No evaluation report available.")
417
+ col_hdr, col_dl = st.columns([3, 1])
418
+ with col_hdr:
419
+ st.markdown("#### 📑 Latest Evaluation Report")
420
+ with col_dl:
421
+ if report_text and report_text != "No evaluation report available.":
422
+ st.download_button(
423
+ label="📥 Download Log (eval_report.md)",
424
+ data=report_text,
425
+ file_name="eval_report.md",
426
+ mime="text/markdown",
427
+ use_container_width=True,
428
+ type="primary",
429
+ )
430
  st.markdown(f'<div class="glass-card">{report_text}</div>', unsafe_allow_html=True)
431
  except requests.RequestException:
432
+ st.markdown("#### 📑 Latest Evaluation Report")
433
  st.info("💡 No evaluation report available yet. Click the button above to run your first evaluation!")
434
 
435