Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -994,17 +994,113 @@ body { background: #0a0f1e !important; }
|
|
| 994 |
max-width: 900px !important;
|
| 995 |
margin: 0 auto !important;
|
| 996 |
}
|
| 997 |
-
#header {
|
| 998 |
-
|
| 999 |
-
|
| 1000 |
-
|
| 1001 |
-
|
| 1002 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1003 |
.analyze-btn:hover { background: #0284c7 !important; }
|
| 1004 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1005 |
label { color: #94a3b8 !important; font-size: 0.8rem !important; }
|
| 1006 |
"""
|
| 1007 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1008 |
with gr.Blocks(css=CSS, title="RegTech BR") as demo:
|
| 1009 |
gr.HTML("""
|
| 1010 |
<div id="header">
|
|
@@ -1013,35 +1109,30 @@ with gr.Blocks(css=CSS, title="RegTech BR") as demo:
|
|
| 1013 |
</div>
|
| 1014 |
""")
|
| 1015 |
|
| 1016 |
-
with gr.
|
| 1017 |
-
with gr.
|
| 1018 |
-
|
| 1019 |
-
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
example_dropdown = gr.Dropdown(
|
| 1028 |
-
label="Scenarios generated from the current index",
|
| 1029 |
-
choices=SCENARIOS,
|
| 1030 |
-
value=None,
|
| 1031 |
-
interactive=True,
|
| 1032 |
-
)
|
| 1033 |
|
| 1034 |
-
|
| 1035 |
-
|
| 1036 |
-
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
|
| 1040 |
-
|
| 1041 |
-
|
| 1042 |
-
|
| 1043 |
-
"
|
| 1044 |
-
|
|
|
|
| 1045 |
|
| 1046 |
report_html = gr.HTML(label="Compliance Assessment")
|
| 1047 |
|
|
@@ -1062,17 +1153,12 @@ with gr.Blocks(css=CSS, title="RegTech BR") as demo:
|
|
| 1062 |
</div>
|
| 1063 |
""")
|
| 1064 |
|
| 1065 |
-
|
| 1066 |
-
|
| 1067 |
-
|
| 1068 |
-
|
| 1069 |
-
|
| 1070 |
-
|
| 1071 |
-
refresh_scenarios_btn.click(
|
| 1072 |
-
fn=refresh_scenarios,
|
| 1073 |
-
inputs=None,
|
| 1074 |
-
outputs=[example_dropdown, scenario_cursor, scenario_status],
|
| 1075 |
-
)
|
| 1076 |
analyze_btn.click(fn=analyze, inputs=[query_box], outputs=[report_html, evidence_html, context_box])
|
| 1077 |
query_box.submit(fn=analyze, inputs=[query_box], outputs=[report_html, evidence_html, context_box])
|
| 1078 |
|
|
|
|
| 994 |
max-width: 900px !important;
|
| 995 |
margin: 0 auto !important;
|
| 996 |
}
|
| 997 |
+
#header {
|
| 998 |
+
text-align: center;
|
| 999 |
+
padding: 2rem 0 1rem;
|
| 1000 |
+
border-bottom: 1px solid #1e3a5f;
|
| 1001 |
+
margin-bottom: 1.5rem;
|
| 1002 |
+
}
|
| 1003 |
+
#header h1 {
|
| 1004 |
+
font-family: 'IBM Plex Mono', monospace;
|
| 1005 |
+
font-size: 1.8rem;
|
| 1006 |
+
color: #38bdf8;
|
| 1007 |
+
letter-spacing: -0.02em;
|
| 1008 |
+
margin: 0 0 0.3rem;
|
| 1009 |
+
}
|
| 1010 |
+
#header p {
|
| 1011 |
+
color: #94a3b8;
|
| 1012 |
+
font-size: 0.86rem;
|
| 1013 |
+
margin: 0;
|
| 1014 |
+
}
|
| 1015 |
+
.input-panel {
|
| 1016 |
+
background: #0f172a;
|
| 1017 |
+
border: 1px solid #1e3a5f;
|
| 1018 |
+
border-radius: 14px;
|
| 1019 |
+
padding: 1rem;
|
| 1020 |
+
margin-bottom: 0.75rem;
|
| 1021 |
+
}
|
| 1022 |
+
.query-box textarea {
|
| 1023 |
+
background: #0b1220 !important;
|
| 1024 |
+
border: 1px solid #1e3a5f !important;
|
| 1025 |
+
color: #e2e8f0 !important;
|
| 1026 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 1027 |
+
font-size: 0.9rem !important;
|
| 1028 |
+
border-radius: 8px !important;
|
| 1029 |
+
}
|
| 1030 |
+
.query-box textarea:focus {
|
| 1031 |
+
border-color: #38bdf8 !important;
|
| 1032 |
+
box-shadow: 0 0 0 2px rgba(56,189,248,0.15) !important;
|
| 1033 |
+
}
|
| 1034 |
+
.analyze-btn {
|
| 1035 |
+
background: #0369a1 !important;
|
| 1036 |
+
color: #fff !important;
|
| 1037 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 1038 |
+
font-weight: 700 !important;
|
| 1039 |
+
letter-spacing: 0.05em !important;
|
| 1040 |
+
border: none !important;
|
| 1041 |
+
border-radius: 8px !important;
|
| 1042 |
+
height: 44px !important;
|
| 1043 |
+
font-size: 0.85rem !important;
|
| 1044 |
+
transition: background 0.2s !important;
|
| 1045 |
+
}
|
| 1046 |
.analyze-btn:hover { background: #0284c7 !important; }
|
| 1047 |
+
.shortcut-panel {
|
| 1048 |
+
background: transparent;
|
| 1049 |
+
border: 1px solid #172554;
|
| 1050 |
+
border-radius: 12px;
|
| 1051 |
+
padding: 0.75rem 0.85rem;
|
| 1052 |
+
margin: 0.3rem 0 1.1rem;
|
| 1053 |
+
}
|
| 1054 |
+
.shortcut-title {
|
| 1055 |
+
color: #64748b;
|
| 1056 |
+
font-family: 'IBM Plex Mono', monospace;
|
| 1057 |
+
font-size: 0.72rem;
|
| 1058 |
+
text-transform: uppercase;
|
| 1059 |
+
letter-spacing: 0.12em;
|
| 1060 |
+
margin-bottom: 0.55rem;
|
| 1061 |
+
}
|
| 1062 |
+
.shortcut-row { gap: 0.5rem !important; }
|
| 1063 |
+
.chip-btn {
|
| 1064 |
+
background: #111827 !important;
|
| 1065 |
+
color: #93c5fd !important;
|
| 1066 |
+
border: 1px solid #1e3a5f !important;
|
| 1067 |
+
border-radius: 999px !important;
|
| 1068 |
+
min-height: 34px !important;
|
| 1069 |
+
height: 34px !important;
|
| 1070 |
+
padding: 0 0.85rem !important;
|
| 1071 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 1072 |
+
font-size: 0.78rem !important;
|
| 1073 |
+
font-weight: 600 !important;
|
| 1074 |
+
box-shadow: none !important;
|
| 1075 |
+
}
|
| 1076 |
+
.chip-btn:hover {
|
| 1077 |
+
background: #1e3a5f !important;
|
| 1078 |
+
color: #dbeafe !important;
|
| 1079 |
+
border-color: #38bdf8 !important;
|
| 1080 |
+
}
|
| 1081 |
+
.context-box textarea {
|
| 1082 |
+
background: #0f172a !important;
|
| 1083 |
+
border: 1px solid #1e293b !important;
|
| 1084 |
+
color: #cbd5e1 !important;
|
| 1085 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 1086 |
+
font-size: 0.75rem !important;
|
| 1087 |
+
}
|
| 1088 |
label { color: #94a3b8 !important; font-size: 0.8rem !important; }
|
| 1089 |
"""
|
| 1090 |
|
| 1091 |
+
SHORTCUT_QUERIES = {
|
| 1092 |
+
"BCB": "Nossa plataforma presta serviços de compra, venda, custódia e intermediação de criptoativos para clientes no Brasil, mas ainda não possui autorização formal do Banco Central. Quais são os riscos e obrigações aplicáveis?",
|
| 1093 |
+
"CVM": "Nosso token concede participação em receitas, direito de voto e será ofertado publicamente a investidores brasileiros. Isso pode caracterizar valor mobiliário ou oferta sujeita à CVM?",
|
| 1094 |
+
"COAF": "Permitimos transações pequenas com cadastro simplificado e parte dos clientes pode operar sem identificação completa. Quais controles de PLD/FTP, KYC e comunicação devem ser avaliados?",
|
| 1095 |
+
"Lei 14.478": "Qual é o enquadramento regulatório de uma prestadora de serviços de ativos virtuais segundo a Lei 14.478/2022 e normas complementares?",
|
| 1096 |
+
"Segregação": "Nossa exchange mantém ativos virtuais de clientes em carteiras misturadas com recursos próprios da empresa. Quais obrigações de segregação patrimonial e custódia devem ser observadas?",
|
| 1097 |
+
}
|
| 1098 |
+
|
| 1099 |
+
|
| 1100 |
+
def load_shortcut(label: str) -> str:
|
| 1101 |
+
return SHORTCUT_QUERIES.get(label, "")
|
| 1102 |
+
|
| 1103 |
+
|
| 1104 |
with gr.Blocks(css=CSS, title="RegTech BR") as demo:
|
| 1105 |
gr.HTML("""
|
| 1106 |
<div id="header">
|
|
|
|
| 1109 |
</div>
|
| 1110 |
""")
|
| 1111 |
|
| 1112 |
+
with gr.Group(elem_classes=["input-panel"]):
|
| 1113 |
+
with gr.Row():
|
| 1114 |
+
with gr.Column(scale=4):
|
| 1115 |
+
query_box = gr.Textbox(
|
| 1116 |
+
label="Compliance query or document excerpt",
|
| 1117 |
+
placeholder="Describe a crypto product, policy, control gap, or regulatory question in Portuguese or English...",
|
| 1118 |
+
lines=5,
|
| 1119 |
+
elem_classes=["query-box"],
|
| 1120 |
+
)
|
| 1121 |
+
with gr.Column(scale=1, min_width=130):
|
| 1122 |
+
analyze_btn = gr.Button("Analyze →", elem_classes=["analyze-btn"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1123 |
|
| 1124 |
+
gr.HTML("""
|
| 1125 |
+
<div class="shortcut-panel">
|
| 1126 |
+
<div class="shortcut-title">Quick regulatory checks</div>
|
| 1127 |
+
</div>
|
| 1128 |
+
""")
|
| 1129 |
|
| 1130 |
+
with gr.Row(elem_classes=["shortcut-row"]):
|
| 1131 |
+
bcb_btn = gr.Button("BCB", elem_classes=["chip-btn"])
|
| 1132 |
+
cvm_btn = gr.Button("CVM", elem_classes=["chip-btn"])
|
| 1133 |
+
coaf_btn = gr.Button("COAF", elem_classes=["chip-btn"])
|
| 1134 |
+
lei_btn = gr.Button("Lei 14.478", elem_classes=["chip-btn"])
|
| 1135 |
+
seg_btn = gr.Button("Segregação", elem_classes=["chip-btn"])
|
| 1136 |
|
| 1137 |
report_html = gr.HTML(label="Compliance Assessment")
|
| 1138 |
|
|
|
|
| 1153 |
</div>
|
| 1154 |
""")
|
| 1155 |
|
| 1156 |
+
bcb_btn.click(fn=lambda: load_shortcut("BCB"), inputs=None, outputs=[query_box])
|
| 1157 |
+
cvm_btn.click(fn=lambda: load_shortcut("CVM"), inputs=None, outputs=[query_box])
|
| 1158 |
+
coaf_btn.click(fn=lambda: load_shortcut("COAF"), inputs=None, outputs=[query_box])
|
| 1159 |
+
lei_btn.click(fn=lambda: load_shortcut("Lei 14.478"), inputs=None, outputs=[query_box])
|
| 1160 |
+
seg_btn.click(fn=lambda: load_shortcut("Segregação"), inputs=None, outputs=[query_box])
|
| 1161 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1162 |
analyze_btn.click(fn=analyze, inputs=[query_box], outputs=[report_html, evidence_html, context_box])
|
| 1163 |
query_box.submit(fn=analyze, inputs=[query_box], outputs=[report_html, evidence_html, context_box])
|
| 1164 |
|