anktechsol commited on
Commit
f22fae1
·
verified ·
1 Parent(s): a62a79f

Update src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +48 -12
src/app.py CHANGED
@@ -2,11 +2,47 @@ import streamlit as st
2
  from compliance_lib import fetch_text, run_check, generate_report, RULES
3
  import textwrap, json, datetime, os
4
 
5
- st.set_page_config(page_title="anupalankarta – Compliance Checker",
6
  layout="wide")
7
 
8
  st.title("🛡️ Anupalan Karta (अनुपालंकर्ता) – unified compliance self-check")
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # --- sidebar ---------------------------------------------------------------
11
  with st.sidebar:
12
  st.header("📑 Input options")
@@ -51,21 +87,21 @@ if run_btn and raw_text.strip():
51
  f"- {fw}: {sum(ok for _, ok in results[fw])}/{len(results[fw])} passed"
52
  for fw in selected_fw
53
  )
54
- prompt = textwrap.dedent(f"""
55
- You are a compliance consultant. Summarize the following checklist
56
- outcomes and give prioritized next steps. Use clear headings, bullet
57
- points and be brief. Results:
58
-
59
- {bullet}
60
-
61
- Write the report for a technical audience.
62
- """)
63
  report = generate_report(prompt)
64
  st.markdown("#### Draft report")
65
  st.code(report, language="markdown")
66
  st.download_button("⬇️ Download .md",
67
  report.encode("utf-8"),
68
- file_name="anupalankarta_report.md",
 
 
 
 
 
 
 
69
  mime="text/markdown")
70
  else:
71
- st.info("Awaiting input…")
 
2
  from compliance_lib import fetch_text, run_check, generate_report, RULES
3
  import textwrap, json, datetime, os
4
 
5
+ st.set_page_config(page_title="Anupalan Karta – Compliance Checker",
6
  layout="wide")
7
 
8
  st.title("🛡️ Anupalan Karta (अनुपालंकर्ता) – unified compliance self-check")
9
 
10
+ # --- introduction and how-to guide ------------------------------------------
11
+ st.markdown("""
12
+ ## Introduction
13
+
14
+ **Anupalan Karta** (अनुपालंकर्ता) is a simple tool to help business owners, data architects, and data owners quickly check if their policies and procedures meet important regulations like GDPR, EU AI Act, and ISO 27001.
15
+
16
+ ### Why is this important?
17
+
18
+ - Regulations protect your business from legal risks, fines, and reputational harm.
19
+ - Checking compliance early helps you fix gaps before audits or problems arise.
20
+ - Anupalan Karta gives you a fast, automated review and clear feedback, so you know where you stand.
21
+
22
+ ## How to use
23
+
24
+ 1. **Choose your input:**
25
+ On the left, either paste your policy text, enter a public website link, or upload a file (.txt, .md, .pdf).
26
+
27
+ 2. **Select frameworks:**
28
+ Pick which compliance standards you want to check (you can select more than one).
29
+
30
+ 3. **Run the check:**
31
+ Click "Run compliance check" to see which requirements you meet and which need attention.
32
+
33
+ 4. **Get your report:**
34
+ Optionally, generate a summary report with next steps, and download it as a Markdown file.
35
+
36
+ **Who is this for?**
37
+ This tool is designed for business owners, data architects, and anyone responsible for data and compliance in their organization. No technical expertise is needed—just your policy documents.
38
+
39
+ ---
40
+
41
+ **Need a deeper compliance review or expert guidance?**
42
+ Visit [anktechsol.com](https://anktechsol.com) for professional compliance consulting, detailed policy analysis, and tailored solutions for your business.
43
+
44
+ ---
45
+ """)
46
  # --- sidebar ---------------------------------------------------------------
47
  with st.sidebar:
48
  st.header("📑 Input options")
 
87
  f"- {fw}: {sum(ok for _, ok in results[fw])}/{len(results[fw])} passed"
88
  for fw in selected_fw
89
  )
90
+ from config import AI_REPORT_PROMPT # <-- import the prompt template
91
+ prompt = AI_REPORT_PROMPT.format(bullet=bullet)
 
 
 
 
 
 
 
92
  report = generate_report(prompt)
93
  st.markdown("#### Draft report")
94
  st.code(report, language="markdown")
95
  st.download_button("⬇️ Download .md",
96
  report.encode("utf-8"),
97
+ file_name="anupalan_karta_report.md",
98
+ mime="text/markdown")
99
+ else:
100
+ st.info("Awaiting input…")
101
+ st.code(report, language="markdown")
102
+ st.download_button("⬇️ Download .md",
103
+ report.encode("utf-8"),
104
+ file_name="anupalan_karta_report.md",
105
  mime="text/markdown")
106
  else:
107
+ st.info("Awaiting input…")