@langchain/classic 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/agents/chat/outputParser.d.cts +2 -2
  3. package/dist/agents/chat/outputParser.d.cts.map +1 -1
  4. package/dist/agents/initialize.d.cts +2 -2
  5. package/dist/agents/initialize.d.cts.map +1 -1
  6. package/dist/agents/initialize.d.ts +2 -2
  7. package/dist/agents/initialize.d.ts.map +1 -1
  8. package/dist/agents/mrkl/outputParser.d.cts +1 -1
  9. package/dist/agents/mrkl/outputParser.d.cts.map +1 -1
  10. package/dist/agents/mrkl/outputParser.d.ts +1 -1
  11. package/dist/agents/mrkl/outputParser.d.ts.map +1 -1
  12. package/dist/chains/base.cjs +10 -4
  13. package/dist/chains/base.cjs.map +1 -1
  14. package/dist/chains/base.js +10 -4
  15. package/dist/chains/base.js.map +1 -1
  16. package/dist/chains/index.cjs +3 -0
  17. package/dist/chains/index.cjs.map +1 -1
  18. package/dist/chains/index.d.cts +2 -1
  19. package/dist/chains/index.d.ts +2 -1
  20. package/dist/chains/index.js +3 -1
  21. package/dist/chains/index.js.map +1 -1
  22. package/dist/chains/openai_moderation.cjs +107 -0
  23. package/dist/chains/openai_moderation.cjs.map +1 -0
  24. package/dist/chains/openai_moderation.d.cts +74 -0
  25. package/dist/chains/openai_moderation.d.cts.map +1 -0
  26. package/dist/chains/openai_moderation.d.ts +74 -0
  27. package/dist/chains/openai_moderation.d.ts.map +1 -0
  28. package/dist/chains/openai_moderation.js +106 -0
  29. package/dist/chains/openai_moderation.js.map +1 -0
  30. package/dist/chains/question_answering/load.d.cts +2 -2
  31. package/dist/chains/question_answering/load.d.cts.map +1 -1
  32. package/dist/chains/question_answering/load.d.ts +2 -2
  33. package/dist/chains/question_answering/load.d.ts.map +1 -1
  34. package/dist/chains/summarization/load.d.cts +2 -2
  35. package/dist/chains/summarization/load.d.cts.map +1 -1
  36. package/dist/chains/summarization/load.d.ts +2 -2
  37. package/dist/chains/summarization/load.d.ts.map +1 -1
  38. package/dist/chat_models/universal.cjs +1 -1
  39. package/dist/chat_models/universal.cjs.map +1 -1
  40. package/dist/chat_models/universal.js +1 -1
  41. package/dist/chat_models/universal.js.map +1 -1
  42. package/dist/embeddings/cache_backed.d.cts +1 -1
  43. package/dist/embeddings/cache_backed.d.ts +1 -1
  44. package/dist/evaluation/agents/trajectory.d.ts.map +1 -1
  45. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  46. package/dist/evaluation/comparison/pairwise.d.ts.map +1 -1
  47. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  48. package/dist/evaluation/criteria/criteria.d.ts.map +1 -1
  49. package/dist/langchain-core/dist/messages/base.d.cts +2 -0
  50. package/dist/langchain-core/dist/messages/base.d.cts.map +1 -1
  51. package/dist/langchain-core/dist/messages/format.d.cts +8 -0
  52. package/dist/langchain-core/dist/messages/format.d.cts.map +1 -0
  53. package/dist/langchain-core/dist/tools/types.d.cts.map +1 -1
  54. package/dist/libs/langchain-core/dist/messages/base.d.ts +2 -0
  55. package/dist/libs/langchain-core/dist/messages/base.d.ts.map +1 -1
  56. package/dist/libs/langchain-core/dist/messages/format.d.ts +8 -0
  57. package/dist/libs/langchain-core/dist/messages/format.d.ts.map +1 -0
  58. package/dist/libs/langchain-core/dist/tools/types.d.ts.map +1 -1
  59. package/package.json +33 -34
@@ -1,5 +1,6 @@
1
1
  import { ContentBlock } from "./content/index.cjs";
2
2
  import { Serializable } from "../load/serializable.cjs";
3
+ import { MessageStringFormat } from "./format.cjs";
3
4
  import { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from "./message.cjs";
4
5
 
5
6
  //#region ../langchain-core/dist/messages/base.d.ts
@@ -101,6 +102,7 @@ declare abstract class BaseMessage<TStructure extends MessageStructure = Message
101
102
  // value as well as in lc_kwargs for serialisation
102
103
  _updateId(value: string | undefined): void;
103
104
  get [Symbol.toStringTag](): any;
105
+ toFormattedString(format?: MessageStringFormat): string;
104
106
  }
105
107
  /**
106
108
  * @deprecated Use "tool_calls" field on AIMessages instead
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.cts","names":["ContentBlock","Serializable","SerializedConstructor","$InferMessageContent","$InferResponseMetadata","Message","MessageStructure","MessageType","MESSAGE_SYMBOL","StoredMessageData","Record","StoredMessage","StoredGeneration","StoredMessageV1","MessageContent","Array","FunctionCall","BaseMessageFields","TStructure","TRole","Standard","OpenAIToolCall","Partial","mergeContent","_mergeStatus","BaseMessage","NonNullable","Symbol","toStringTag","isOpenAIToolCallArray","_mergeDicts","_mergeLists","Content","_mergeObj","T","BaseMessageChunk","MessageFieldWithRole","_isMessageFieldWithRole","BaseMessageLike","isBaseMessage","isBaseMessageChunk"],"sources":["../../../../../langchain-core/dist/messages/base.d.ts"],"sourcesContent":["import { ContentBlock } from \"./content/index.js\";\nimport { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from \"./message.js\";\n\n//#region src/messages/base.d.ts\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\ninterface StoredMessageData {\n content: string;\n role: string | undefined;\n name: string | undefined;\n tool_call_id: string | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additional_kwargs?: Record<string, any>;\n /** Response metadata. For example: response headers, logprobs, token counts, model name. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n response_metadata?: Record<string, any>;\n id?: string;\n}\ninterface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\ninterface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\ninterface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\ntype MessageContent = string | Array<ContentBlock>;\ninterface FunctionCall {\n /**\n * The arguments to call the function with, as generated by the model in JSON\n * format. Note that the model does not always generate valid JSON, and may\n * hallucinate parameters not defined by your function schema. Validate the\n * arguments in your code before calling your function.\n */\n arguments: string;\n /**\n * The name of the function to call.\n */\n name: string;\n}\ntype BaseMessageFields<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> = {\n id?: string;\n name?: string;\n content?: $InferMessageContent<TStructure, TRole>;\n contentBlocks?: Array<ContentBlock.Standard>;\n /** @deprecated */\n additional_kwargs?: {\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n function_call?: FunctionCall;\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n tool_calls?: OpenAIToolCall[];\n [key: string]: unknown;\n };\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n};\ndeclare function mergeContent(firstContent: MessageContent, secondContent: MessageContent): MessageContent;\n/**\n * 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n * it will return 'success'.\n *\n * @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n * @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n * @returns {\"success\" | \"error\"} The 'merged' value.\n */\ndeclare function _mergeStatus(left?: \"success\" | \"error\", right?: \"success\" | \"error\"): \"success\" | \"error\" | undefined;\n/**\n * Base class for all types of messages in a conversation. It includes\n * properties like `content`, `name`, and `additional_kwargs`. It also\n * includes methods like `toDict()` and `_getType()`.\n */\ndeclare abstract class BaseMessage<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends Serializable implements Message<TStructure, TRole> {\n lc_namespace: string[];\n lc_serializable: boolean;\n get lc_aliases(): Record<string, string>;\n readonly [MESSAGE_SYMBOL]: true;\n abstract readonly type: TRole;\n id?: string;\n name?: string;\n content: $InferMessageContent<TStructure, TRole>;\n additional_kwargs: NonNullable<BaseMessageFields<TStructure, TRole>[\"additional_kwargs\"]>;\n response_metadata: NonNullable<BaseMessageFields<TStructure, TRole>[\"response_metadata\"]>;\n /**\n * @deprecated Use .getType() instead or import the proper typeguard.\n * For example:\n *\n * ```ts\n * import { isAIMessage } from \"@langchain/core/messages\";\n *\n * const message = new AIMessage(\"Hello!\");\n * isAIMessage(message); // true\n * ```\n */\n _getType(): MessageType;\n /**\n * @deprecated Use .type instead\n * The type of the message.\n */\n getType(): MessageType;\n constructor(arg: $InferMessageContent<TStructure, TRole> | BaseMessageFields<TStructure, TRole>);\n /** Get text content of the message. */\n get text(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n toDict(): StoredMessage;\n static lc_name(): string;\n // Can't be protected for silly reasons\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is BaseMessage;\n // this private method is used to update the ID for the runtime\n // value as well as in lc_kwargs for serialisation\n _updateId(value: string | undefined): void;\n get [Symbol.toStringTag](): any;\n}\n/**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\ntype OpenAIToolCall = {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The function that the model called.\n */\n function: FunctionCall;\n /**\n * The type of the tool. Currently, only `function` is supported.\n */\n type: \"function\";\n index?: number;\n};\ndeclare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\ndeclare function _mergeDicts(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nleft?: Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nright?: Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any>;\ndeclare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare function _mergeObj<T = any>(left: T | undefined, right: T | undefined): T;\n/**\n * Represents a chunk of a message, which can be concatenated with other\n * message chunks. It includes a method `_merge_kwargs_dict()` for merging\n * additional keyword arguments from another `BaseMessageChunk` into this\n * one. It also overrides the `__add__()` method to support concatenation\n * of `BaseMessageChunk` instances.\n */\ndeclare abstract class BaseMessageChunk<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends BaseMessage<TStructure, TRole> {\n abstract concat(chunk: BaseMessageChunk): BaseMessageChunk<TStructure, TRole>;\n static isInstance(obj: unknown): obj is BaseMessageChunk;\n}\ntype MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\ndeclare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\ntype BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */ | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\ndeclare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\ndeclare function isBaseMessageChunk(messageLike?: unknown): messageLike is BaseMessageChunk;\n//#endregion\nexport { BaseMessage, BaseMessageChunk, BaseMessageFields, BaseMessageLike, FunctionCall, MessageContent, MessageFieldWithRole, OpenAIToolCall, StoredGeneration, StoredMessage, StoredMessageData, StoredMessageV1, _isMessageFieldWithRole, _mergeDicts, _mergeLists, _mergeObj, _mergeStatus, isBaseMessage, isBaseMessageChunk, isOpenAIToolCallArray, mergeContent };\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;AAEoH;AAIzE,cAA7BQ,cACa,EAAA,OAAA,MAAA;UAAjBC,iBAAAA,CAAiB;EAAA,OAMLC,EAAAA,MAAAA;EAAM,IAAA,EAGNA,MAAAA,GAAAA,SAAAA;EAAM,IAAA,EAAA,MAAA,GAAA,SAAA;EAAA,YAGlBC,EAAAA,MAAa,GAAA,SAEfF;EAW4B;EACd,iBAajBQ,CAAAA,EAjCiBP,MAiCA,CAAA,MAAA,EAAA,GAAA,CAAA;EAAA;EAAA;EAAoC,iBAAGJ,CAAAA,EA9BvCI,MA8BuCJ,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAgB,EAAA,CAAA,EAAgBC,MAAAA;;UA3BnFI,aAAAA,CA8BuBO;EAAU,IAAA,EAAEC,MAAAA;EAAK,IAAA,EA5B1CV,iBA4BIN;;UAhBFa,YAAAA,CA+C4CV;EAAgB;;;;;;EAG5C,SACdE,EAAAA,MAAAA;EAAc;;;EAIuB,IAAA,EAAtCL,MAAAA;;KA1CNc,iBA2C0DE,CAAAA,mBA3CrBb,gBA2CqBa,GA3CFb,gBA2CEa,EAAAA,cA3C8BZ,WA2C9BY,GA3C4CZ,WA2C5CY,CAAAA,GAAAA;EAAK,EAAA,CAAA,EAAnCF,MAAAA;EAAiB,IAAA,CAA7BS,EAAAA,MAAAA;EAAW,OACmBR,CAAAA,EAzCvCf,oBAyCuCe,CAzClBA,UAyCkBA,EAzCNC,KAyCMD,CAAAA;EAAU,aAAEC,CAAAA,EAxC7CJ,KAwC6CI,CAxCvCnB,YAAAA,CAAaoB,QAwC0BD,CAAAA;EAAK;EAAlB,iBAA7BO,CAAAA,EAAAA;IAAW;;;IAkBkB,aAAEP,CAAAA,EApDhCH,YAoDgCG;IAAK;;;IAAuC,UAAnCF,CAAAA,EAhD5CI,cAgD4CJ,EAAAA;IAAiB,CAAA,GAGjDjB,EAAAA,MAAAA,CAAAA,EAAAA,OAAaoB;EAAQ,CAAA;EAAtB,iBAChBT,CAAAA,EAjDUW,OAiDVX,CAjDkBP,sBAiDlBO,CAjDyCO,UAiDzCP,EAjDqDQ,KAiDrDR,CAAAA,CAAAA;CAAa;;;;;;uBAhCFc,+BAA+BnB,mBAAmBA,gCAAgCC,cAAcA,qBAAqBN,YAAAA,YAAwBI,QAAQa,YAAYC;;;oBAGpKT;YACRF,cAAAA;0BACcW;;;WAGfhB,qBAAqBe,YAAYC;qBACvBO,YAAYT,kBAAkBC,YAAYC;qBAC1CO,YAAYT,kBAAkBC,YAAYC;;;;;;;;;;;;cAYjDZ;;;;;aAKDA;mBACMJ,qBAAqBe,YAAYC,SAASF,kBAAkBC,YAAYC;;;uBAGpEJ,MAAMf,YAAAA,CAAaoB;YAC9BT;;;0BAGcD;0CACgBe;;;;OAInCE,MAAAA,CAAOC,WAAAA;;;;;KAKTP,cAAAA;;;;;;;;YAQOL"}
1
+ {"version":3,"file":"base.d.cts","names":["ContentBlock","Serializable","SerializedConstructor","MessageStringFormat","$InferMessageContent","$InferResponseMetadata","Message","MessageStructure","MessageType","MESSAGE_SYMBOL","StoredMessageData","Record","StoredMessage","StoredGeneration","StoredMessageV1","MessageContent","Array","FunctionCall","BaseMessageFields","TStructure","TRole","Standard","OpenAIToolCall","Partial","mergeContent","_mergeStatus","BaseMessage","NonNullable","Symbol","toStringTag","isOpenAIToolCallArray","_mergeDicts","_mergeLists","Content","_mergeObj","T","BaseMessageChunk","MessageFieldWithRole","_isMessageFieldWithRole","BaseMessageLike","isBaseMessage","isBaseMessageChunk"],"sources":["../../../../../langchain-core/dist/messages/base.d.ts"],"sourcesContent":["import { ContentBlock } from \"./content/index.js\";\nimport { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { MessageStringFormat } from \"./format.js\";\nimport { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from \"./message.js\";\n\n//#region src/messages/base.d.ts\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\ninterface StoredMessageData {\n content: string;\n role: string | undefined;\n name: string | undefined;\n tool_call_id: string | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additional_kwargs?: Record<string, any>;\n /** Response metadata. For example: response headers, logprobs, token counts, model name. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n response_metadata?: Record<string, any>;\n id?: string;\n}\ninterface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\ninterface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\ninterface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\ntype MessageContent = string | Array<ContentBlock>;\ninterface FunctionCall {\n /**\n * The arguments to call the function with, as generated by the model in JSON\n * format. Note that the model does not always generate valid JSON, and may\n * hallucinate parameters not defined by your function schema. Validate the\n * arguments in your code before calling your function.\n */\n arguments: string;\n /**\n * The name of the function to call.\n */\n name: string;\n}\ntype BaseMessageFields<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> = {\n id?: string;\n name?: string;\n content?: $InferMessageContent<TStructure, TRole>;\n contentBlocks?: Array<ContentBlock.Standard>;\n /** @deprecated */\n additional_kwargs?: {\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n function_call?: FunctionCall;\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n tool_calls?: OpenAIToolCall[];\n [key: string]: unknown;\n };\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n};\ndeclare function mergeContent(firstContent: MessageContent, secondContent: MessageContent): MessageContent;\n/**\n * 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n * it will return 'success'.\n *\n * @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n * @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n * @returns {\"success\" | \"error\"} The 'merged' value.\n */\ndeclare function _mergeStatus(left?: \"success\" | \"error\", right?: \"success\" | \"error\"): \"success\" | \"error\" | undefined;\n/**\n * Base class for all types of messages in a conversation. It includes\n * properties like `content`, `name`, and `additional_kwargs`. It also\n * includes methods like `toDict()` and `_getType()`.\n */\ndeclare abstract class BaseMessage<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends Serializable implements Message<TStructure, TRole> {\n lc_namespace: string[];\n lc_serializable: boolean;\n get lc_aliases(): Record<string, string>;\n readonly [MESSAGE_SYMBOL]: true;\n abstract readonly type: TRole;\n id?: string;\n name?: string;\n content: $InferMessageContent<TStructure, TRole>;\n additional_kwargs: NonNullable<BaseMessageFields<TStructure, TRole>[\"additional_kwargs\"]>;\n response_metadata: NonNullable<BaseMessageFields<TStructure, TRole>[\"response_metadata\"]>;\n /**\n * @deprecated Use .getType() instead or import the proper typeguard.\n * For example:\n *\n * ```ts\n * import { isAIMessage } from \"@langchain/core/messages\";\n *\n * const message = new AIMessage(\"Hello!\");\n * isAIMessage(message); // true\n * ```\n */\n _getType(): MessageType;\n /**\n * @deprecated Use .type instead\n * The type of the message.\n */\n getType(): MessageType;\n constructor(arg: $InferMessageContent<TStructure, TRole> | BaseMessageFields<TStructure, TRole>);\n /** Get text content of the message. */\n get text(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n toDict(): StoredMessage;\n static lc_name(): string;\n // Can't be protected for silly reasons\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is BaseMessage;\n // this private method is used to update the ID for the runtime\n // value as well as in lc_kwargs for serialisation\n _updateId(value: string | undefined): void;\n get [Symbol.toStringTag](): any;\n toFormattedString(format?: MessageStringFormat): string;\n}\n/**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\ntype OpenAIToolCall = {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The function that the model called.\n */\n function: FunctionCall;\n /**\n * The type of the tool. Currently, only `function` is supported.\n */\n type: \"function\";\n index?: number;\n};\ndeclare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\ndeclare function _mergeDicts(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nleft?: Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nright?: Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any>;\ndeclare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare function _mergeObj<T = any>(left: T | undefined, right: T | undefined): T;\n/**\n * Represents a chunk of a message, which can be concatenated with other\n * message chunks. It includes a method `_merge_kwargs_dict()` for merging\n * additional keyword arguments from another `BaseMessageChunk` into this\n * one. It also overrides the `__add__()` method to support concatenation\n * of `BaseMessageChunk` instances.\n */\ndeclare abstract class BaseMessageChunk<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends BaseMessage<TStructure, TRole> {\n abstract concat(chunk: BaseMessageChunk): BaseMessageChunk<TStructure, TRole>;\n static isInstance(obj: unknown): obj is BaseMessageChunk;\n}\ntype MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\ndeclare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\ntype BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */ | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\ndeclare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\ndeclare function isBaseMessageChunk(messageLike?: unknown): messageLike is BaseMessageChunk;\n//#endregion\nexport { BaseMessage, BaseMessageChunk, BaseMessageFields, BaseMessageLike, FunctionCall, MessageContent, MessageFieldWithRole, OpenAIToolCall, StoredGeneration, StoredMessage, StoredMessageData, StoredMessageV1, _isMessageFieldWithRole, _mergeDicts, _mergeLists, _mergeObj, _mergeStatus, isBaseMessage, isBaseMessageChunk, isOpenAIToolCallArray, mergeContent };\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;;AAGoH;AAIzE,cAA7BS,cACa,EAAA,OAAA,MAAA;UAAjBC,iBAAAA,CAAiB;EAAA,OAMLC,EAAAA,MAAAA;EAAM,IAAA,EAGNA,MAAAA,GAAAA,SAAAA;EAAM,IAAA,EAAA,MAAA,GAAA,SAAA;EAAA,YAGlBC,EAAAA,MAAa,GAAA,SAEfF;EAW4B;EACd,iBAajBQ,CAAAA,EAjCiBP,MAiCA,CAAA,MAAA,EAAA,GAAA,CAAA;EAAA;EAAA;EAAoC,iBAAGJ,CAAAA,EA9BvCI,MA8BuCJ,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAgB,EAAA,CAAA,EAAgBC,MAAAA;;UA3BnFI,aAAAA,CA8BuBO;EAAU,IAAA,EAAEC,MAAAA;EAAK,IAAA,EA5B1CV,iBA4BIN;;UAhBFa,YAAAA,CA+C4CV;EAAgB;;;;;;EAG5C,SACdE,EAAAA,MAAAA;EAAc;;;EAIuB,IAAA,EAAtCL,MAAAA;;KA1CNc,iBA2C0DE,CAAAA,mBA3CrBb,gBA2CqBa,GA3CFb,gBA2CEa,EAAAA,cA3C8BZ,WA2C9BY,GA3C4CZ,WA2C5CY,CAAAA,GAAAA;EAAK,EAAA,CAAA,EAAnCF,MAAAA;EAAiB,IAAA,CAA7BS,EAAAA,MAAAA;EAAW,OACmBR,CAAAA,EAzCvCf,oBAyCuCe,CAzClBA,UAyCkBA,EAzCNC,KAyCMD,CAAAA;EAAU,aAAEC,CAAAA,EAxC7CJ,KAwC6CI,CAxCvCpB,YAAAA,CAAaqB,QAwC0BD,CAAAA;EAAK;EAAlB,iBAA7BO,CAAAA,EAAAA;IAAW;;;IAkBkB,aAAEP,CAAAA,EApDhCH,YAoDgCG;IAAK;;;IAAuC,UAAnCF,CAAAA,EAhD5CI,cAgD4CJ,EAAAA;IAAiB,CAAA,GAGjDlB,EAAAA,MAAAA,CAAAA,EAAAA,OAAaqB;EAAQ,CAAA;EAAtB,iBAChBT,CAAAA,EAjDUW,OAiDVX,CAjDkBP,sBAiDlBO,CAjDyCO,UAiDzCP,EAjDqDQ,KAiDrDR,CAAAA,CAAAA;CAAa;;;;;;uBAhCFc,+BAA+BnB,mBAAmBA,gCAAgCC,cAAcA,qBAAqBP,YAAAA,YAAwBK,QAAQa,YAAYC;;;oBAGpKT;YACRF,cAAAA;0BACcW;;;WAGfhB,qBAAqBe,YAAYC;qBACvBO,YAAYT,kBAAkBC,YAAYC;qBAC1CO,YAAYT,kBAAkBC,YAAYC;;;;;;;;;;;;cAYjDZ;;;;;aAKDA;mBACMJ,qBAAqBe,YAAYC,SAASF,kBAAkBC,YAAYC;;;uBAGpEJ,MAAMhB,YAAAA,CAAaqB;YAC9BT;;;0BAGcD;0CACgBe;;;;OAInCE,MAAAA,CAAOC,WAAAA;6BACe1B;;;;;KAKxBmB,cAAAA;;;;;;;;YAQOL"}
@@ -0,0 +1,8 @@
1
+ //#region ../langchain-core/dist/messages/format.d.ts
2
+ //#region src/messages/format.d.ts
3
+ type MessageStringFormat = "pretty";
4
+ //#endregion
5
+
6
+ //#endregion
7
+ export { MessageStringFormat };
8
+ //# sourceMappingURL=format.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.cts","names":["MessageStringFormat"],"sources":["../../../../../langchain-core/dist/messages/format.d.ts"],"sourcesContent":["//#region src/messages/format.d.ts\ntype MessageStringFormat = \"pretty\";\n//#endregion\nexport { MessageStringFormat };\n//# sourceMappingURL=format.d.ts.map"],"mappings":";;KACKA,mBAAAA,GAAmB,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":["MessageContent","DirectToolOutput","ToolCall","ToolMessage","InferInteropZodInput","InferInteropZodOutput","InteropZodType","CallbackManagerForToolRun","RunnableConfig","RunnableInterface","RunnableToolLike","JsonSchema7Type","BaseLangChainParams","ToolDefinition","z","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TOutput","TConfig","TInput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolOutputT","TArg","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool"],"sources":["../../../../../langchain-core/dist/tools/types.d.ts"],"sourcesContent":["import { MessageContent } from \"../messages/base.js\";\nimport { DirectToolOutput, ToolCall, ToolMessage } from \"../messages/tool.js\";\nimport { InferInteropZodInput, InferInteropZodOutput, InteropZodType } from \"../utils/types/zod.js\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport { RunnableConfig, RunnableInterface } from \"../runnables/types.js\";\nimport { RunnableToolLike } from \"../runnables/base.js\";\nimport { JsonSchema7Type } from \"../utils/zod-to-json-schema/parseTypes.js\";\nimport { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport { z } from \"zod/v3\";\n\n//#region src/tools/types.d.ts\ntype ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToolOutputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\ntype ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\ntype ToolInputSchemaBase = z.ZodTypeAny | JsonSchema7Type;\n/**\n * Parameters for the Tool classes.\n */\ninterface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n}\ntype ToolRunnableConfig<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nConfigurableFieldType extends Record<string, any> = Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\ninterface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ntype StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\ntype StringInputToolSchema = z.ZodType<string | undefined, z.ZodTypeDef,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\ninterface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\ninterface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\ndeclare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\ndeclare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\ndeclare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\ndeclare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n//#endregion\nexport { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;;KAgIKsC,qBAAAA,GAAwBxB,CAAAA,CAAE0B,4BAA4B1B,CAAAA,CAAEyB"}
1
+ {"version":3,"file":"types.d.cts","names":["MessageContent","DirectToolOutput","ToolCall","ToolMessage","InferInteropZodInput","InferInteropZodOutput","InteropZodObject","InteropZodType","CallbackManagerForToolRun","RunnableConfig","RunnableInterface","RunnableToolLike","JsonSchema7Type","BaseLangChainParams","ToolDefinition","BaseStore","z","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TOutput","TConfig","TInput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolOutputT","TArg","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool","ToolRuntime","TState","TContext"],"sources":["../../../../../langchain-core/dist/tools/types.d.ts"],"sourcesContent":["import { MessageContent } from \"../messages/base.js\";\nimport { DirectToolOutput, ToolCall, ToolMessage } from \"../messages/tool.js\";\nimport { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType } from \"../utils/types/zod.js\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport { RunnableConfig, RunnableInterface } from \"../runnables/types.js\";\nimport { RunnableToolLike } from \"../runnables/base.js\";\nimport { JsonSchema7Type } from \"../utils/zod-to-json-schema/parseTypes.js\";\nimport { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport { BaseStore } from \"../stores.js\";\nimport { z } from \"zod/v3\";\n\n//#region src/tools/types.d.ts\ntype ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToolOutputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\ntype ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\ntype ToolInputSchemaBase = z.ZodTypeAny | JsonSchema7Type;\n/**\n * Parameters for the Tool classes.\n */\ninterface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n}\ntype ToolRunnableConfig<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nConfigurableFieldType extends Record<string, any> = Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\ninterface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ntype StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\ntype StringInputToolSchema = z.ZodType<string | undefined, z.ZodTypeDef,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\ninterface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\ninterface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\ndeclare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\ndeclare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\ndeclare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\ndeclare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\ntype ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject ? InferInteropZodOutput<TState> : TState extends Record<string, unknown> ? TState : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject ? InferInteropZodOutput<TContext> : TContext extends Record<string, unknown> ? TContext : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n//#endregion\nexport { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;;KAiIKwC,qBAAAA,GAAwBxB,CAAAA,CAAE0B,4BAA4B1B,CAAAA,CAAEyB"}
@@ -1,5 +1,6 @@
1
1
  import { ContentBlock } from "./content/index.js";
2
2
  import { Serializable } from "../load/serializable.js";
3
+ import { MessageStringFormat } from "./format.js";
3
4
  import { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from "./message.js";
4
5
 
5
6
  //#region ../langchain-core/dist/messages/base.d.ts
@@ -101,6 +102,7 @@ declare abstract class BaseMessage<TStructure extends MessageStructure = Message
101
102
  // value as well as in lc_kwargs for serialisation
102
103
  _updateId(value: string | undefined): void;
103
104
  get [Symbol.toStringTag](): any;
105
+ toFormattedString(format?: MessageStringFormat): string;
104
106
  }
105
107
  /**
106
108
  * @deprecated Use "tool_calls" field on AIMessages instead
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":["ContentBlock","Serializable","SerializedConstructor","$InferMessageContent","$InferResponseMetadata","Message","MessageStructure","MessageType","MESSAGE_SYMBOL","StoredMessageData","Record","StoredMessage","StoredGeneration","StoredMessageV1","MessageContent","Array","FunctionCall","BaseMessageFields","TStructure","TRole","Standard","OpenAIToolCall","Partial","mergeContent","_mergeStatus","BaseMessage","NonNullable","Symbol","toStringTag","isOpenAIToolCallArray","_mergeDicts","_mergeLists","Content","_mergeObj","T","BaseMessageChunk","MessageFieldWithRole","_isMessageFieldWithRole","BaseMessageLike","isBaseMessage","isBaseMessageChunk"],"sources":["../../../../../../langchain-core/dist/messages/base.d.ts"],"sourcesContent":["import { ContentBlock } from \"./content/index.js\";\nimport { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from \"./message.js\";\n\n//#region src/messages/base.d.ts\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\ninterface StoredMessageData {\n content: string;\n role: string | undefined;\n name: string | undefined;\n tool_call_id: string | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additional_kwargs?: Record<string, any>;\n /** Response metadata. For example: response headers, logprobs, token counts, model name. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n response_metadata?: Record<string, any>;\n id?: string;\n}\ninterface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\ninterface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\ninterface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\ntype MessageContent = string | Array<ContentBlock>;\ninterface FunctionCall {\n /**\n * The arguments to call the function with, as generated by the model in JSON\n * format. Note that the model does not always generate valid JSON, and may\n * hallucinate parameters not defined by your function schema. Validate the\n * arguments in your code before calling your function.\n */\n arguments: string;\n /**\n * The name of the function to call.\n */\n name: string;\n}\ntype BaseMessageFields<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> = {\n id?: string;\n name?: string;\n content?: $InferMessageContent<TStructure, TRole>;\n contentBlocks?: Array<ContentBlock.Standard>;\n /** @deprecated */\n additional_kwargs?: {\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n function_call?: FunctionCall;\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n tool_calls?: OpenAIToolCall[];\n [key: string]: unknown;\n };\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n};\ndeclare function mergeContent(firstContent: MessageContent, secondContent: MessageContent): MessageContent;\n/**\n * 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n * it will return 'success'.\n *\n * @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n * @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n * @returns {\"success\" | \"error\"} The 'merged' value.\n */\ndeclare function _mergeStatus(left?: \"success\" | \"error\", right?: \"success\" | \"error\"): \"success\" | \"error\" | undefined;\n/**\n * Base class for all types of messages in a conversation. It includes\n * properties like `content`, `name`, and `additional_kwargs`. It also\n * includes methods like `toDict()` and `_getType()`.\n */\ndeclare abstract class BaseMessage<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends Serializable implements Message<TStructure, TRole> {\n lc_namespace: string[];\n lc_serializable: boolean;\n get lc_aliases(): Record<string, string>;\n readonly [MESSAGE_SYMBOL]: true;\n abstract readonly type: TRole;\n id?: string;\n name?: string;\n content: $InferMessageContent<TStructure, TRole>;\n additional_kwargs: NonNullable<BaseMessageFields<TStructure, TRole>[\"additional_kwargs\"]>;\n response_metadata: NonNullable<BaseMessageFields<TStructure, TRole>[\"response_metadata\"]>;\n /**\n * @deprecated Use .getType() instead or import the proper typeguard.\n * For example:\n *\n * ```ts\n * import { isAIMessage } from \"@langchain/core/messages\";\n *\n * const message = new AIMessage(\"Hello!\");\n * isAIMessage(message); // true\n * ```\n */\n _getType(): MessageType;\n /**\n * @deprecated Use .type instead\n * The type of the message.\n */\n getType(): MessageType;\n constructor(arg: $InferMessageContent<TStructure, TRole> | BaseMessageFields<TStructure, TRole>);\n /** Get text content of the message. */\n get text(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n toDict(): StoredMessage;\n static lc_name(): string;\n // Can't be protected for silly reasons\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is BaseMessage;\n // this private method is used to update the ID for the runtime\n // value as well as in lc_kwargs for serialisation\n _updateId(value: string | undefined): void;\n get [Symbol.toStringTag](): any;\n}\n/**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\ntype OpenAIToolCall = {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The function that the model called.\n */\n function: FunctionCall;\n /**\n * The type of the tool. Currently, only `function` is supported.\n */\n type: \"function\";\n index?: number;\n};\ndeclare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\ndeclare function _mergeDicts(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nleft?: Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nright?: Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any>;\ndeclare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare function _mergeObj<T = any>(left: T | undefined, right: T | undefined): T;\n/**\n * Represents a chunk of a message, which can be concatenated with other\n * message chunks. It includes a method `_merge_kwargs_dict()` for merging\n * additional keyword arguments from another `BaseMessageChunk` into this\n * one. It also overrides the `__add__()` method to support concatenation\n * of `BaseMessageChunk` instances.\n */\ndeclare abstract class BaseMessageChunk<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends BaseMessage<TStructure, TRole> {\n abstract concat(chunk: BaseMessageChunk): BaseMessageChunk<TStructure, TRole>;\n static isInstance(obj: unknown): obj is BaseMessageChunk;\n}\ntype MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\ndeclare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\ntype BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */ | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\ndeclare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\ndeclare function isBaseMessageChunk(messageLike?: unknown): messageLike is BaseMessageChunk;\n//#endregion\nexport { BaseMessage, BaseMessageChunk, BaseMessageFields, BaseMessageLike, FunctionCall, MessageContent, MessageFieldWithRole, OpenAIToolCall, StoredGeneration, StoredMessage, StoredMessageData, StoredMessageV1, _isMessageFieldWithRole, _mergeDicts, _mergeLists, _mergeObj, _mergeStatus, isBaseMessage, isBaseMessageChunk, isOpenAIToolCallArray, mergeContent };\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;AAEoH;AAIzE,cAA7BQ,cACa,EAAA,OAAA,MAAA;UAAjBC,iBAAAA,CAAiB;EAAA,OAMLC,EAAAA,MAAAA;EAAM,IAAA,EAGNA,MAAAA,GAAAA,SAAAA;EAAM,IAAA,EAAA,MAAA,GAAA,SAAA;EAAA,YAGlBC,EAAAA,MAAa,GAAA,SAEfF;EAW4B;EACd,iBAajBQ,CAAAA,EAjCiBP,MAiCA,CAAA,MAAA,EAAA,GAAA,CAAA;EAAA;EAAA;EAAoC,iBAAGJ,CAAAA,EA9BvCI,MA8BuCJ,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAgB,EAAA,CAAA,EAAgBC,MAAAA;;UA3BnFI,aAAAA,CA8BuBO;EAAU,IAAA,EAAEC,MAAAA;EAAK,IAAA,EA5B1CV,iBA4BIN;;UAhBFa,YAAAA,CA+C4CV;EAAgB;;;;;;EAG5C,SACdE,EAAAA,MAAAA;EAAc;;;EAIuB,IAAA,EAAtCL,MAAAA;;KA1CNc,iBA2C0DE,CAAAA,mBA3CrBb,gBA2CqBa,GA3CFb,gBA2CEa,EAAAA,cA3C8BZ,WA2C9BY,GA3C4CZ,WA2C5CY,CAAAA,GAAAA;EAAK,EAAA,CAAA,EAAnCF,MAAAA;EAAiB,IAAA,CAA7BS,EAAAA,MAAAA;EAAW,OACmBR,CAAAA,EAzCvCf,oBAyCuCe,CAzClBA,UAyCkBA,EAzCNC,KAyCMD,CAAAA;EAAU,aAAEC,CAAAA,EAxC7CJ,KAwC6CI,CAxCvCnB,YAAAA,CAAaoB,QAwC0BD,CAAAA;EAAK;EAAlB,iBAA7BO,CAAAA,EAAAA;IAAW;;;IAkBkB,aAAEP,CAAAA,EApDhCH,YAoDgCG;IAAK;;;IAAuC,UAAnCF,CAAAA,EAhD5CI,cAgD4CJ,EAAAA;IAAiB,CAAA,GAGjDjB,EAAAA,MAAAA,CAAAA,EAAAA,OAAaoB;EAAQ,CAAA;EAAtB,iBAChBT,CAAAA,EAjDUW,OAiDVX,CAjDkBP,sBAiDlBO,CAjDyCO,UAiDzCP,EAjDqDQ,KAiDrDR,CAAAA,CAAAA;CAAa;;;;;;uBAhCFc,+BAA+BnB,mBAAmBA,gCAAgCC,cAAcA,qBAAqBN,YAAAA,YAAwBI,QAAQa,YAAYC;;;oBAGpKT;YACRF,cAAAA;0BACcW;;;WAGfhB,qBAAqBe,YAAYC;qBACvBO,YAAYT,kBAAkBC,YAAYC;qBAC1CO,YAAYT,kBAAkBC,YAAYC;;;;;;;;;;;;cAYjDZ;;;;;aAKDA;mBACMJ,qBAAqBe,YAAYC,SAASF,kBAAkBC,YAAYC;;;uBAGpEJ,MAAMf,YAAAA,CAAaoB;YAC9BT;;;0BAGcD;0CACgBe;;;;OAInCE,MAAAA,CAAOC,WAAAA;;;;;KAKTP,cAAAA;;;;;;;;YAQOL"}
1
+ {"version":3,"file":"base.d.ts","names":["ContentBlock","Serializable","SerializedConstructor","MessageStringFormat","$InferMessageContent","$InferResponseMetadata","Message","MessageStructure","MessageType","MESSAGE_SYMBOL","StoredMessageData","Record","StoredMessage","StoredGeneration","StoredMessageV1","MessageContent","Array","FunctionCall","BaseMessageFields","TStructure","TRole","Standard","OpenAIToolCall","Partial","mergeContent","_mergeStatus","BaseMessage","NonNullable","Symbol","toStringTag","isOpenAIToolCallArray","_mergeDicts","_mergeLists","Content","_mergeObj","T","BaseMessageChunk","MessageFieldWithRole","_isMessageFieldWithRole","BaseMessageLike","isBaseMessage","isBaseMessageChunk"],"sources":["../../../../../../langchain-core/dist/messages/base.d.ts"],"sourcesContent":["import { ContentBlock } from \"./content/index.js\";\nimport { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { MessageStringFormat } from \"./format.js\";\nimport { $InferMessageContent, $InferResponseMetadata, Message, MessageStructure, MessageType } from \"./message.js\";\n\n//#region src/messages/base.d.ts\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\ninterface StoredMessageData {\n content: string;\n role: string | undefined;\n name: string | undefined;\n tool_call_id: string | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additional_kwargs?: Record<string, any>;\n /** Response metadata. For example: response headers, logprobs, token counts, model name. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n response_metadata?: Record<string, any>;\n id?: string;\n}\ninterface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\ninterface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\ninterface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\ntype MessageContent = string | Array<ContentBlock>;\ninterface FunctionCall {\n /**\n * The arguments to call the function with, as generated by the model in JSON\n * format. Note that the model does not always generate valid JSON, and may\n * hallucinate parameters not defined by your function schema. Validate the\n * arguments in your code before calling your function.\n */\n arguments: string;\n /**\n * The name of the function to call.\n */\n name: string;\n}\ntype BaseMessageFields<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> = {\n id?: string;\n name?: string;\n content?: $InferMessageContent<TStructure, TRole>;\n contentBlocks?: Array<ContentBlock.Standard>;\n /** @deprecated */\n additional_kwargs?: {\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n function_call?: FunctionCall;\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n tool_calls?: OpenAIToolCall[];\n [key: string]: unknown;\n };\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n};\ndeclare function mergeContent(firstContent: MessageContent, secondContent: MessageContent): MessageContent;\n/**\n * 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n * it will return 'success'.\n *\n * @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n * @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n * @returns {\"success\" | \"error\"} The 'merged' value.\n */\ndeclare function _mergeStatus(left?: \"success\" | \"error\", right?: \"success\" | \"error\"): \"success\" | \"error\" | undefined;\n/**\n * Base class for all types of messages in a conversation. It includes\n * properties like `content`, `name`, and `additional_kwargs`. It also\n * includes methods like `toDict()` and `_getType()`.\n */\ndeclare abstract class BaseMessage<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends Serializable implements Message<TStructure, TRole> {\n lc_namespace: string[];\n lc_serializable: boolean;\n get lc_aliases(): Record<string, string>;\n readonly [MESSAGE_SYMBOL]: true;\n abstract readonly type: TRole;\n id?: string;\n name?: string;\n content: $InferMessageContent<TStructure, TRole>;\n additional_kwargs: NonNullable<BaseMessageFields<TStructure, TRole>[\"additional_kwargs\"]>;\n response_metadata: NonNullable<BaseMessageFields<TStructure, TRole>[\"response_metadata\"]>;\n /**\n * @deprecated Use .getType() instead or import the proper typeguard.\n * For example:\n *\n * ```ts\n * import { isAIMessage } from \"@langchain/core/messages\";\n *\n * const message = new AIMessage(\"Hello!\");\n * isAIMessage(message); // true\n * ```\n */\n _getType(): MessageType;\n /**\n * @deprecated Use .type instead\n * The type of the message.\n */\n getType(): MessageType;\n constructor(arg: $InferMessageContent<TStructure, TRole> | BaseMessageFields<TStructure, TRole>);\n /** Get text content of the message. */\n get text(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n toDict(): StoredMessage;\n static lc_name(): string;\n // Can't be protected for silly reasons\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is BaseMessage;\n // this private method is used to update the ID for the runtime\n // value as well as in lc_kwargs for serialisation\n _updateId(value: string | undefined): void;\n get [Symbol.toStringTag](): any;\n toFormattedString(format?: MessageStringFormat): string;\n}\n/**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\ntype OpenAIToolCall = {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The function that the model called.\n */\n function: FunctionCall;\n /**\n * The type of the tool. Currently, only `function` is supported.\n */\n type: \"function\";\n index?: number;\n};\ndeclare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\ndeclare function _mergeDicts(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nleft?: Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nright?: Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any>;\ndeclare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare function _mergeObj<T = any>(left: T | undefined, right: T | undefined): T;\n/**\n * Represents a chunk of a message, which can be concatenated with other\n * message chunks. It includes a method `_merge_kwargs_dict()` for merging\n * additional keyword arguments from another `BaseMessageChunk` into this\n * one. It also overrides the `__add__()` method to support concatenation\n * of `BaseMessageChunk` instances.\n */\ndeclare abstract class BaseMessageChunk<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends BaseMessage<TStructure, TRole> {\n abstract concat(chunk: BaseMessageChunk): BaseMessageChunk<TStructure, TRole>;\n static isInstance(obj: unknown): obj is BaseMessageChunk;\n}\ntype MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\ndeclare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\ntype BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */ | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\ndeclare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\ndeclare function isBaseMessageChunk(messageLike?: unknown): messageLike is BaseMessageChunk;\n//#endregion\nexport { BaseMessage, BaseMessageChunk, BaseMessageFields, BaseMessageLike, FunctionCall, MessageContent, MessageFieldWithRole, OpenAIToolCall, StoredGeneration, StoredMessage, StoredMessageData, StoredMessageV1, _isMessageFieldWithRole, _mergeDicts, _mergeLists, _mergeObj, _mergeStatus, isBaseMessage, isBaseMessageChunk, isOpenAIToolCallArray, mergeContent };\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;;AAGoH;AAIzE,cAA7BS,cACa,EAAA,OAAA,MAAA;UAAjBC,iBAAAA,CAAiB;EAAA,OAMLC,EAAAA,MAAAA;EAAM,IAAA,EAGNA,MAAAA,GAAAA,SAAAA;EAAM,IAAA,EAAA,MAAA,GAAA,SAAA;EAAA,YAGlBC,EAAAA,MAAa,GAAA,SAEfF;EAW4B;EACd,iBAajBQ,CAAAA,EAjCiBP,MAiCA,CAAA,MAAA,EAAA,GAAA,CAAA;EAAA;EAAA;EAAoC,iBAAGJ,CAAAA,EA9BvCI,MA8BuCJ,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAgB,EAAA,CAAA,EAAgBC,MAAAA;;UA3BnFI,aAAAA,CA8BuBO;EAAU,IAAA,EAAEC,MAAAA;EAAK,IAAA,EA5B1CV,iBA4BIN;;UAhBFa,YAAAA,CA+C4CV;EAAgB;;;;;;EAG5C,SACdE,EAAAA,MAAAA;EAAc;;;EAIuB,IAAA,EAAtCL,MAAAA;;KA1CNc,iBA2C0DE,CAAAA,mBA3CrBb,gBA2CqBa,GA3CFb,gBA2CEa,EAAAA,cA3C8BZ,WA2C9BY,GA3C4CZ,WA2C5CY,CAAAA,GAAAA;EAAK,EAAA,CAAA,EAAnCF,MAAAA;EAAiB,IAAA,CAA7BS,EAAAA,MAAAA;EAAW,OACmBR,CAAAA,EAzCvCf,oBAyCuCe,CAzClBA,UAyCkBA,EAzCNC,KAyCMD,CAAAA;EAAU,aAAEC,CAAAA,EAxC7CJ,KAwC6CI,CAxCvCpB,YAAAA,CAAaqB,QAwC0BD,CAAAA;EAAK;EAAlB,iBAA7BO,CAAAA,EAAAA;IAAW;;;IAkBkB,aAAEP,CAAAA,EApDhCH,YAoDgCG;IAAK;;;IAAuC,UAAnCF,CAAAA,EAhD5CI,cAgD4CJ,EAAAA;IAAiB,CAAA,GAGjDlB,EAAAA,MAAAA,CAAAA,EAAAA,OAAaqB;EAAQ,CAAA;EAAtB,iBAChBT,CAAAA,EAjDUW,OAiDVX,CAjDkBP,sBAiDlBO,CAjDyCO,UAiDzCP,EAjDqDQ,KAiDrDR,CAAAA,CAAAA;CAAa;;;;;;uBAhCFc,+BAA+BnB,mBAAmBA,gCAAgCC,cAAcA,qBAAqBP,YAAAA,YAAwBK,QAAQa,YAAYC;;;oBAGpKT;YACRF,cAAAA;0BACcW;;;WAGfhB,qBAAqBe,YAAYC;qBACvBO,YAAYT,kBAAkBC,YAAYC;qBAC1CO,YAAYT,kBAAkBC,YAAYC;;;;;;;;;;;;cAYjDZ;;;;;aAKDA;mBACMJ,qBAAqBe,YAAYC,SAASF,kBAAkBC,YAAYC;;;uBAGpEJ,MAAMhB,YAAAA,CAAaqB;YAC9BT;;;0BAGcD;0CACgBe;;;;OAInCE,MAAAA,CAAOC,WAAAA;6BACe1B;;;;;KAKxBmB,cAAAA;;;;;;;;YAQOL"}
@@ -0,0 +1,8 @@
1
+ //#region ../langchain-core/dist/messages/format.d.ts
2
+ //#region src/messages/format.d.ts
3
+ type MessageStringFormat = "pretty";
4
+ //#endregion
5
+
6
+ //#endregion
7
+ export { MessageStringFormat };
8
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","names":["MessageStringFormat"],"sources":["../../../../../../langchain-core/dist/messages/format.d.ts"],"sourcesContent":["//#region src/messages/format.d.ts\ntype MessageStringFormat = \"pretty\";\n//#endregion\nexport { MessageStringFormat };\n//# sourceMappingURL=format.d.ts.map"],"mappings":";;KACKA,mBAAAA,GAAmB,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":["MessageContent","DirectToolOutput","ToolCall","ToolMessage","InferInteropZodInput","InferInteropZodOutput","InteropZodType","CallbackManagerForToolRun","RunnableConfig","RunnableInterface","RunnableToolLike","JsonSchema7Type","BaseLangChainParams","ToolDefinition","z","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TOutput","TConfig","TInput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolOutputT","TArg","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool"],"sources":["../../../../../../langchain-core/dist/tools/types.d.ts"],"sourcesContent":["import { MessageContent } from \"../messages/base.js\";\nimport { DirectToolOutput, ToolCall, ToolMessage } from \"../messages/tool.js\";\nimport { InferInteropZodInput, InferInteropZodOutput, InteropZodType } from \"../utils/types/zod.js\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport { RunnableConfig, RunnableInterface } from \"../runnables/types.js\";\nimport { RunnableToolLike } from \"../runnables/base.js\";\nimport { JsonSchema7Type } from \"../utils/zod-to-json-schema/parseTypes.js\";\nimport { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport { z } from \"zod/v3\";\n\n//#region src/tools/types.d.ts\ntype ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToolOutputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\ntype ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\ntype ToolInputSchemaBase = z.ZodTypeAny | JsonSchema7Type;\n/**\n * Parameters for the Tool classes.\n */\ninterface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n}\ntype ToolRunnableConfig<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nConfigurableFieldType extends Record<string, any> = Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\ninterface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ntype StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\ntype StringInputToolSchema = z.ZodType<string | undefined, z.ZodTypeDef,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\ninterface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\ninterface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\ndeclare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\ndeclare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\ndeclare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\ndeclare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n//#endregion\nexport { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;;;;;;;;KAgIKsC,qBAAAA,GAAwBxB,CAAAA,CAAE0B,4BAA4B1B,CAAAA,CAAEyB"}
1
+ {"version":3,"file":"types.d.ts","names":["MessageContent","DirectToolOutput","ToolCall","ToolMessage","InferInteropZodInput","InferInteropZodOutput","InteropZodObject","InteropZodType","CallbackManagerForToolRun","RunnableConfig","RunnableInterface","RunnableToolLike","JsonSchema7Type","BaseLangChainParams","ToolDefinition","BaseStore","z","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TOutput","TConfig","TInput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolOutputT","TArg","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool","ToolRuntime","TState","TContext"],"sources":["../../../../../../langchain-core/dist/tools/types.d.ts"],"sourcesContent":["import { MessageContent } from \"../messages/base.js\";\nimport { DirectToolOutput, ToolCall, ToolMessage } from \"../messages/tool.js\";\nimport { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType } from \"../utils/types/zod.js\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport { RunnableConfig, RunnableInterface } from \"../runnables/types.js\";\nimport { RunnableToolLike } from \"../runnables/base.js\";\nimport { JsonSchema7Type } from \"../utils/zod-to-json-schema/parseTypes.js\";\nimport { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport { BaseStore } from \"../stores.js\";\nimport { z } from \"zod/v3\";\n\n//#region src/tools/types.d.ts\ntype ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToolOutputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\ntype ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\ntype ToolInputSchemaBase = z.ZodTypeAny | JsonSchema7Type;\n/**\n * Parameters for the Tool classes.\n */\ninterface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n}\ntype ToolRunnableConfig<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nConfigurableFieldType extends Record<string, any> = Record<string, any>,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\ninterface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\ntype ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ntype StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\ntype StringInputToolSchema = z.ZodType<string | undefined, z.ZodTypeDef,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\ninterface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\ninterface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\ninterface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\ndeclare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\ndeclare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\ndeclare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\ndeclare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\ntype ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject ? InferInteropZodOutput<TState> : TState extends Record<string, unknown> ? TState : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject ? InferInteropZodOutput<TContext> : TContext extends Record<string, unknown> ? TContext : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n//#endregion\nexport { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;;;;;;;;KAiIKwC,qBAAAA,GAAwBxB,CAAAA,CAAE0B,4BAA4B1B,CAAAA,CAAEyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/classic",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Old abstractions form LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -35,7 +35,6 @@
35
35
  "@google/generative-ai": "^0.7.0",
36
36
  "@lancedb/lancedb": "^0.19.1",
37
37
  "@langchain/langgraph": "1.0.0-alpha.5",
38
- "@langchain/scripts": ">=0.1.0 <0.2.0",
39
38
  "@layerup/layerup-security": "^1.5.12",
40
39
  "@opensearch-project/opensearch": "^2.2.0",
41
40
  "@pinecone-database/pinecone": "^5.0.2",
@@ -57,7 +56,7 @@
57
56
  "@vitest/coverage-v8": "^3.2.4",
58
57
  "@xata.io/client": "^0.28.4",
59
58
  "@zilliz/milvus2-sdk-node": "^2.3.5",
60
- "axios": "^0.26.0",
59
+ "axios": "^0.30.2",
61
60
  "cheerio": "1.0.0-rc.12",
62
61
  "chromadb": "^1.5.3",
63
62
  "cohere-ai": "^7.14.0",
@@ -90,43 +89,43 @@
90
89
  "rimraf": "^5.0.1",
91
90
  "rollup": "^3.19.1",
92
91
  "sqlite3": "^5.1.4",
93
- "typeorm": "^0.3.20",
92
+ "typeorm": "^0.3.26",
94
93
  "typescript": "~5.8.3",
95
94
  "typesense": "^1.5.3",
96
95
  "vitest": "^3.2.4",
97
96
  "voy-search": "0.6.2",
98
97
  "weaviate-client": "^3.8.0",
99
98
  "zod-to-json-schema": "^3.24.6",
100
- "@langchain/anthropic": "1.0.0-alpha.2",
101
- "@langchain/aws": "0.1.15",
102
- "@langchain/core": "1.0.0",
103
- "@langchain/azure-cosmosdb": "0.2.8",
104
- "@langchain/cloudflare": "0.1.0",
105
- "@langchain/azure-dynamic-sessions": "0.2.0",
106
- "@langchain/cohere": "0.3.4",
107
- "@langchain/baidu-qianfan": "0.2.0",
108
- "@langchain/google-genai": "0.2.16",
99
+ "@langchain/anthropic": "1.0.0",
100
+ "@langchain/aws": "1.0.1",
101
+ "@langchain/baidu-qianfan": "1.0.0",
102
+ "@langchain/azure-dynamic-sessions": "1.0.0",
103
+ "@langchain/cloudflare": "1.0.0",
104
+ "@langchain/cohere": "1.0.0",
105
+ "@langchain/azure-cosmosdb": "1.0.0",
106
+ "@langchain/exa": "1.0.0",
107
+ "@langchain/deepseek": "1.0.0",
108
+ "@langchain/google-cloud-sql-pg": "1.0.0",
109
+ "@langchain/google-common": "1.0.0",
109
110
  "@langchain/eslint": "0.1.0",
110
- "@langchain/deepseek": "0.1.0",
111
- "@langchain/exa": "0.1.0",
112
- "@langchain/google-vertexai": "0.2.16",
113
- "@langchain/nomic": "0.1.0",
114
- "@langchain/groq": "0.2.3",
115
- "@langchain/mongodb": "0.1.0",
116
- "@langchain/google-cloud-sql-pg": "0.0.1",
117
- "@langchain/mistralai": "0.2.1",
118
- "@langchain/google-vertexai-web": "0.2.16",
111
+ "@langchain/google-genai": "1.0.0",
112
+ "@langchain/core": "1.0.4",
113
+ "@langchain/groq": "1.0.0",
114
+ "@langchain/google-vertexai-web": "1.0.0",
115
+ "@langchain/google-vertexai": "1.0.0",
116
+ "@langchain/mistralai": "1.0.0",
117
+ "@langchain/nomic": "1.0.0",
118
+ "@langchain/ollama": "1.0.1",
119
+ "@langchain/mongodb": "1.0.0",
119
120
  "@langchain/textsplitters": "1.0.0",
120
- "@langchain/qdrant": "0.1.2",
121
- "@langchain/tavily": "0.1.4",
122
- "@langchain/redis": "0.1.1",
123
- "@langchain/weaviate": "0.2.1",
124
- "@langchain/ollama": "0.2.3",
125
- "@langchain/google-common": "0.2.16",
126
- "@langchain/yandex": "0.1.0",
127
- "langchain": "1.0.0-alpha.9",
128
- "@langchain/pinecone": "0.2.0",
129
- "@langchain/xai": "0.1.0"
121
+ "@langchain/redis": "1.0.0",
122
+ "@langchain/qdrant": "1.0.0",
123
+ "@langchain/pinecone": "1.0.0",
124
+ "@langchain/weaviate": "1.0.0",
125
+ "@langchain/xai": "1.0.0",
126
+ "@langchain/yandex": "1.0.0",
127
+ "@langchain/tavily": "1.0.0",
128
+ "langchain": "1.0.4"
130
129
  },
131
130
  "peerDependencies": {
132
131
  "@langchain/core": "^1.0.0",
@@ -154,8 +153,8 @@
154
153
  "uuid": "^10.0.0",
155
154
  "yaml": "^2.2.1",
156
155
  "zod": "^3.25.76 || ^4",
157
- "@langchain/textsplitters": "1.0.0",
158
- "@langchain/openai": "1.0.0-alpha.3"
156
+ "@langchain/openai": "1.1.0",
157
+ "@langchain/textsplitters": "1.0.0"
159
158
  },
160
159
  "optionalDependencies": {
161
160
  "langsmith": "^0.3.64"