Skip to content

Conversation

@dqbd
Copy link
Collaborator

@dqbd dqbd commented Sep 18, 2025

Supersedes toLangGraphEventStream and toLangGraphEventStreamResponse. Similar to encoding option in streamEvents, but emits LGP-style events, that can be consumed via custom transport in useStream (see #1662).

Example usage:

const app = new Hono();

app.post("/api/stream", async (c) => {
  const { input } = z.object({ input: schema }).parse(await c.req.json());

  const stream = await graph.stream(input, {
    encoding: "text/event-stream",
    streamMode: ["values", "messages", "updates"],
  });

  return new Response(stream, {
    headers: { "Content-Type": "text/event-stream" },
  });
});

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: 628b216

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dqbd dqbd enabled auto-merge (squash) September 18, 2025 22:36
@dqbd dqbd merged commit 05619e2 into v1 Sep 18, 2025
12 checks passed
@dqbd dqbd deleted the dqbd/stream-encoding branch September 18, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants