Accesses the shared stream instance from the nearest ancestor that
called provideStream().
Throws if no ancestor has provided a stream.
useStreamContext<
T = Record<string, unknown>,
Bag extends BagTemplate = BagTemplate
>(): <!-- MessageList.vue -->
<script setup lang="ts">
import { useStreamContext } from "@langchain/vue";
const { messages } = useStreamContext();
</script>
<template>
<div v-for="(msg, i) in messages.value" :key="msg.id ?? i">
{{ msg.content }}
</div>
</template><script setup lang="ts">
import { useStreamContext } from "@langchain/vue";
import type { agent } from "./agent";
const { toolCalls } = useStreamContext<typeof agent>();
</script>