system message: Update stock chart queries to use "USD" instead of "$" symbol and improve programming UI

This commit is contained in:
zaidmukaddam 2024-08-25 23:13:57 +05:30
parent 35ef08d794
commit 3672f5c6bc
4 changed files with 18 additions and 8 deletions

View File

@ -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:

View File

@ -50,7 +50,6 @@ import {
Terminal,
Pause,
Play,
RotateCw,
TrendingUpIcon,
Calendar,
Calculator
@ -799,6 +798,17 @@ export default function Home() {
<Code className="h-5 w-5 text-primary" />
<h2 className="text-base font-semibold">Programming</h2>
</div>
{!result ? (
<Badge variant="secondary" className="mr-2 rounded-full">
<Loader2 className="h-3 w-3 animate-spin mr-1" />
Executing
</Badge>
) : (
<Badge className="mr-2 rounded-full">
<Check className="h-3 w-3 mr-1 text-green-400" />
Executed
</Badge>
)}
</div>
</AccordionTrigger>
<AccordionContent>
@ -1265,12 +1275,15 @@ export default function Home() {
}
const MarkdownRenderer: React.FC<MarkdownRendererProps> = 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<Components> = 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}
</ReactMarkdown>
);
});

View File

@ -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",

View File

@ -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)