Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,21 +102,55 @@ def chatbot(input_text):
|
|
| 102 |
|
| 103 |
|
| 104 |
#Interface Gradio — Bonita e Funcional
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
["Como criar um workflow no n8n?"],
|
| 113 |
-
["Para que serve o node HTTP Request?"],
|
| 114 |
-
["Quais são os nodes para integração com Google Sheets?"],
|
| 115 |
-
],
|
| 116 |
-
theme="default",
|
| 117 |
-
allow_flagging="never"
|
| 118 |
-
)
|
| 119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
#Executar
|
| 122 |
-
interface.launch()
|
|
|
|
| 102 |
|
| 103 |
|
| 104 |
#Interface Gradio — Bonita e Funcional
|
| 105 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 106 |
+
gr.Markdown(
|
| 107 |
+
"""
|
| 108 |
+
# 🤖 Bot de Dúvidas sobre o **n8n**
|
| 109 |
+
Este agente responde dúvidas sobre o **n8n**, baseado na documentação oficial carregada.
|
| 110 |
+
""",
|
| 111 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
+
with gr.Row():
|
| 114 |
+
with gr.Column(scale=1):
|
| 115 |
+
gr.Image(
|
| 116 |
+
value="https://n8n.io/images/n8n-logo.png",
|
| 117 |
+
width=150,
|
| 118 |
+
show_label=False,
|
| 119 |
+
interactive=False,
|
| 120 |
+
)
|
| 121 |
+
with gr.Column(scale=5):
|
| 122 |
+
gr.Markdown(
|
| 123 |
+
"## Pergunte qualquer coisa sobre o n8n! <br> Exemplo: `Como criar um workflow no n8n?`"
|
| 124 |
+
)
|
| 125 |
+
|
| 126 |
+
with gr.Row():
|
| 127 |
+
input_text = gr.Textbox(
|
| 128 |
+
label="Digite sua pergunta",
|
| 129 |
+
placeholder="Exemplo: Como criar um workflow no n8n?",
|
| 130 |
+
lines=2,
|
| 131 |
+
)
|
| 132 |
+
output_text = gr.Textbox(
|
| 133 |
+
label="Resposta do Bot",
|
| 134 |
+
placeholder="Aqui aparecerá a resposta...",
|
| 135 |
+
lines=10
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
with gr.Row():
|
| 139 |
+
submit_btn = gr.Button("🚀 Perguntar")
|
| 140 |
+
clear_btn = gr.Button("🧹 Limpar")
|
| 141 |
+
|
| 142 |
+
with gr.Accordion("📚 Exemplos de Perguntas", open=False):
|
| 143 |
+
gr.Markdown(
|
| 144 |
+
"""
|
| 145 |
+
- Como criar um workflow no n8n?
|
| 146 |
+
- Para que serve o node HTTP Request?
|
| 147 |
+
- Quais são os nodes para integração com Google Sheets?
|
| 148 |
+
- Como configurar autenticação no n8n?
|
| 149 |
+
"""
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
submit_btn.click(fn=chatbot, inputs=input_text, outputs=output_text)
|
| 153 |
+
clear_btn.click(lambda: ("", ""), None, [input_text, output_text])
|
| 154 |
+
|
| 155 |
+
demo.launch()
|
| 156 |
|
|
|
|
|
|