refactor: use generateId() for id creation (#736)

This commit is contained in:
Jeremy 2025-01-28 18:51:04 +05:30 committed by GitHub
parent 085f4a8ac4
commit 2d47ffbd77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 20 additions and 75 deletions

View file

@ -7,7 +7,7 @@ import useSWR, { useSWRConfig } from 'swr';
import { ChatHeader } from '@/components/chat-header';
import type { Vote } from '@/lib/db/schema';
import { fetcher } from '@/lib/utils';
import { fetcher, generateUUID } from '@/lib/utils';
import { Block } from './block';
import { MultimodalInput } from './multimodal-input';
@ -45,6 +45,8 @@ export function Chat({
body: { id, modelId: selectedModelId },
initialMessages,
experimental_throttle: 100,
sendExtraMessageFields: true,
generateId: generateUUID,
onFinish: () => {
mutate('/api/history');
},