diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index a0eacca..8951cf1 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -71,6 +71,7 @@ DON'Ts and IMPORTANT GUIDELINES: - If asked for multiple plots, make it happen in one run of the tool. The tool will automatically capture the plots and display them in the response. - the web search may return an incorrect latex format, please correct it before using it in the response. Check the Latex in Markdown rules for more information. - The location search tools return images in the response, please do not include them in the response at all costs. +- Do not use the $ symbol in the stock chart queries at all costs. Use the word USD instead of the $ symbol in the stock chart queries. - Never run web_search tool for stock chart queries at all costs. ## Programming Tool Guidelines: diff --git a/app/page.tsx b/app/page.tsx index a41951f..c21ea78 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -50,7 +50,6 @@ import { Terminal, Pause, Play, - RotateCw, TrendingUpIcon, Calendar, Calculator @@ -799,6 +798,17 @@ export default function Home() {

Programming

+ {!result ? ( + + + Executing + + ) : ( + + + Executed + + )} @@ -1265,12 +1275,15 @@ export default function Home() { } const MarkdownRenderer: React.FC = React.memo(({ content }) => { + // Escape dollar signs that are likely to be currency + const escapedContent = content.replace(/\$(\d+(\.\d{1,2})?)/g, '\\$$1'); + const citationLinks = useMemo(() => { - return [...content.matchAll(/\[([^\]]+)\]\(([^)]+)\)/g)].map(([_, text, link]) => ({ + return [...escapedContent.matchAll(/\[([^\]]+)\]\(([^)]+)\)/g)].map(([_, text, link]) => ({ text, link, })); - }, [content]); + }, [escapedContent]); const components: Partial = useMemo(() => ({ a: ({ href, children }) => { @@ -1295,7 +1308,7 @@ export default function Home() { components={components} className="prose text-sm sm:text-base text-pretty text-left" > - {content} + {escapedContent} ); }); diff --git a/package.json b/package.json index 4364055..e57777d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "clsx": "^2.1.1", "date-fns": "^3.6.0", "framer-motion": "^11.3.19", - "katex": "^0.16.11", "lucide-react": "^0.424.0", "next": "^14.2.5", "openai": "^4.56.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 139de53..155708f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,9 +77,6 @@ dependencies: framer-motion: specifier: ^11.3.19 version: 11.3.20(react-dom@18.3.1)(react@18.3.1) - katex: - specifier: ^0.16.11 - version: 0.16.11 lucide-react: specifier: ^0.424.0 version: 0.424.0(react@18.3.1)