StreamMessagesHandler(
self,
stream: Callable[[StreamChunk], None],
subgraphs: bool,
*BaseCallbackHandler_StreamingCallbackHandler| Name | Type | Description |
|---|---|---|
stream* | Callable[[StreamChunk], None] | A callable that takes a StreamChunk and emits it. |
subgraphs* | bool | Whether to emit messages from subgraphs. |
parent_ns | tuple[str, ...] | None | Default: None |
| Name | Type |
|---|---|
| stream | Callable[[StreamChunk], None] |
| subgraphs | bool |
| parent_ns | tuple[str, ...] | None |
A callback handler that implements stream_mode=messages.
Collects messages from: (1) chat model stream events; and (2) node outputs.
The namespace where the handler was created.
We keep track of this namespace to allow calls to subgraphs that
were explicitly requested as a stream with messages mode
configured.