Spaces:
Runtime error
Runtime error
Commit ·
6418837
1
Parent(s): bdfdf64
update 10
Browse files1 unmodified line23456789237 unmodified lines2472482492502512522532542552562572581 unmodified lineimport requestsimport re# ------------------------- PREGUNTAS Y OPCIONES -------------------------preguntas = [{"texto": "¿Tu organización cuenta con un código de ética o conducta conocido por todo el equipo?",237 unmodified linesexcept Exception as e:print("Error al enviar a Getform:", e)# ------------------------- INTERFAZ -------------------------iface = gr.ChatInterface(fn=teo,title="🤖 Soy TEO el asistente digital de Equitas Consultora",description="¡Conversemos!")iface.launch()1 unmodified line234567891011121314151617237 unmodified lines2552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353361 unmodified lineimport requestsimport re# --- COLORES DE EQUITAS ---color_principal = "#881781"color_secundario_claro = "#e4c7df"color_secundario_medio_claro = "#c48cc4"color_secundario_medio_oscuro = "#bd7eb6"color_secundario_oscuro = "#cc8cbc"color_texto_principal = "#333333" # Un gris oscuro para el texto principalcolor_fondo = "#f8f8f8" # Un gris muy claro para el fondo general# ------------------------- PREGUNTAS Y OPCIONES -------------------------preguntas = [{"texto": "¿Tu organización cuenta con un código de ética o conducta conocido por todo el equipo?",237 unmodified linesexcept Exception as e:print("Error al enviar a Getform:", e)# ------------------------- INTERFAZ CON CSS PERSONALIZADO Y LOGO -------------------------logo_url = "https://i.imgur.com/a/txQExRP" # ¡He insertado la URL del álbum de Imgur!css = f"""body {{font-family: 'Arial', sans-serif;background-color: {color_fondo};color: {color_texto_principal};}}.gradio-container {{width: 700px !important; /* Ancho fijo para la "app" */max-width: 95% !important; /* Adaptabilidad en pantallas pequeñas */margin: 30px auto !important; /* Centrar y dar margen */border: 1px solid #cccccc;border-radius: 10px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);padding: 20px !important;background-color: white;}}.chat-interface-title {{color: {color_principal};text-align: center;margin-bottom: 20px;font-size: 2em;}}.chatbot {{border: 1px solid #e0e0e0;border-radius: 8px;padding: 15px;background-color: {color_secundario_claro};margin-bottom: 15px;overflow-y: auto;max-height: 500px;}}.chatbot-row.user {{background-color: {color_secundario_medio_claro};color: {color_texto_principal};border-radius: 8px;padding: 10px;margin-bottom: 8px;text-align: right;}}.chatbot-row.bot {{background-color: {color_principal};color: white;border-radius: 8px;padding: 10px;margin-bottom: 8px;text-align: left;}}.textbox-container {{margin-bottom: 15px;}}.gr-button {{background-color: {color_secundario_oscuro};color: white !important;border: none;border-radius: 8px;padding: 12px 20px;cursor: pointer;font-weight: bold;}}.gr-button:hover {{background-color: {color_principal};}}"""header_html = f'<div style="display: flex; justify-content: center; align-items: center; margin-bottom: 15px;"><img src="{logo_url}" style="max-height: 80px;"></div>'iface = gr.ChatInterface(fn=teo,title="🤖 Soy TEO el asistente digital de Equitas Consultora",description="¡Conversemos!",css=css,header=header_html)iface.launch()
app.py+81-3