@langchain/core
Version:
Core LangChain.js abstractions and schemas
41 lines (40 loc) • 1.05 kB
JavaScript
const require_base = require("./base.cjs");
//#region src/messages/modifier.ts
/**
* Message responsible for deleting other messages.
*
* `RemoveMessage` is intentionally not generic over `MessageStructure`.
* Its content is always `[]` (empty), so carrying a structure type parameter
* would only cause unnecessary type incompatibilities when mixing messages
* from different structure configurations (e.g. passing a `RemoveMessage`
* into an API that expects `Message<CustomToolCall>`).
*/
var RemoveMessage = class extends require_base.BaseMessage {
type = "remove";
/**
* The ID of the message to remove.
*/
id;
constructor(fields) {
super({
...fields,
content: []
});
this.id = fields.id;
}
get _printableFields() {
return {
...super._printableFields,
id: this.id
};
}
static isInstance(obj) {
return super.isInstance(obj) && obj.type === "remove";
}
static [Symbol.hasInstance](obj) {
return this.isInstance(obj);
}
};
//#endregion
exports.RemoveMessage = RemoveMessage;
//# sourceMappingURL=modifier.cjs.map