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.
pushMessage(
message: BaseMessage<MessageStructure<MessageToolSet>, MessageType> | BaseMessageLike,
options: RunnableConfig<Record<string, any>> __type
): BaseMessage<MessageStructure<MessageToolSet>, MessageType>| Name | Type | Description |
|---|---|---|
message* | BaseMessage<MessageStructure<MessageToolSet>, MessageType> | BaseMessageLike | The message to push. The message must have an ID set, otherwise an error will be thrown. |
options | RunnableConfig<Record<string, any>> & __type | RunnableConfig / Runtime coming from node context. |