Creates a shared useStream handle and publishes it via
Svelte's setContext. Descendant components read it via
getStream.
Must be called during component initialisation (the top level of a
<script> block or <script module> that runs at mount), same
lifecycle constraint as setContext.
| Name | Type | Description |
|---|---|---|
options* | ProvideStreamProps<T> | ProvideStreamCustomProps<T> |
<!-- ChatContainer.svelte -->
<script lang="ts">
import { provideStream } from "@langchain/svelte";
provideStream({
assistantId: "agent",
apiUrl: "http://localhost:2024",
});
</script>
<ChatHeader />
<MessageList />
<MessageInput />