Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed app/(chat)/opengraph-image.png
Binary file not shown.
Binary file removed app/(chat)/twitter-image.png
Binary file not shown.
10 changes: 5 additions & 5 deletions app/config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ export const siweConfig = createSIWEConfig({
},
verifyMessage: async ({ message, signature }: SIWEVerifyMessageArgs) => {
try {
const success = await signIn('credentials', {
await signIn('credentials', {
message,
redirect: false,
redirectTo: '/',
signature,
callbackUrl: '/protected',
});

return Boolean(success?.ok);
return true;
} catch (error) {
return false;
}
},
signOut: async () => {
try {
await signOut({
redirect: false,
redirect: true,
redirectTo: '/',
});

return true;
Expand Down
28 changes: 13 additions & 15 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
import type { Metadata } from "next";
import { headers } from "next/headers";
import { Toaster } from "sonner";
import { cookieToInitialState } from "wagmi";
import type { Metadata } from 'next';
import { headers } from 'next/headers';
import { Toaster } from 'sonner';
import { cookieToInitialState } from 'wagmi';

import { ThemeProvider } from "@/components/theme-provider";
import { ThemeProvider } from '@/components/theme-provider';

import { wagmiAdapter } from "./config";
import ContextProvider from "./context";

import "./globals.css";
import { wagmiAdapter } from './config';
import ContextProvider from './context';
import './globals.css';

export const metadata: Metadata = {
metadataBase: new URL("https://chat.vercel.ai"),
title: "Pattern",
description: "Pattern is a decentralized agentic RAG network",
title: 'Pattern',
description: 'Pattern is a decentralized agentic RAG network',
};

export const viewport = {
maximumScale: 1,
};

const LIGHT_THEME_COLOR = "hsl(0 0% 100%)";
const DARK_THEME_COLOR = "hsl(240deg 10% 3.92%)";
const LIGHT_THEME_COLOR = 'hsl(0 0% 100%)';
const DARK_THEME_COLOR = 'hsl(240deg 10% 3.92%)';
const THEME_COLOR_SCRIPT = `\
(function() {
var html = document.documentElement;
Expand All @@ -46,7 +44,7 @@ export default async function RootLayout({
children: React.ReactNode;
}>) {
const headersObj = await headers();
const cookies = headersObj.get("cookie");
const cookies = headersObj.get('cookie');
const initialState = cookieToInitialState(wagmiAdapter.wagmiConfig, cookies);

return (
Expand Down
14 changes: 4 additions & 10 deletions components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import type { Attachment, Message } from 'ai';
import { useChat } from 'ai/react';
import { useState } from 'react';
import { toast } from 'sonner';
import useSWR, { useSWRConfig } from 'swr';
import { useSWRConfig } from 'swr';

import { ChatHeader } from '@/components/chat-header';
import { useArtifactSelector } from '@/hooks/use-artifact';
import type { Vote } from '@/lib/db/schema';
import { fetcher, generateUUID } from '@/lib/utils';
import { generateUUID } from '@/lib/utils';

import { Artifact } from './artifact';
import { Messages } from './messages';
Expand Down Expand Up @@ -53,11 +52,6 @@ export function Chat({
},
});

const { data: votes } = useSWR<Array<Vote>>(
`/api/vote?chatId=${id}`,
fetcher,
);

const [attachments, setAttachments] = useState<Array<Attachment>>([]);
const isArtifactVisible = useArtifactSelector((state) => state.isVisible);

Expand All @@ -69,7 +63,7 @@ export function Chat({
<Messages
chatId={id}
isLoading={isLoading}
votes={votes}
votes={[]}
messages={messages}
setMessages={setMessages}
reload={reload}
Expand Down Expand Up @@ -109,7 +103,7 @@ export function Chat({
messages={messages}
setMessages={setMessages}
reload={reload}
votes={votes}
votes={[]}
isReadonly={isReadonly}
/>
</>
Expand Down
40 changes: 0 additions & 40 deletions docs/01-quick-start.md

This file was deleted.

53 changes: 0 additions & 53 deletions docs/02-update-models.md

This file was deleted.

Loading