fix: chat query (#1170)

Co-authored-by: josh <josh@afterima.ge>
This commit is contained in:
Nicklas Scharpff 2025-09-09 00:29:04 +02:00 committed by GitHub
parent d3b3449eb8
commit f2320bf321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 879 additions and 145 deletions

View file

@ -7,6 +7,7 @@ import { getChatById, getMessagesByChatId } from '@/lib/db/queries';
import { DataStreamHandler } from '@/components/data-stream-handler';
import { DEFAULT_CHAT_MODEL } from '@/lib/ai/models';
import { convertToUIMessages } from '@/lib/utils';
import { LanguageModelV2Usage } from '@ai-sdk/provider';
export default async function Page(props: { params: Promise<{ id: string }> }) {
const params = await props.params;
@ -53,6 +54,7 @@ export default async function Page(props: { params: Promise<{ id: string }> }) {
isReadonly={session?.user?.id !== chat.userId}
session={session}
autoResume={true}
initialLastContext={chat.lastContext ?? undefined}
/>
<DataStreamHandler />
</>
@ -69,6 +71,7 @@ export default async function Page(props: { params: Promise<{ id: string }> }) {
isReadonly={session?.user?.id !== chat.userId}
session={session}
autoResume={true}
initialLastContext={chat.lastContext ?? undefined}
/>
<DataStreamHandler />
</>