Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# Simulaci贸n simple de un agente para el desaf铆o GAIA
|
| 5 |
+
def agent_function(task_id, task_data):
|
| 6 |
+
"""
|
| 7 |
+
Aqu铆 va la l贸gica real del agente. Por ahora, simplemente devuelve la longitud del texto como respuesta.
|
| 8 |
+
"""
|
| 9 |
+
submitted_answer = str(len(task_data))
|
| 10 |
+
return {"task_id": task_id, "submitted_answer": submitted_answer}
|
| 11 |
+
|
| 12 |
+
# Interfaz Gradio
|
| 13 |
+
with gr.Blocks() as demo:
|
| 14 |
+
gr.Markdown("## 馃 Agente GAIA Demo")
|
| 15 |
+
gr.Markdown("Este agente recibe un task_id y un task_data, y devuelve un submitted_answer.")
|
| 16 |
+
|
| 17 |
+
task_id_input = gr.Textbox(label="Task ID")
|
| 18 |
+
task_data_input = gr.Textbox(label="Task Data (Input for the Agent)")
|
| 19 |
+
output = gr.JSON(label="Agent Output")
|
| 20 |
+
|
| 21 |
+
submit_btn = gr.Button("Submit Task")
|
| 22 |
+
|
| 23 |
+
submit_btn.click(fn=agent_function, inputs=[task_id_input, task_data_input], outputs=output)
|
| 24 |
+
|
| 25 |
+
demo.launch()
|