Update app.py
Browse files
app.py
CHANGED
@@ -62,26 +62,6 @@ def generacion_llm(texto_input):
|
|
62 |
except Exception as e:
|
63 |
return f"Error: {e}"
|
64 |
|
65 |
-
# Function to send an email
|
66 |
-
def enviar_email(content):
|
67 |
-
subject = "Contenido Generado por el Chatbox"
|
68 |
-
body = f"Hola,\n\nEl siguiente contenido fue generado:\n\n{content}"
|
69 |
-
|
70 |
-
msg = MIMEMultipart()
|
71 |
-
msg['From'] = sender_email
|
72 |
-
msg['To'] = receiver_email
|
73 |
-
msg['Subject'] = subject
|
74 |
-
msg.attach(MIMEText(body, 'plain'))
|
75 |
-
|
76 |
-
try:
|
77 |
-
with smtplib.SMTP("smtp.gmail.com", 587) as server:
|
78 |
-
server.starttls()
|
79 |
-
server.login(sender_email, email_password)
|
80 |
-
server.sendmail(sender_email, receiver_email, msg.as_string())
|
81 |
-
print("Email enviado exitosamente.")
|
82 |
-
except Exception as e:
|
83 |
-
print(f"Error enviando el email: {e}")
|
84 |
-
|
85 |
# Define Gradio app
|
86 |
with gr.Blocks() as interface:
|
87 |
gr.Markdown(
|
@@ -98,20 +78,17 @@ with gr.Blocks() as interface:
|
|
98 |
* Expectativas del taller.
|
99 |
"""
|
100 |
)
|
101 |
-
|
102 |
-
|
103 |
|
104 |
with gr.Row():
|
105 |
input_text = gr.Textbox(label="Texto libre para estructurar", lines=3)
|
106 |
output_json = gr.Textbox(label="Resultado JSON", interactive=False)
|
107 |
submit_button = gr.Button("Procesar")
|
108 |
submit_button.click(fn=generacion_llm, inputs=input_text, outputs=output_json)
|
109 |
-
nombre = gr.Textbox(label="Nombre (Obligatorio)")
|
110 |
email = gr.Textbox(label="Email (Obligatorio)")
|
111 |
-
imagen = gr.Image(label="
|
112 |
email_button = gr.Button("Enviar por Email")
|
113 |
-
|
114 |
-
|
115 |
gr.Markdown(
|
116 |
"""Potenciado por GestioDin谩mica漏2024"""
|
117 |
)
|
|
|
62 |
except Exception as e:
|
63 |
return f"Error: {e}"
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
# Define Gradio app
|
66 |
with gr.Blocks() as interface:
|
67 |
gr.Markdown(
|
|
|
78 |
* Expectativas del taller.
|
79 |
"""
|
80 |
)
|
|
|
|
|
81 |
|
82 |
with gr.Row():
|
83 |
input_text = gr.Textbox(label="Texto libre para estructurar", lines=3)
|
84 |
output_json = gr.Textbox(label="Resultado JSON", interactive=False)
|
85 |
submit_button = gr.Button("Procesar")
|
86 |
submit_button.click(fn=generacion_llm, inputs=input_text, outputs=output_json)
|
|
|
87 |
email = gr.Textbox(label="Email (Obligatorio)")
|
88 |
+
imagen = gr.Image(label="Voucher de Pago (Obligatorio)")
|
89 |
email_button = gr.Button("Enviar por Email")
|
90 |
+
#submit_button.click(fn=pendiente, inputs=input_text, outputs=output_json)
|
91 |
+
|
92 |
gr.Markdown(
|
93 |
"""Potenciado por GestioDin谩mica漏2024"""
|
94 |
)
|