'use client' import { useState } from 'react' import { useChat } from '@ai-sdk/react' export default function Home() { const { messages, sendMessage, status, error } = useChat() const [input, setInput] = useState('') const isLoading = status === 'submitted' || status === 'streaming' const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (!input.trim() || isLoading) return const text = input setInput('') await sendMessage({ text }) } return (

Research Team

Enter a topic. A researcher agent gathers information, a{' '} writer agent composes an article — orchestrated by open-multi-agent, streamed via Vercel AI SDK.

{messages.map((m) => (
{m.role === 'user' ? 'You' : 'Research Team'}
{m.parts .filter((part): part is { type: 'text'; text: string } => part.type === 'text') .map((part) => part.text) .join('')}
))} {isLoading && status === 'submitted' && (
Agents are collaborating — this may take a minute...
)} {error && (
Error: {error.message}
)}
setInput(e.target.value)} placeholder="Enter a topic to research..." disabled={isLoading} style={{ flex: 1, padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', fontSize: 15, outline: 'none', }} />
) }