Are you an LLM? You can read better optimized documentation at /streaming.md for this page in Markdown format
Liminal Streaming beta
ts
import { Terminal } from "@effect/platform"
import { BunTerminal } from "@effect/platform-bun"
import { Effect, Stream } from "effect"
Effect.gen(function*() {
const term = yield* Terminal.Terminal
yield* L.user`How are you today?`
yield* L.assistantStream.pipe(
Stream.runForEach(({ text }) => term.display(text)),
Effect.forkDaemon,
)
}).pipe(
L.thread,
Effect.provide([BunTerminal.layer, ModelLive]),
Effect.runFork,
)