diff --git a/packages/react/src/runtimes/edge/useEdgeRuntime.ts b/packages/react/src/runtimes/edge/useEdgeRuntime.ts index 7e717d1ce..9945ac547 100644 --- a/packages/react/src/runtimes/edge/useEdgeRuntime.ts +++ b/packages/react/src/runtimes/edge/useEdgeRuntime.ts @@ -1,5 +1,4 @@ import { LocalRuntimeOptions, useLocalRuntime } from ".."; -import { useState } from "react"; import { EdgeChatAdapterOptions, EdgeChatAdapter } from "./EdgeChatAdapter"; import { splitLocalRuntimeOptions } from "../local/LocalRuntimeOptions"; @@ -8,6 +7,9 @@ export type EdgeRuntimeOptions = EdgeChatAdapterOptions & LocalRuntimeOptions; export const useEdgeRuntime = (options: EdgeRuntimeOptions) => { const { localRuntimeOptions, otherOptions } = splitLocalRuntimeOptions(options); - const [adapter] = useState(() => new EdgeChatAdapter(otherOptions)); - return useLocalRuntime(adapter, localRuntimeOptions); + + return useLocalRuntime( + new EdgeChatAdapter(otherOptions), + localRuntimeOptions, + ); };