roundb commited on
Commit
1c7816f
·
verified ·
1 Parent(s): 0b31413

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -866,7 +866,7 @@ def responder_pergunta(
866
  if not api_key or not api_key.strip():
867
  historico = historico + [
868
  {"role": "user", "content": pergunta},
869
- {"role": "assistant", "content": "⚠️ Por favor, insira a sua chave API da NVIDIA NIM no campo acima para usar o assistente."}
870
  ]
871
  return historico, ""
872
 
@@ -1124,7 +1124,7 @@ HEADER_HTML = f"""
1124
  <font color="#ffffff">
1125
  Controlo SLA por tipo de tarefa &nbsp;·&nbsp; Distribuição por faixas de percentagem
1126
  &nbsp;·&nbsp; {N_TOTAL} registos &nbsp;·&nbsp; Referência: {DATA_REF}
1127
- &nbsp;·&nbsp; 🤖 RAG com NVIDIA NIM
1128
  </font>
1129
  </p>
1130
  </div>
@@ -1228,13 +1228,13 @@ with gr.Blocks(title="Dashboard SLA + RAG NVIDIA NIM") as demo:
1228
  """)
1229
 
1230
  # ── Tab 2: Assistente RAG ────────────────────────────────────────────
1231
- with gr.Tab("🤖 Assistente IA (RAG)"):
1232
 
1233
  gr.HTML("""
1234
  <div style="background:linear-gradient(135deg,#0D47A1 0%,#1565C0 50%,#1976D2 100%);
1235
  border-radius:10px;padding:16px 20px;margin-bottom:16px;">
1236
  <h3 style="margin:0 0 6px;color:#fff;font-size:16px;font-weight:700;">
1237
- 🤖 Assistente RAG — NVIDIA NIM
1238
  </h3>
1239
  <p style="margin:0;color:rgba(255,255,255,0.85);font-size:13px;">
1240
  Faça perguntas em linguagem natural sobre os dados do dashboard SLA.
@@ -1264,9 +1264,7 @@ with gr.Blocks(title="Dashboard SLA + RAG NVIDIA NIM") as demo:
1264
  gr.HTML("""
1265
  <div style="background:#e8f4fd;border-left:4px solid #1976D2;border-radius:6px;
1266
  padding:10px 14px;margin:8px 0 16px;font-size:12px;color:#1565C0;">
1267
- <b>Como obter a chave API gratuita:</b> Aceda a
1268
- <a href="https://build.nvidia.com" target="_blank" style="color:#0D47A1;font-weight:600;">build.nvidia.com</a>
1269
- → faça login → clique em "Get API Key" → copie e cole acima.
1270
  A NVIDIA oferece créditos gratuitos para desenvolvimento.
1271
  </div>
1272
  """)
 
866
  if not api_key or not api_key.strip():
867
  historico = historico + [
868
  {"role": "user", "content": pergunta},
869
+ {"role": "assistant", "content": "Por favor, insira a sua chave API da NVIDIA NIM no campo acima para usar o assistente."}
870
  ]
871
  return historico, ""
872
 
 
1124
  <font color="#ffffff">
1125
  Controlo SLA por tipo de tarefa &nbsp;·&nbsp; Distribuição por faixas de percentagem
1126
  &nbsp;·&nbsp; {N_TOTAL} registos &nbsp;·&nbsp; Referência: {DATA_REF}
1127
+ &nbsp;·&nbsp; RAG com NVIDIA NIM
1128
  </font>
1129
  </p>
1130
  </div>
 
1228
  """)
1229
 
1230
  # ── Tab 2: Assistente RAG ────────────────────────────────────────────
1231
+ with gr.Tab("Assistente IA (RAG)"):
1232
 
1233
  gr.HTML("""
1234
  <div style="background:linear-gradient(135deg,#0D47A1 0%,#1565C0 50%,#1976D2 100%);
1235
  border-radius:10px;padding:16px 20px;margin-bottom:16px;">
1236
  <h3 style="margin:0 0 6px;color:#fff;font-size:16px;font-weight:700;">
1237
+ Assistente RAG — NVIDIA NIM
1238
  </h3>
1239
  <p style="margin:0;color:rgba(255,255,255,0.85);font-size:13px;">
1240
  Faça perguntas em linguagem natural sobre os dados do dashboard SLA.
 
1264
  gr.HTML("""
1265
  <div style="background:#e8f4fd;border-left:4px solid #1976D2;border-radius:6px;
1266
  padding:10px 14px;margin:8px 0 16px;font-size:12px;color:#1565C0;">
1267
+
 
 
1268
  A NVIDIA oferece créditos gratuitos para desenvolvimento.
1269
  </div>
1270
  """)