jdmorzan commited on
Commit
8a2e13f
·
verified ·
1 Parent(s): 92e2c9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -55,7 +55,7 @@ async def agent_reply(message: str, history: List[Tuple[str, str]]):
55
  "role": "user",
56
  "content": [{"type": "input_text", "text": message}],
57
  })
58
-
59
  with trace("Gradio message"):
60
  result = await Runner.run(
61
  my_agent,
@@ -65,7 +65,7 @@ async def agent_reply(message: str, history: List[Tuple[str, str]]):
65
  "workflow_id": WORKFLOW_ID
66
  })
67
  )
68
-
69
  return result.final_output_as(str)
70
 
71
  # --- Updated Gradio ChatInterface ---
@@ -76,9 +76,12 @@ demo = gr.ChatInterface(
76
  "Este chat usa un agente con FileSearchTool. "
77
  "Escribe tu pregunta y el agente buscará primero en el file search antes de responder."
78
  ),
79
- # only valid arguments for Gradio 4.x
80
  examples=["¿Qué información hay sobre el proyecto X?", "Resume el documento más reciente."],
81
  theme="soft",
82
- submit_btn="Enviar",
83
- clear_btn="Limpiar",
84
- )
 
 
 
 
 
55
  "role": "user",
56
  "content": [{"type": "input_text", "text": message}],
57
  })
58
+
59
  with trace("Gradio message"):
60
  result = await Runner.run(
61
  my_agent,
 
65
  "workflow_id": WORKFLOW_ID
66
  })
67
  )
68
+
69
  return result.final_output_as(str)
70
 
71
  # --- Updated Gradio ChatInterface ---
 
76
  "Este chat usa un agente con FileSearchTool. "
77
  "Escribe tu pregunta y el agente buscará primero en el file search antes de responder."
78
  ),
 
79
  examples=["¿Qué información hay sobre el proyecto X?", "Resume el documento más reciente."],
80
  theme="soft",
81
+ submit_btn="Enviar"
82
+ # Removed clear_btn as it's not a valid parameter
83
+ )
84
+
85
+ # If you need to run the app
86
+ if __name__ == "__main__":
87
+ demo.launch()