Spaces:
Runtime error
Runtime error
Download app.py from Kesley128e73/12308: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/Kesley128e73/12308/resolve/main/app.py
- Command line
-
hf download hf://spaces/Kesley128e73/12308/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Kesley128e73/12308/resolve/main/app.py
1.29 kB
| import gradio as ui | |
| # Função simples para o chat funcionar temporariamente | |
| def responder_chat(mensagem, historico): | |
| if not mensagem: | |
| return "", historico | |
| resposta_mestre = f"Você disse: '{mensagem}'. O sistema do Kesley está sendo carregado..." | |
| historico.append((mensagem, response_mestre if 'response_mestre' in locals() else resposta_mestre)) | |
| return "", historico | |
| # Criando a interface com Gradio (Já vem com o botão de tema no canto inferior) | |
| with ui.Blocks(theme=ui.themes.Soft()) as meu_app: | |
| ui.Markdown("# 🦸♂️ Kesley RPG - Boku no Hero") | |
| ui.Markdown("Bem-vindo ao seu próprio aplicativo! Use os campos abaixo para interagir.") | |
| # Tela de Login Simples com e-mail | |
| with ui.Row(): | |
| email_input = ui.Textbox(label="Digite seu Gmail para conectar", placeholder="seu-email@gmail.com") | |
| botao_login = ui.Button("Conectar Conta", variant="primary") | |
| # Caixa do Chatbot | |
| chat = ui.Chatbot(label="Histórico da História", height=400) | |
| caixa_texto = ui.Textbox(label="O que o Kesley vai fazer?", placeholder="Digite sua ação aqui...") | |
| # Lógica para enviar a mensagem | |
| caixa_texto.submit(responder_chat, [caixa_texto, chat], [caixa_texto, chat]) | |
| # Ativa o aplicativo | |
| meu_app.launch() | |