parent
7faa5f1c9f
commit
a68eb2a011
41 changed files with 2350 additions and 800 deletions
|
|
@ -1,7 +1,23 @@
|
|||
import { Chat } from "@/components/custom/chat";
|
||||
import { generateUUID } from "@/lib/utils";
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import { Chat } from '@/components/custom/chat';
|
||||
import { DEFAULT_MODEL_NAME, models } from '@/lib/model';
|
||||
import { generateUUID } from '@/lib/utils';
|
||||
|
||||
export default async function Page() {
|
||||
const id = generateUUID();
|
||||
return <Chat key={id} id={id} initialMessages={[]} />;
|
||||
|
||||
const cookieStore = await cookies();
|
||||
const value = cookieStore.get('model')?.value;
|
||||
const selectedModelName =
|
||||
models.find((m) => m.name === value)?.name || DEFAULT_MODEL_NAME;
|
||||
|
||||
return (
|
||||
<Chat
|
||||
key={id}
|
||||
id={id}
|
||||
initialMessages={[]}
|
||||
selectedModelName={selectedModelName}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue