diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 38618b0..4fe0596 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -50,6 +50,7 @@ export async function POST(req: Request) { .replace(/(\w+), (\w+) (\d+), (\d+)/, "$4-$2-$3 ($1)") + "." + "Rules for the response:\n" + + "Never use tags like , or in the response." + "Use a story telling format in your response, like a news article ALWAYS! This is for all tools except programming!" + "Never start with 'based on the search results,...' EVER! Always start with the information you found like an article!" + "Never use the heading format in your response!." + diff --git a/app/new/page.tsx b/app/new/page.tsx new file mode 100644 index 0000000..5852151 --- /dev/null +++ b/app/new/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from 'next/navigation' + +export default async function NewPage() { + redirect('/') +} \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index f8b26fa..f9205e4 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -11,6 +11,7 @@ React, useMemo } from 'react'; import ReactMarkdown, { Components } from 'react-markdown'; +import { useRouter } from 'next/navigation'; import remarkGfm from 'remark-gfm'; import { useChat } from 'ai/react'; import { ToolInvocation } from 'ai'; @@ -37,6 +38,8 @@ import { Loader2, User2, Edit2, + RefreshCw, + Heart, } from 'lucide-react'; import { HoverCard, @@ -93,6 +96,7 @@ import { export const maxDuration = 60; export default function Home() { + const router = useRouter(); const inputRef = useRef(null); const [lastSubmittedQuery, setLastSubmittedQuery] = useState(""); const [hasSubmitted, setHasSubmitted] = useState(false); @@ -139,9 +143,13 @@ export default function Home() { const copyToClipboard = async (text: string) => { try { - await navigator.clipboard.writeText(text); - toast.success("Copied to clipboard"); - return true; + if (navigator.clipboard && navigator.clipboard.writeText) { + await navigator.clipboard.writeText(text); + toast.success("Copied to clipboard"); + return true; + } else { + throw new Error("Clipboard API not available"); + } } catch (error) { console.error('Failed to copy:', error); toast.error("Failed to copy"); @@ -770,8 +778,41 @@ export default function Home() { "Explain Claude 3.5 Sonnet" ]; + const Navbar = () => ( +
+ + + + + + + +

Sponsor this project on GitHub

+
+
+
+
+ ); + return (
+ +