"""Message responsible for deleting other messages."""fromtypingimportAny,Literalfromlangchain_core.messages.baseimportBaseMessage
[docs]classRemoveMessage(BaseMessage):"""Message responsible for deleting other messages."""type:Literal["remove"]="remove""""The type of the message (used for serialization). Defaults to "remove"."""def__init__(self,id:str,# noqa: A002**kwargs:Any,)->None:"""Create a RemoveMessage. Args: 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. """ifkwargs.pop("content",None):msg="RemoveMessage does not support 'content' field."raiseValueError(msg)super().__init__("",id=id,**kwargs)