import streamlit as st from mistralai import Mistral import os # Configuração de Elite: Tema Preto e Interface Limpa st.set_page_config(page_title="Focus PRF IAQstron", layout="centered") st.markdown(""" """, unsafe_allow_html=True) # Conexão Neural api_key = os.getenv("MISTRAL_API_KEY") client = Mistral(api_key=api_key) st.markdown("

FOCUS PRF IAQSTRON

", unsafe_allow_html=True) st.markdown("

Motor de Inteligência // Fatiamento 360°

", unsafe_allow_html=True) query = st.text_input("", placeholder="Qual artigo ou tema vamos triturar?") if query: if not api_key: st.error("Erro: Adicione a MISTRAL_API_KEY em Settings > Secrets.") else: with st.spinner("Fatiando base legal e caçando pegadinhas..."): try: prompt = f""" Você é o motor principal do Focus PRF IAQstron. Explique o tema '{query}' de forma fatiada e letal para a PRF. REGRAS OBRIGATÓRIAS: 1. Foque em PEGADINHAS DE VERBOS que a Cebraspe usa. 2. Use HTML:

para títulos e

para texto. 3. Verbos de comando devem estar em VERBO. 4. Súmulas em Súmula X. 5. PROIBIDO usar asteriscos (*), hashtags (#) ou hifens. ESTRUTURA:

📜 LEI SECA FATIADA

⚖️ PUNIÇÃO ADM vs CRIMINAL

🏛️ JURISPRUDÊNCIA

📖 MALDADE DA BANCA (PEGADINHAS)

""" resp = client.chat.complete(model="mistral-small-latest", messages=[{"role": "user", "content": prompt}]) answer = resp.choices[0].message.content.replace('*', '').replace('#', '') st.markdown(f"
{answer}
", unsafe_allow_html=True) except Exception as e: st.error(f"Erro: {e}")