defplan_synthesizer_node(state:PlannerState)->PlannerState:llm=_create_llm("plan_synthesizer",temperature=0.3,session_id=state["session_id"])content=json.dumps({"flight":state["flight_summary"],"hotel":state["hotel_summary"],"activities":state["activities_summary"],},indent=2,)response=llm.invoke([SystemMessage(content="You are the travel plan synthesiser. Combine the specialist insights into a concise, structured itinerary."),HumanMessage(content=(f"Traveller request: {state['user_request']}\n\n"f"Origin: {state['origin']} | Destination: {state['destination']}\n"f"Dates: {state['departure']} to {state['return_date']}\n\n"f"Specialist summaries:\n{content}")),])state["final_itinerary"]=response.contentstate["messages"].append(response)state["current_agent"]="completed"returnstate