assistant markdown update
This commit is contained in:
@@ -145,6 +145,7 @@ Current itinerary:{itinerary}
|
|||||||
|
|
||||||
Guidelines:
|
Guidelines:
|
||||||
- Be conversational and concise — don't over-explain.
|
- 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.
|
- 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.
|
- 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.
|
- Be mindful of the existing schedule when assigning times. Avoid obvious conflicts.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
import ReactMarkdown from "react-markdown";
|
||||||
import { useParams, useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { useAuth } from "@/components/AuthProvider";
|
import { useAuth } from "@/components/AuthProvider";
|
||||||
import { c2api } from "@/lib/c2api";
|
import { c2api } from "@/lib/c2api";
|
||||||
@@ -613,8 +614,25 @@ function AssistantPanel({
|
|||||||
? "bg-indigo-600 text-white"
|
? "bg-indigo-600 text-white"
|
||||||
: "bg-gray-800 text-gray-200"
|
: "bg-gray-800 text-gray-200"
|
||||||
}`}
|
}`}
|
||||||
|
>
|
||||||
|
{msg.role === "user" ? msg.content : (
|
||||||
|
<ReactMarkdown
|
||||||
|
components={{
|
||||||
|
p: ({ children }) => <p className="mb-1 last:mb-0">{children}</p>,
|
||||||
|
ul: ({ children }) => <ul className="list-disc list-inside space-y-0.5 my-1">{children}</ul>,
|
||||||
|
ol: ({ children }) => <ol className="list-decimal list-inside space-y-0.5 my-1">{children}</ol>,
|
||||||
|
li: ({ children }) => <li>{children}</li>,
|
||||||
|
strong: ({ children }) => <strong className="font-semibold text-white">{children}</strong>,
|
||||||
|
a: ({ href, children }) => (
|
||||||
|
<a href={href} target="_blank" rel="noopener noreferrer" className="text-indigo-400 hover:text-indigo-300 underline">
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{msg.content}
|
{msg.content}
|
||||||
|
</ReactMarkdown>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Suggestion cards */}
|
{/* Suggestion cards */}
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
"react-dom": "^18.3.0",
|
"react-dom": "^18.3.0",
|
||||||
"firebase": "^10.12.0",
|
"firebase": "^10.12.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"react-leaflet": "^4.2.1"
|
"react-leaflet": "^4.2.1",
|
||||||
|
"react-markdown": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.4.0",
|
"typescript": "^5.4.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user