From 8b828c75f03c14c0fc4d6af61310e88b82c917e7 Mon Sep 17 00:00:00 2001 From: Yaqub Mahmoud Date: Tue, 28 Jan 2025 13:21:23 +0900 Subject: [PATCH] Update api.chat.ts --- app/routes/api.chat.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes/api.chat.ts b/app/routes/api.chat.ts index b685ac8..df96972 100644 --- a/app/routes/api.chat.ts +++ b/app/routes/api.chat.ts @@ -34,13 +34,13 @@ async function chatAction({ context, request }: ActionFunctionArgs) { const result = await streamText(messages, context.cloudflare.env, options); - return stream.switchSource(result.toAIStream()); + return stream.switchSource(result.toDataStream()); }, }; const result = await streamText(messages, context.cloudflare.env, options); - stream.switchSource(result.toAIStream()); + stream.switchSource(result.toDataStream()); return new Response(stream.readable, { status: 200,