© 2026 Hedgehog Software, LLC
export async function POST(req: Request) { const { messages } = await req.json(); const stream = await weatherAgent.stream(messages, { memory: { thread: "example-user-id", resource: "weather-chat", }, }); return createUIMessageStreamResponse({ stream: toAISdkFormat(stream, { from: "agent" }), }); }
stream = await agent.network(.. ... ... toAISdkFormat(result, { from: "network" }) ..