Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def responder(message, history): | |
| return f"Tu disseste: {message}" | |
| theme = gr.themes.Soft( | |
| primary_hue="blue", | |
| secondary_hue="slate", | |
| neutral_hue="slate" | |
| ).set( | |
| body_background_fill="#0f172a", | |
| body_text_color="#f8fafc", | |
| block_background_fill="#111827", | |
| block_border_color="#1f2937", | |
| button_primary_background_fill="#2563eb", | |
| button_primary_background_fill_hover="#1d4ed8", | |
| input_background_fill="#0b1220" | |
| ) | |
| custom_css = """ | |
| #title-box { | |
| text-align: center; | |
| padding: 30px 10px 10px 10px; | |
| } | |
| #title-box h1 { | |
| font-size: 2.4rem; | |
| margin-bottom: 8px; | |
| } | |
| #title-box p { | |
| color: #cbd5e1; | |
| font-size: 1rem; | |
| } | |
| #chat-wrap { | |
| max-width: 950px; | |
| margin: 0 auto; | |
| padding-bottom: 30px; | |
| } | |
| footer {display: none !important;} | |
| """ | |
| with gr.Blocks(fill_height=True) as demo: | |
| gr.HTML(""" | |
| <div id="title-box"> | |
| <h1>🤖 Meu Chatbot</h1> | |
| <p>Teste simples para confirmar que o bot responde.</p> | |
| </div> | |
| """) | |
| with gr.Column(elem_id="chat-wrap"): | |
| gr.ChatInterface( | |
| fn=responder, | |
| examples=[ | |
| "Olá", | |
| "Como estás?", | |
| "Explica-me o que é Gradio" | |
| ] | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch( | |
| server_name="0.0.0.0", | |
| server_port=7860, | |
| theme=theme, | |
| css=custom_css | |
| ) |