Skip to content
","upvoteCount":1,"url":"https://github.com/orgs/honojs/discussions/3625#discussioncomment-11153420"}}}
Discussion options

You must be logged in to vote

I think just returning it as normal to use c.body seems to work.

app.get("/ai", () => {
  const result = await streamObject({
    schema: vacationSchema,
    output: "array",
    model: openai("gpt-4o-mini"),
    prompt: "Generate 3 vacation destinations",
  });

  return result.toTextStreamResponse();
})

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@wottpal
Comment options

@EdamAme-x
Comment options

@hugocxl
Comment options

@wottpal
Comment options

Answer selected by hugocxl
Comment options

You must be logged in to vote
1 reply
@sethgeoghegan
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants