diff --git a/drb-c2-core/app/routers/trips.py b/drb-c2-core/app/routers/trips.py index bd5b430..ef9d769 100644 --- a/drb-c2-core/app/routers/trips.py +++ b/drb-c2-core/app/routers/trips.py @@ -145,6 +145,7 @@ Current itinerary:{itinerary} Guidelines: - Be conversational and concise — don't over-explain. +- Format all responses using Markdown: use **bold** for place names and key details, bullet lists for options, and [links](url) for Maps links. - When the user mentions places, activities, or asks for suggestions, search for them with search_places before proposing. - Use propose_event for each concrete suggestion — one call per event. The user will approve or skip each one. - Be mindful of the existing schedule when assigning times. Avoid obvious conflicts. diff --git a/drb-frontend/app/trips/[id]/page.tsx b/drb-frontend/app/trips/[id]/page.tsx index b291e4a..bf1d514 100644 --- a/drb-frontend/app/trips/[id]/page.tsx +++ b/drb-frontend/app/trips/[id]/page.tsx @@ -1,6 +1,7 @@ "use client"; import { useCallback, useEffect, useRef, useState } from "react"; +import ReactMarkdown from "react-markdown"; import { useParams, useRouter } from "next/navigation"; import { useAuth } from "@/components/AuthProvider"; import { c2api } from "@/lib/c2api"; @@ -614,7 +615,24 @@ function AssistantPanel({ : "bg-gray-800 text-gray-200" }`} > - {msg.content} + {msg.role === "user" ? msg.content : ( +

{children}

, + ul: ({ children }) => , + ol: ({ children }) =>
    {children}
, + li: ({ children }) =>
  • {children}
  • , + strong: ({ children }) => {children}, + a: ({ href, children }) => ( + + {children} + + ), + }} + > + {msg.content} +
    + )} {/* Suggestion cards */} diff --git a/drb-frontend/package.json b/drb-frontend/package.json index 24bdca5..546632c 100644 --- a/drb-frontend/package.json +++ b/drb-frontend/package.json @@ -14,7 +14,8 @@ "react-dom": "^18.3.0", "firebase": "^10.12.0", "leaflet": "^1.9.4", -"react-leaflet": "^4.2.1" +"react-leaflet": "^4.2.1", + "react-markdown": "^9.0.1" }, "devDependencies": { "typescript": "^5.4.0",