Segizu commited on
Commit
34d0de0
1 Parent(s): c02f3d0
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -53,9 +53,18 @@ graph_builder.add_edge("agent", END)
53
  graph = graph_builder.compile()
54
 
55
  # 6. Funci贸n para Gradio
56
- def chat_with_agent(message):
57
- result = graph.invoke({"input": message})
58
- return result["output"]
 
 
 
 
 
 
 
 
 
59
 
60
  # 7. Interfaz Gradio adaptada para un agente de viajes
61
  iface = gr.Interface(
 
53
  graph = graph_builder.compile()
54
 
55
  # 6. Funci贸n para Gradio
56
+ def agent_step(state: AgentState) -> AgentState:
57
+ user_input = state.get("input")
58
+ if not user_input:
59
+ return {"input": "", "output": "No se recibi贸 entrada."}
60
+ travel_prompt = (
61
+ "Eres un agente de viajes profesional y experimentado. "
62
+ "Asesora, recomienda y planifica itinerarios, destinos y actividades de viaje seg煤n las preferencias del usuario. "
63
+ f"Usuario: {user_input}"
64
+ )
65
+ response = qwen.invoke(travel_prompt)
66
+ return {"input": user_input, "output": response}
67
+
68
 
69
  # 7. Interfaz Gradio adaptada para un agente de viajes
70
  iface = gr.Interface(