-
Hi there 👋, Most examples (express, Next.js) make use of the "toTextStreamResponse()" that directly works along the "useObject" React hook. Docs: Here's a working repo in Next.js: Thanks so much in advance ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think just returning it as normal to use app.get("/ai", () => {
const result = await streamObject({
schema: vacationSchema,
output: "array",
model: openai("gpt-4o-mini"),
prompt: "Generate 3 vacation destinations",
});
return result.toTextStreamResponse();
}) |
Beta Was this translation helpful? Give feedback.
I think just returning it as normal to use
c.body
seems to work.