RemoveMessage#
- class langchain_core.messages.modifier.RemoveMessage[source]#
Bases:
BaseMessage
Message responsible for deleting other messages.
Create a RemoveMessage.
- Parameters:
id β The ID of the message to remove.
kwargs β Additional fields to pass to the message.
- Raises:
ValueError β If the βcontentβ field is passed in kwargs.
- param additional_kwargs: dict [Optional]#
Reserved for additional payload data associated with the message.
For example, for a message from an AI, this could include tool calls as encoded by the model provider.
- param content: str | list[str | dict] [Required]#
The string contents of the message.
- param id: str | None = None#
An optional unique identifier for the message. This should ideally be provided by the provider/model which created the message.
- param name: str | None = None#
An optional name for the message.
This can be used to provide a human-readable name for the message.
Usage of this field is optional, and whether itβs used or not is up to the model implementation.
- param response_metadata: dict [Optional]#
Response metadata. For example: response headers, logprobs, token counts.
- param type: Literal['remove'] = 'remove'#
The type of the message (used for serialization). Defaults to βremoveβ.
- pretty_print() None #
- Return type:
None
- pretty_repr(html: bool = False) str #
Get a pretty representation of the message.
- Parameters:
html (bool) β Whether to format the message as HTML. If True, the message will be formatted with HTML tags. Default is False.
- Returns:
A pretty representation of the message.
- Return type:
str