useMessages(
stream: AnyStream,
target: MaybeRefOrGetter<SelectorTarget>
): Readonly<ShallowRef<BaseMessage| Name | Type | Description |
|---|---|---|
stream* | AnyStream | |
target | MaybeRefOrGetter<SelectorTarget> |
Subscribe to a scoped messages stream.
Contract:
target) this returns stream.messages — the
always-on root projection; no extra subscription is opened.messages subscription scoped to that namespace. The
subscription is released automatically when the calling scope
disappears (and the registry closes the underlying server
subscription when the last consumer leaves).Messages are always BaseMessage class instances from
@langchain/core/messages.