pushMessage(
message: BaseMessageLike | BaseMessage<MessageStructure<MessageToolSet>, MessageType>,
options| Name | Type | Description |
|---|---|---|
message* | BaseMessageLike | BaseMessage<MessageStructure<MessageToolSet>, MessageType> | The message to push. The message must have an ID set, otherwise an error will be thrown. |
options | RunnableConfig<Record<string, any>> & __type |
Manually push a message to a message stream.
This is useful when you need to push a manually created message before the node has finished executing.
When a message is pushed, it will be automatically persisted to the state after the node has finished executing.
To disable persisting, set options.stateKey to null.
RunnableConfig / Runtime coming from node context.