sd
Browse files
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
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(
|