'use client'; import { useCompletion } from '@ai-sdk/react'; export default function Page() { const { completion, input, handleInputChange, handleSubmit, error, isLoading, stop, } = useCompletion(); return (

useCompletion Example

{error && (
{error.message}
)} {isLoading && (
Loading...
)} {completion}
); }