From 42b4278562c2598e2adb5b936b2f11adef5fbbd0 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Wed, 10 Jul 2024 00:28:21 -0700 Subject: [PATCH] fix: switch to edge runtime on the client side as well (#444) --- apps/docs/components/Home.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/docs/components/Home.tsx b/apps/docs/components/Home.tsx index 0417ac633..19460d0bc 100644 --- a/apps/docs/components/Home.tsx +++ b/apps/docs/components/Home.tsx @@ -5,8 +5,7 @@ import { Shadcn } from "@/components/shadcn/Shadcn"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { useChat } from "@ai-sdk/react"; -import { AssistantRuntimeProvider } from "@assistant-ui/react"; -import { useVercelUseChatRuntime } from "@assistant-ui/react-ai-sdk"; +import { AssistantRuntimeProvider, useEdgeRuntime } from "@assistant-ui/react"; import Link from "next/link"; import { useState } from "react"; import { ChatGPT } from "./chatgpt/ChatGPT"; @@ -89,8 +88,7 @@ export type AssistantProps = { }; const MyRuntimeProvider = ({ children }: { children: React.ReactNode }) => { - const chat = useChat(); - const runtime = useVercelUseChatRuntime(chat); + const runtime = useEdgeRuntime({ api: "/api/chat" }); return ( {children}