{"version":3,"file":"human.cjs","names":["BaseMessage","fields:\n      | $InferMessageContent<TStructure, \"human\">\n      | HumanMessageFields<TStructure>","obj: unknown","BaseMessageChunk","chunk: HumanMessageChunk<TStructure>","mergeContent","_mergeDicts","x: BaseMessage","x: BaseMessageChunk"],"sources":["../../src/messages/human.ts"],"sourcesContent":["import {\n  BaseMessage,\n  BaseMessageChunk,\n  mergeContent,\n  _mergeDicts,\n  type BaseMessageFields,\n} from \"./base.js\";\nimport type { $InferMessageContent, MessageStructure } from \"./message.js\";\nimport { Constructor } from \"./utils.js\";\n\nexport interface HumanMessageFields<\n  TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageFields<TStructure, \"human\"> {}\n\n/**\n * Represents a human message in a conversation.\n */\nexport class HumanMessage<\n  TStructure extends MessageStructure = MessageStructure\n> extends BaseMessage<TStructure, \"human\"> {\n  static lc_name() {\n    return \"HumanMessage\";\n  }\n\n  readonly type = \"human\" as const;\n\n  constructor(\n    fields:\n      | $InferMessageContent<TStructure, \"human\">\n      | HumanMessageFields<TStructure>\n  ) {\n    super(fields);\n  }\n\n  static isInstance(obj: unknown): obj is HumanMessage {\n    return super.isInstance(obj) && obj.type === \"human\";\n  }\n}\n\n/**\n * Represents a chunk of a human message, which can be concatenated with\n * other human message chunks.\n */\nexport class HumanMessageChunk<\n  TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageChunk<TStructure, \"human\"> {\n  static lc_name() {\n    return \"HumanMessageChunk\";\n  }\n\n  readonly type = \"human\" as const;\n\n  constructor(\n    fields:\n      | $InferMessageContent<TStructure, \"human\">\n      | HumanMessageFields<TStructure>\n  ) {\n    super(fields);\n  }\n\n  concat(chunk: HumanMessageChunk<TStructure>) {\n    const Cls = this.constructor as Constructor<this>;\n    return new Cls({\n      content: mergeContent(this.content, chunk.content),\n      additional_kwargs: _mergeDicts(\n        this.additional_kwargs,\n        chunk.additional_kwargs\n      ),\n      response_metadata: _mergeDicts(\n        this.response_metadata,\n        chunk.response_metadata\n      ),\n      id: this.id ?? chunk.id,\n    });\n  }\n\n  static isInstance(obj: unknown): obj is HumanMessageChunk {\n    return super.isInstance(obj) && obj.type === \"human\";\n  }\n}\n\n/**\n * @deprecated Use {@link HumanMessage.isInstance} instead\n */\nexport function isHumanMessage<TStructure extends MessageStructure>(\n  x: BaseMessage\n): x is HumanMessage<TStructure> {\n  return x.getType() === \"human\";\n}\n\n/**\n * @deprecated Use {@link HumanMessageChunk.isInstance} instead\n */\nexport function isHumanMessageChunk<TStructure extends MessageStructure>(\n  x: BaseMessageChunk\n): x is HumanMessageChunk<TStructure> {\n  return x.getType() === \"human\";\n}\n"],"mappings":";;;;;;AAiBA,IAAa,eAAb,cAEUA,yBAAiC;CACzC,OAAO,UAAU;AACf,SAAO;CACR;CAED,AAAS,OAAO;CAEhB,YACEC,QAGA;EACA,MAAM,OAAO;CACd;CAED,OAAO,WAAWC,KAAmC;AACnD,SAAO,MAAM,WAAW,IAAI,IAAI,IAAI,SAAS;CAC9C;AACF;;;;;AAMD,IAAa,oBAAb,cAEUC,8BAAsC;CAC9C,OAAO,UAAU;AACf,SAAO;CACR;CAED,AAAS,OAAO;CAEhB,YACEF,QAGA;EACA,MAAM,OAAO;CACd;CAED,OAAOG,OAAsC;EAC3C,MAAM,MAAM,KAAK;AACjB,SAAO,IAAI,IAAI;GACb,SAASC,0BAAa,KAAK,SAAS,MAAM,QAAQ;GAClD,mBAAmBC,yBACjB,KAAK,mBACL,MAAM,kBACP;GACD,mBAAmBA,yBACjB,KAAK,mBACL,MAAM,kBACP;GACD,IAAI,KAAK,MAAM,MAAM;EACtB;CACF;CAED,OAAO,WAAWJ,KAAwC;AACxD,SAAO,MAAM,WAAW,IAAI,IAAI,IAAI,SAAS;CAC9C;AACF;;;;AAKD,SAAgB,eACdK,GAC+B;AAC/B,QAAO,EAAE,SAAS,KAAK;AACxB;;;;AAKD,SAAgB,oBACdC,GACoC;AACpC,QAAO,EAAE,SAAS,KAAK;AACxB"}