Retrieves the shared stream instance from the nearest ancestor that called provideStream or setStreamContext.
Throws if no ancestor has provided a stream.
getStream<
T = Record<string, unknown>,
Bag extends BagTemplate = BagTemplate
>(): WithClassMessages<ResolveStreamInterface<T, InferBag<T, Bag>>><!-- MessageList.svelte -->
<script lang="ts">
import { getStream } from "@langchain/svelte";
const stream = getStream();
</script>
{#each stream.messages as msg (msg.id)}
<div>{msg.content}</div>
{/each}