@langchain/core 1.1.2 → 1.1.3

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 (227) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/agents.d.cts +0 -2
  3. package/dist/agents.d.ts +0 -2
  4. package/dist/callbacks/base.d.cts +22 -60
  5. package/dist/callbacks/base.d.ts +22 -60
  6. package/dist/callbacks/dispatch/index.d.cts +1 -3
  7. package/dist/callbacks/dispatch/index.d.ts +1 -3
  8. package/dist/callbacks/dispatch/web.d.cts +1 -3
  9. package/dist/callbacks/dispatch/web.d.ts +1 -3
  10. package/dist/callbacks/manager.d.cts +2 -12
  11. package/dist/callbacks/manager.d.ts +2 -12
  12. package/dist/chat_history.cjs +1 -1
  13. package/dist/chat_history.d.cts +0 -1
  14. package/dist/chat_history.d.ts +0 -1
  15. package/dist/chat_history.js +1 -1
  16. package/dist/document_loaders/langsmith.d.cts +0 -3
  17. package/dist/document_loaders/langsmith.d.ts +0 -3
  18. package/dist/documents/document.d.cts +3 -12
  19. package/dist/documents/document.d.ts +3 -12
  20. package/dist/example_selectors/length_based.d.cts +1 -1
  21. package/dist/example_selectors/length_based.d.ts +1 -1
  22. package/dist/indexing/base.d.cts +0 -1
  23. package/dist/indexing/base.d.ts +0 -1
  24. package/dist/indexing/record_manager.d.cts +0 -1
  25. package/dist/indexing/record_manager.d.ts +0 -1
  26. package/dist/language_models/base.d.cts +8 -38
  27. package/dist/language_models/base.d.ts +8 -38
  28. package/dist/language_models/chat_models.cjs +1 -1
  29. package/dist/language_models/chat_models.d.cts +6 -33
  30. package/dist/language_models/chat_models.d.ts +6 -33
  31. package/dist/language_models/chat_models.js +1 -1
  32. package/dist/language_models/llms.d.cts +0 -6
  33. package/dist/language_models/llms.d.ts +0 -6
  34. package/dist/load/import_type.d.cts +0 -1
  35. package/dist/load/import_type.d.ts +0 -1
  36. package/dist/load/map_keys.cjs +4 -5
  37. package/dist/load/map_keys.cjs.map +1 -1
  38. package/dist/load/map_keys.d.cts +0 -1
  39. package/dist/load/map_keys.d.ts +0 -1
  40. package/dist/load/map_keys.js +3 -3
  41. package/dist/load/map_keys.js.map +1 -1
  42. package/dist/load/serializable.d.cts +0 -1
  43. package/dist/load/serializable.d.ts +0 -1
  44. package/dist/memory.d.cts +0 -3
  45. package/dist/memory.d.ts +0 -3
  46. package/dist/messages/ai.cjs +6 -48
  47. package/dist/messages/ai.cjs.map +1 -1
  48. package/dist/messages/ai.js +6 -48
  49. package/dist/messages/ai.js.map +1 -1
  50. package/dist/messages/base.cjs +3 -2
  51. package/dist/messages/base.cjs.map +1 -1
  52. package/dist/messages/base.d.cts +1 -13
  53. package/dist/messages/base.d.ts +1 -13
  54. package/dist/messages/base.js +3 -2
  55. package/dist/messages/base.js.map +1 -1
  56. package/dist/messages/content/data.d.cts +2 -7
  57. package/dist/messages/content/data.d.ts +2 -7
  58. package/dist/messages/content/index.d.cts +1 -4
  59. package/dist/messages/content/index.d.ts +1 -4
  60. package/dist/messages/content/multimodal.d.cts +0 -1
  61. package/dist/messages/content/multimodal.d.ts +0 -1
  62. package/dist/messages/content/tools.d.cts +0 -1
  63. package/dist/messages/content/tools.d.ts +0 -1
  64. package/dist/messages/index.cjs +4 -2
  65. package/dist/messages/index.d.cts +2 -2
  66. package/dist/messages/index.d.ts +2 -2
  67. package/dist/messages/index.js +5 -4
  68. package/dist/messages/tool.d.cts +2 -9
  69. package/dist/messages/tool.d.ts +2 -9
  70. package/dist/messages/transformers.cjs +2 -2
  71. package/dist/messages/transformers.d.cts +0 -3
  72. package/dist/messages/transformers.d.ts +0 -3
  73. package/dist/messages/transformers.js +2 -2
  74. package/dist/messages/utils.cjs +77 -4
  75. package/dist/messages/utils.cjs.map +1 -1
  76. package/dist/messages/utils.d.cts +35 -7
  77. package/dist/messages/utils.d.ts +35 -7
  78. package/dist/messages/utils.js +77 -5
  79. package/dist/messages/utils.js.map +1 -1
  80. package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs +169 -0
  81. package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs.map +1 -0
  82. package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js +168 -0
  83. package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js.map +1 -0
  84. package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs +122 -0
  85. package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs.map +1 -0
  86. package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js +121 -0
  87. package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js.map +1 -0
  88. package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs +18 -0
  89. package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs.map +1 -0
  90. package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js +17 -0
  91. package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js.map +1 -0
  92. package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs +27 -0
  93. package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs.map +1 -0
  94. package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js +26 -0
  95. package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js.map +1 -0
  96. package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs +141 -0
  97. package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs.map +1 -0
  98. package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js +141 -0
  99. package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js.map +1 -0
  100. package/dist/output_parsers/json.d.cts +1 -5
  101. package/dist/output_parsers/json.d.ts +1 -5
  102. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +2 -6
  103. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +2 -6
  104. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +10 -34
  105. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +10 -34
  106. package/dist/output_parsers/transform.d.cts +0 -1
  107. package/dist/output_parsers/transform.d.ts +0 -1
  108. package/dist/outputs.d.cts +0 -6
  109. package/dist/outputs.d.ts +0 -6
  110. package/dist/prompts/base.d.cts +2 -10
  111. package/dist/prompts/base.d.ts +2 -10
  112. package/dist/prompts/chat.cjs +2 -2
  113. package/dist/prompts/chat.d.cts +13 -51
  114. package/dist/prompts/chat.d.ts +13 -51
  115. package/dist/prompts/chat.js +2 -2
  116. package/dist/prompts/few_shot.d.cts +1 -5
  117. package/dist/prompts/few_shot.d.ts +1 -5
  118. package/dist/prompts/image.d.cts +2 -10
  119. package/dist/prompts/image.d.ts +2 -10
  120. package/dist/prompts/prompt.d.cts +4 -15
  121. package/dist/prompts/prompt.d.ts +4 -16
  122. package/dist/prompts/serde.d.cts +0 -1
  123. package/dist/prompts/serde.d.ts +0 -1
  124. package/dist/prompts/string.d.cts +1 -5
  125. package/dist/prompts/string.d.ts +1 -5
  126. package/dist/prompts/structured.d.cts +3 -16
  127. package/dist/prompts/structured.d.ts +3 -16
  128. package/dist/retrievers/document_compressors/index.d.cts +0 -1
  129. package/dist/retrievers/document_compressors/index.d.ts +0 -1
  130. package/dist/retrievers/index.d.cts +2 -6
  131. package/dist/retrievers/index.d.ts +2 -6
  132. package/dist/runnables/base.cjs +7 -7
  133. package/dist/runnables/base.cjs.map +1 -1
  134. package/dist/runnables/base.d.cts +12 -64
  135. package/dist/runnables/base.d.ts +12 -64
  136. package/dist/runnables/base.js +1 -1
  137. package/dist/runnables/branch.d.cts +0 -2
  138. package/dist/runnables/branch.d.ts +0 -2
  139. package/dist/runnables/config.d.cts +0 -1
  140. package/dist/runnables/config.d.ts +0 -1
  141. package/dist/runnables/graph.d.cts +1 -5
  142. package/dist/runnables/graph.d.ts +1 -5
  143. package/dist/runnables/graph_mermaid.cjs +2 -1
  144. package/dist/runnables/graph_mermaid.cjs.map +1 -1
  145. package/dist/runnables/graph_mermaid.js +3 -1
  146. package/dist/runnables/graph_mermaid.js.map +1 -1
  147. package/dist/runnables/history.cjs +1 -1
  148. package/dist/runnables/history.d.cts +4 -12
  149. package/dist/runnables/history.d.ts +4 -12
  150. package/dist/runnables/history.js +1 -1
  151. package/dist/runnables/passthrough.d.cts +0 -2
  152. package/dist/runnables/passthrough.d.ts +0 -2
  153. package/dist/runnables/router.d.cts +0 -1
  154. package/dist/runnables/router.d.ts +0 -1
  155. package/dist/runnables/types.d.cts +2 -9
  156. package/dist/runnables/types.d.ts +2 -9
  157. package/dist/runnables/utils.cjs +5 -0
  158. package/dist/runnables/utils.cjs.map +1 -1
  159. package/dist/runnables/utils.js +5 -1
  160. package/dist/runnables/utils.js.map +1 -1
  161. package/dist/singletons/async_local_storage/context.d.cts +0 -2
  162. package/dist/singletons/async_local_storage/context.d.ts +0 -2
  163. package/dist/singletons/async_local_storage/globals.d.cts +0 -1
  164. package/dist/singletons/async_local_storage/globals.d.ts +0 -1
  165. package/dist/singletons/callbacks.cjs.map +1 -1
  166. package/dist/singletons/callbacks.js.map +1 -1
  167. package/dist/stores.d.cts +0 -1
  168. package/dist/stores.d.ts +0 -1
  169. package/dist/structured_query/utils.d.cts +1 -4
  170. package/dist/structured_query/utils.d.ts +1 -4
  171. package/dist/tools/index.d.cts +1 -6
  172. package/dist/tools/index.d.ts +1 -6
  173. package/dist/tools/types.d.cts +3 -13
  174. package/dist/tools/types.d.ts +3 -13
  175. package/dist/tracers/base.d.cts +1 -20
  176. package/dist/tracers/base.d.ts +1 -20
  177. package/dist/tracers/console.cjs +3 -3
  178. package/dist/tracers/console.cjs.map +1 -1
  179. package/dist/tracers/console.d.cts +0 -2
  180. package/dist/tracers/console.d.ts +0 -2
  181. package/dist/tracers/console.js +3 -3
  182. package/dist/tracers/console.js.map +1 -1
  183. package/dist/tracers/event_stream.d.cts +0 -4
  184. package/dist/tracers/event_stream.d.ts +0 -4
  185. package/dist/tracers/log_stream.d.cts +0 -6
  186. package/dist/tracers/log_stream.d.ts +0 -6
  187. package/dist/types/_internal.d.cts +0 -3
  188. package/dist/types/_internal.d.ts +0 -3
  189. package/dist/types/type-utils.d.cts +0 -2
  190. package/dist/types/type-utils.d.ts +0 -2
  191. package/dist/utils/async_caller.cjs +2 -7
  192. package/dist/utils/async_caller.cjs.map +1 -1
  193. package/dist/utils/async_caller.d.cts +0 -3
  194. package/dist/utils/async_caller.d.ts +0 -3
  195. package/dist/utils/async_caller.js +1 -6
  196. package/dist/utils/async_caller.js.map +1 -1
  197. package/dist/utils/env.d.cts +0 -4
  198. package/dist/utils/env.d.ts +0 -4
  199. package/dist/utils/event_source_parse.d.cts +1 -4
  200. package/dist/utils/event_source_parse.d.ts +1 -4
  201. package/dist/utils/function_calling.d.cts +1 -3
  202. package/dist/utils/function_calling.d.ts +1 -3
  203. package/dist/utils/json.d.cts +0 -1
  204. package/dist/utils/json.d.ts +0 -1
  205. package/dist/utils/stream.d.cts +1 -13
  206. package/dist/utils/stream.d.ts +1 -13
  207. package/dist/utils/testing/chat_models.d.cts +3 -11
  208. package/dist/utils/testing/chat_models.d.ts +3 -11
  209. package/dist/utils/testing/message_history.cjs +1 -1
  210. package/dist/utils/testing/message_history.js +1 -1
  211. package/dist/utils/testing/retrievers.d.cts +1 -3
  212. package/dist/utils/testing/retrievers.d.ts +1 -3
  213. package/dist/utils/testing/vectorstores.d.cts +0 -1
  214. package/dist/utils/testing/vectorstores.d.ts +0 -1
  215. package/dist/utils/types/index.cjs +4 -0
  216. package/dist/utils/types/index.d.cts +2 -4
  217. package/dist/utils/types/index.d.ts +2 -4
  218. package/dist/utils/types/index.js +4 -2
  219. package/dist/utils/types/zod.cjs +24 -0
  220. package/dist/utils/types/zod.cjs.map +1 -1
  221. package/dist/utils/types/zod.d.cts +4 -4
  222. package/dist/utils/types/zod.d.ts +4 -4
  223. package/dist/utils/types/zod.js +23 -1
  224. package/dist/utils/types/zod.js.map +1 -1
  225. package/dist/vectorstores.d.cts +5 -17
  226. package/dist/vectorstores.d.ts +5 -17
  227. package/package.json +6 -6
@@ -8,17 +8,13 @@ import { parseJsonMarkdown, parsePartialJson } from "../utils/json.js";
8
8
  /**
9
9
  * Class for parsing the output of an LLM into a JSON object.
10
10
  */
11
- declare class JsonOutputParser<
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
11
+ declare class JsonOutputParser<T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
14
12
  static lc_name(): string;
15
13
  lc_namespace: string[];
16
14
  lc_serializable: boolean;
17
15
  /** @internal */
18
16
  _concatOutputChunks<T>(first: T, second: T): T;
19
17
  protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;
20
- // This should actually return Partial<T>, but there's no way
21
- // to specify emitted chunks as instances separate from the main output type.
22
18
  parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;
23
19
  parse(text: string): Promise<T>;
24
20
  getFormatInstructions(): string;
@@ -35,9 +35,7 @@ declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {
35
35
  * Class for parsing the output of an LLM into a JSON object. Uses an
36
36
  * instance of `OutputFunctionsParser` to parse the output.
37
37
  */
38
- declare class JsonOutputFunctionsParser<
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
38
+ declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
41
39
  static lc_name(): string;
42
40
  lc_namespace: string[];
43
41
  lc_serializable: boolean;
@@ -63,9 +61,7 @@ Output extends Record<string, any> = Record<string, any>> extends BaseCumulative
63
61
  * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`
64
62
  * to parse the output.
65
63
  */
66
- declare class JsonKeyOutputFunctionsParser<
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
64
+ declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
69
65
  static lc_name(): string;
70
66
  lc_namespace: string[];
71
67
  lc_serializable: boolean;
@@ -35,9 +35,7 @@ declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {
35
35
  * Class for parsing the output of an LLM into a JSON object. Uses an
36
36
  * instance of `OutputFunctionsParser` to parse the output.
37
37
  */
38
- declare class JsonOutputFunctionsParser<
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
38
+ declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
41
39
  static lc_name(): string;
42
40
  lc_namespace: string[];
43
41
  lc_serializable: boolean;
@@ -63,9 +61,7 @@ Output extends Record<string, any> = Record<string, any>> extends BaseCumulative
63
61
  * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`
64
62
  * to parse the output.
65
63
  */
66
- declare class JsonKeyOutputFunctionsParser<
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
64
+ declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
69
65
  static lc_name(): string;
70
66
  lc_namespace: string[];
71
67
  lc_serializable: boolean;
@@ -9,28 +9,21 @@ import * as z4 from "zod/v4/core";
9
9
  type ParsedToolCall = {
10
10
  id?: string;
11
11
  type: string;
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  args: Record<string, any>;
14
13
  };
15
14
  type JsonOutputToolsParserParams = {
16
15
  /** Whether to return the tool call id. */
17
16
  returnId?: boolean;
18
17
  } & BaseCumulativeTransformOutputParserInput;
19
- declare function parseToolCall(
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- rawToolCall: Record<string, any>, options: {
18
+ declare function parseToolCall(rawToolCall: Record<string, any>, options: {
22
19
  returnId?: boolean;
23
20
  partial: true;
24
21
  }): ToolCall | undefined;
25
- declare function parseToolCall(
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- rawToolCall: Record<string, any>, options?: {
22
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
28
23
  returnId?: boolean;
29
24
  partial?: false;
30
25
  }): ToolCall;
31
- declare function parseToolCall(
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- rawToolCall: Record<string, any>, options?: {
26
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
34
27
  returnId?: boolean;
35
28
  partial?: boolean;
36
29
  }): ToolCall | undefined;
@@ -42,9 +35,7 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
42
35
  arguments: string;
43
36
  };
44
37
  };
45
- declare function makeInvalidToolCall(
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
- rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
38
+ declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
48
39
  /**
49
40
  * Class for parsing the output of a tool-calling LLM into a JSON object.
50
41
  */
@@ -63,40 +54,27 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
63
54
  * @param generations The output of the LLM to parse.
64
55
  * @returns A JSON object representation of the function call or its arguments.
65
56
  */
66
- parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- ): Promise<any>;
57
+ parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;
69
58
  }
70
59
  type JsonOutputKeyToolsParserParamsBase = {
71
60
  keyName: string;
72
61
  returnSingle?: boolean;
73
62
  } & JsonOutputToolsParserParams;
74
- type JsonOutputKeyToolsParserParamsV3<
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
- T extends Record<string, any> = Record<string, any>> = {
63
+ type JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {
77
64
  zodSchema?: z3.ZodType<T>;
78
65
  } & JsonOutputKeyToolsParserParamsBase;
79
- type JsonOutputKeyToolsParserParamsV4<
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
- T extends Record<string, any> = Record<string, any>> = {
66
+ type JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {
82
67
  zodSchema?: z4.$ZodType<T, T>;
83
68
  } & JsonOutputKeyToolsParserParamsBase;
84
- type JsonOutputKeyToolsParserParamsInterop<
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- T extends Record<string, any> = Record<string, any>> = {
69
+ type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {
87
70
  zodSchema?: InteropZodType<T>;
88
71
  } & JsonOutputKeyToolsParserParamsBase;
89
- // Use Zod 3 for backwards compatibility
90
- type JsonOutputKeyToolsParserParams<
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
72
+ type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
93
73
  /**
94
74
  * Class for parsing the output of a tool-calling LLM into a JSON object if you are
95
75
  * expecting only a single tool to be called.
96
76
  */
97
- declare class JsonOutputKeyToolsParser<
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
77
+ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
100
78
  static lc_name(): string;
101
79
  lc_namespace: string[];
102
80
  lc_serializable: boolean;
@@ -110,9 +88,7 @@ T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsPars
110
88
  constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
111
89
  constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
112
90
  protected _validateResult(result: unknown): Promise<T>;
113
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
91
  parsePartialResult(generations: ChatGeneration[]): Promise<any>;
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
92
  parseResult(generations: ChatGeneration[]): Promise<any>;
117
93
  }
118
94
  //#endregion
@@ -9,28 +9,21 @@ import * as z4 from "zod/v4/core";
9
9
  type ParsedToolCall = {
10
10
  id?: string;
11
11
  type: string;
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  args: Record<string, any>;
14
13
  };
15
14
  type JsonOutputToolsParserParams = {
16
15
  /** Whether to return the tool call id. */
17
16
  returnId?: boolean;
18
17
  } & BaseCumulativeTransformOutputParserInput;
19
- declare function parseToolCall(
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- rawToolCall: Record<string, any>, options: {
18
+ declare function parseToolCall(rawToolCall: Record<string, any>, options: {
22
19
  returnId?: boolean;
23
20
  partial: true;
24
21
  }): ToolCall | undefined;
25
- declare function parseToolCall(
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- rawToolCall: Record<string, any>, options?: {
22
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
28
23
  returnId?: boolean;
29
24
  partial?: false;
30
25
  }): ToolCall;
31
- declare function parseToolCall(
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- rawToolCall: Record<string, any>, options?: {
26
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
34
27
  returnId?: boolean;
35
28
  partial?: boolean;
36
29
  }): ToolCall | undefined;
@@ -42,9 +35,7 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
42
35
  arguments: string;
43
36
  };
44
37
  };
45
- declare function makeInvalidToolCall(
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
- rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
38
+ declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
48
39
  /**
49
40
  * Class for parsing the output of a tool-calling LLM into a JSON object.
50
41
  */
@@ -63,40 +54,27 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
63
54
  * @param generations The output of the LLM to parse.
64
55
  * @returns A JSON object representation of the function call or its arguments.
65
56
  */
66
- parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- ): Promise<any>;
57
+ parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;
69
58
  }
70
59
  type JsonOutputKeyToolsParserParamsBase = {
71
60
  keyName: string;
72
61
  returnSingle?: boolean;
73
62
  } & JsonOutputToolsParserParams;
74
- type JsonOutputKeyToolsParserParamsV3<
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
- T extends Record<string, any> = Record<string, any>> = {
63
+ type JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {
77
64
  zodSchema?: z3.ZodType<T>;
78
65
  } & JsonOutputKeyToolsParserParamsBase;
79
- type JsonOutputKeyToolsParserParamsV4<
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
- T extends Record<string, any> = Record<string, any>> = {
66
+ type JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {
82
67
  zodSchema?: z4.$ZodType<T, T>;
83
68
  } & JsonOutputKeyToolsParserParamsBase;
84
- type JsonOutputKeyToolsParserParamsInterop<
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- T extends Record<string, any> = Record<string, any>> = {
69
+ type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {
87
70
  zodSchema?: InteropZodType<T>;
88
71
  } & JsonOutputKeyToolsParserParamsBase;
89
- // Use Zod 3 for backwards compatibility
90
- type JsonOutputKeyToolsParserParams<
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
72
+ type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
93
73
  /**
94
74
  * Class for parsing the output of a tool-calling LLM into a JSON object if you are
95
75
  * expecting only a single tool to be called.
96
76
  */
97
- declare class JsonOutputKeyToolsParser<
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
77
+ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
100
78
  static lc_name(): string;
101
79
  lc_namespace: string[];
102
80
  lc_serializable: boolean;
@@ -110,9 +88,7 @@ T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsPars
110
88
  constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
111
89
  constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
112
90
  protected _validateResult(result: unknown): Promise<T>;
113
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
91
  parsePartialResult(generations: ChatGeneration[]): Promise<any>;
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
92
  parseResult(generations: ChatGeneration[]): Promise<any>;
117
93
  }
118
94
  //#endregion
@@ -30,7 +30,6 @@ type BaseCumulativeTransformOutputParserInput = {
30
30
  declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
31
31
  protected diff: boolean;
32
32
  constructor(fields?: BaseCumulativeTransformOutputParserInput);
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
33
  protected abstract _diff(prev: any | undefined, next: any): any;
35
34
  abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
36
35
  _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
@@ -30,7 +30,6 @@ type BaseCumulativeTransformOutputParserInput = {
30
30
  declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
31
31
  protected diff: boolean;
32
32
  constructor(fields?: BaseCumulativeTransformOutputParserInput);
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
33
  protected abstract _diff(prev: any | undefined, next: any): any;
35
34
  abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
36
35
  _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
@@ -14,12 +14,10 @@ interface Generation {
14
14
  * Raw generation info response from the provider.
15
15
  * May include things like reason for finishing (e.g. in {@link OpenAI})
16
16
  */
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
17
  generationInfo?: Record<string, any>;
19
18
  }
20
19
  type GenerationChunkFields = {
21
20
  text: string;
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
21
  generationInfo?: Record<string, any>;
24
22
  };
25
23
  /**
@@ -27,7 +25,6 @@ type GenerationChunkFields = {
27
25
  */
28
26
  declare class GenerationChunk implements Generation {
29
27
  text: string;
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
28
  generationInfo?: Record<string, any>;
32
29
  constructor(fields: GenerationChunkFields);
33
30
  concat(chunk: GenerationChunk): GenerationChunk;
@@ -43,12 +40,10 @@ type LLMResult = {
43
40
  /**
44
41
  * Dictionary of arbitrary LLM-provider specific output.
45
42
  */
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
43
  llmOutput?: Record<string, any>;
48
44
  /**
49
45
  * Dictionary of run metadata
50
46
  */
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
47
  [RUN_KEY]?: Record<string, any>;
53
48
  };
54
49
  interface ChatGeneration extends Generation {
@@ -64,7 +59,6 @@ declare class ChatGenerationChunk extends GenerationChunk implements ChatGenerat
64
59
  }
65
60
  interface ChatResult {
66
61
  generations: ChatGeneration[];
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
62
  llmOutput?: Record<string, any>;
69
63
  }
70
64
  //#endregion
package/dist/outputs.d.ts CHANGED
@@ -14,12 +14,10 @@ interface Generation {
14
14
  * Raw generation info response from the provider.
15
15
  * May include things like reason for finishing (e.g. in {@link OpenAI})
16
16
  */
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
17
  generationInfo?: Record<string, any>;
19
18
  }
20
19
  type GenerationChunkFields = {
21
20
  text: string;
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
21
  generationInfo?: Record<string, any>;
24
22
  };
25
23
  /**
@@ -27,7 +25,6 @@ type GenerationChunkFields = {
27
25
  */
28
26
  declare class GenerationChunk implements Generation {
29
27
  text: string;
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
28
  generationInfo?: Record<string, any>;
32
29
  constructor(fields: GenerationChunkFields);
33
30
  concat(chunk: GenerationChunk): GenerationChunk;
@@ -43,12 +40,10 @@ type LLMResult = {
43
40
  /**
44
41
  * Dictionary of arbitrary LLM-provider specific output.
45
42
  */
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
43
  llmOutput?: Record<string, any>;
48
44
  /**
49
45
  * Dictionary of run metadata
50
46
  */
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
47
  [RUN_KEY]?: Record<string, any>;
53
48
  };
54
49
  interface ChatGeneration extends Generation {
@@ -64,7 +59,6 @@ declare class ChatGenerationChunk extends GenerationChunk implements ChatGenerat
64
59
  }
65
60
  interface ChatResult {
66
61
  generations: ChatGeneration[];
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
62
  llmOutput?: Record<string, any>;
69
63
  }
70
64
  //#endregion
@@ -11,11 +11,7 @@ type Example = Record<string, string>;
11
11
  /**
12
12
  * Input common to all prompt templates.
13
13
  */
14
- interface BasePromptTemplateInput<
15
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- InputVariables extends InputValues = any,
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- PartialVariableName extends string = any> {
14
+ interface BasePromptTemplateInput<InputVariables extends InputValues = any, PartialVariableName extends string = any> {
19
15
  /**
20
16
  * A list of variable names the prompt template expects
21
17
  */
@@ -31,11 +27,7 @@ PartialVariableName extends string = any> {
31
27
  * Base class for prompt templates. Exposes a format method that returns a
32
28
  * string prompt given a set of input values.
33
29
  */
34
- declare abstract class BasePromptTemplate<
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface,
37
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
- PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
30
+ declare abstract class BasePromptTemplate<RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface, PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
39
31
  PromptValueReturnType: RunOutput;
40
32
  lc_serializable: boolean;
41
33
  lc_namespace: string[];
@@ -12,11 +12,7 @@ type Example = Record<string, string>;
12
12
  /**
13
13
  * Input common to all prompt templates.
14
14
  */
15
- interface BasePromptTemplateInput<
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- InputVariables extends InputValues = any,
18
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
- PartialVariableName extends string = any> {
15
+ interface BasePromptTemplateInput<InputVariables extends InputValues = any, PartialVariableName extends string = any> {
20
16
  /**
21
17
  * A list of variable names the prompt template expects
22
18
  */
@@ -32,11 +28,7 @@ PartialVariableName extends string = any> {
32
28
  * Base class for prompt templates. Exposes a format method that returns a
33
29
  * string prompt given a set of input values.
34
30
  */
35
- declare abstract class BasePromptTemplate<
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
- RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface,
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
- PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
31
+ declare abstract class BasePromptTemplate<RunInput extends InputValues = any, RunOutput extends BasePromptValueInterface = BasePromptValueInterface, PartialVariableName extends string = any> extends Runnable<RunInput, RunOutput> implements BasePromptTemplateInput {
40
32
  PromptValueReturnType: RunOutput;
41
33
  lc_serializable: boolean;
42
34
  lc_namespace: string[];
@@ -1,10 +1,10 @@
1
1
  const require_base = require('../messages/base.cjs');
2
- const require_ai = require('../messages/ai.cjs');
2
+ const require_index = require('../errors/index.cjs');
3
3
  const require_chat = require('../messages/chat.cjs');
4
4
  const require_human = require('../messages/human.cjs');
5
5
  const require_system = require('../messages/system.cjs');
6
- const require_index = require('../errors/index.cjs');
7
6
  const require_utils = require('../messages/utils.cjs');
7
+ const require_ai = require('../messages/ai.cjs');
8
8
  const require_base$1 = require('../runnables/base.cjs');
9
9
  require('../messages/index.cjs');
10
10
  const require_prompt_values = require('../prompt_values.cjs');
@@ -21,9 +21,7 @@ import { DictPromptTemplate } from "./dict.cjs";
21
21
  * templates. It defines how to format messages for different roles in a
22
22
  * conversation.
23
23
  */
24
- declare abstract class BaseMessagePromptTemplate<
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends Runnable<RunInput, RunOutput> {
24
+ declare abstract class BaseMessagePromptTemplate<RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends Runnable<RunInput, RunOutput> {
27
25
  lc_namespace: string[];
28
26
  lc_serializable: boolean;
29
27
  abstract inputVariables: Array<Extract<keyof RunInput, string>>;
@@ -53,9 +51,7 @@ interface MessagesPlaceholderFields<T extends string> {
53
51
  * Class that represents a placeholder for messages in a chat prompt. It
54
52
  * extends the BaseMessagePromptTemplate.
55
53
  */
56
- declare class MessagesPlaceholder<
57
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
- RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> implements MessagesPlaceholderFields<Extract<keyof RunInput, string>> {
54
+ declare class MessagesPlaceholder<RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> implements MessagesPlaceholderFields<Extract<keyof RunInput, string>> {
59
55
  static lc_name(): string;
60
56
  variableName: Extract<keyof RunInput, string>;
61
57
  optional: boolean;
@@ -67,18 +63,14 @@ RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput>
67
63
  /**
68
64
  * Interface for the fields of a MessageStringPromptTemplate.
69
65
  */
70
- interface MessageStringPromptTemplateFields<
71
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
- T extends InputValues = any> {
66
+ interface MessageStringPromptTemplateFields<T extends InputValues = any> {
73
67
  prompt: BaseStringPromptTemplate<T, string>;
74
68
  }
75
69
  /**
76
70
  * Abstract class that serves as a base for creating message string prompt
77
71
  * templates. It extends the BaseMessagePromptTemplate.
78
72
  */
79
- declare abstract class BaseMessageStringPromptTemplate<
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
- RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> {
73
+ declare abstract class BaseMessageStringPromptTemplate<RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput> {
82
74
  prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string>;
83
75
  constructor(prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>>);
84
76
  constructor(fields: MessageStringPromptTemplateFields<InputValues<Extract<keyof RunInput, string>>>);
@@ -90,11 +82,7 @@ RunInput extends InputValues = any> extends BaseMessagePromptTemplate<RunInput>
90
82
  * Abstract class that serves as a base for creating chat prompt
91
83
  * templates. It extends the BasePromptTemplate.
92
84
  */
93
- declare abstract class BaseChatPromptTemplate<
94
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
- RunInput extends InputValues = any,
96
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
- PartialVariableName extends string = any> extends BasePromptTemplate<RunInput, ChatPromptValueInterface, PartialVariableName> {
85
+ declare abstract class BaseChatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends BasePromptTemplate<RunInput, ChatPromptValueInterface, PartialVariableName> {
98
86
  constructor(input: BasePromptTemplateInput<RunInput, PartialVariableName>);
99
87
  abstract formatMessages(values: TypedPromptInputValues<RunInput>): Promise<BaseMessage[]>;
100
88
  format(values: TypedPromptInputValues<RunInput>): Promise<string>;
@@ -103,7 +91,6 @@ PartialVariableName extends string = any> extends BasePromptTemplate<RunInput, C
103
91
  /**
104
92
  * Interface for the fields of a ChatMessagePromptTemplate.
105
93
  */
106
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
94
  interface ChatMessagePromptTemplateFields<T extends InputValues = any> extends MessageStringPromptTemplateFields<T> {
108
95
  role: string;
109
96
  }
@@ -111,9 +98,7 @@ interface ChatMessagePromptTemplateFields<T extends InputValues = any> extends M
111
98
  * Class that represents a chat message prompt template. It extends the
112
99
  * BaseMessageStringPromptTemplate.
113
100
  */
114
- declare class ChatMessagePromptTemplate<
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
- RunInput extends InputValues = any> extends BaseMessageStringPromptTemplate<RunInput> {
101
+ declare class ChatMessagePromptTemplate<RunInput extends InputValues = any> extends BaseMessageStringPromptTemplate<RunInput> {
117
102
  static lc_name(): string;
118
103
  role: string;
119
104
  constructor(prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>>, role: string);
@@ -124,11 +109,9 @@ RunInput extends InputValues = any> extends BaseMessageStringPromptTemplate<RunI
124
109
  }): ChatMessagePromptTemplate<ExtractedFStringParams<T, RunInput>>;
125
110
  }
126
111
  interface _TextTemplateParam {
127
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
112
  text?: string | Record<string, any>;
129
113
  }
130
114
  interface _ImageTemplateParam {
131
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
132
115
  image_url?: string | Record<string, any>;
133
116
  }
134
117
  type MessageClass = typeof HumanMessage | typeof AIMessage | typeof SystemMessage;
@@ -136,9 +119,7 @@ type ChatMessageClass = typeof ChatMessage;
136
119
  interface _StringImageMessagePromptTemplateOptions<Format extends TemplateFormat = TemplateFormat> extends Record<string, unknown> {
137
120
  templateFormat?: Format;
138
121
  }
139
- declare class _StringImageMessagePromptTemplate<
140
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
141
- RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends BaseMessagePromptTemplate<RunInput, RunOutput> {
122
+ declare class _StringImageMessagePromptTemplate<RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessage[]> extends BaseMessagePromptTemplate<RunInput, RunOutput> {
142
123
  lc_namespace: string[];
143
124
  lc_serializable: boolean;
144
125
  inputVariables: Array<Extract<keyof RunInput, string>>;
@@ -146,11 +127,8 @@ RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessag
146
127
  prompt: BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | Array<BaseStringPromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | ImagePromptTemplate<InputValues<Extract<keyof RunInput, string>>, string> | MessageStringPromptTemplateFields<InputValues<Extract<keyof RunInput, string>>> | DictPromptTemplate<InputValues<Extract<keyof RunInput, string>>>>;
147
128
  protected messageClass?: MessageClass;
148
129
  static _messageClass(): MessageClass;
149
- // ChatMessage contains role field, others don't.
150
- // Because of this, we have a separate class property for ChatMessage.
151
130
  protected chatMessageClass?: ChatMessageClass;
152
131
  constructor(/** @TODO When we come up with a better way to type prompt templates, fix this */
153
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
132
  fields: any, additionalOptions?: _StringImageMessagePromptTemplateOptions);
155
133
  createMessage(content: MessageContent): any;
156
134
  getRoleFromMessageClass(name: string): "ai" | "chat" | "human" | "system";
@@ -172,9 +150,7 @@ RunInput extends InputValues = any, RunOutput extends BaseMessage[] = BaseMessag
172
150
  * });
173
151
  * ```
174
152
  */
175
- declare class HumanMessagePromptTemplate<
176
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
177
- RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
153
+ declare class HumanMessagePromptTemplate<RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
178
154
  static _messageClass(): typeof HumanMessage;
179
155
  static lc_name(): string;
180
156
  }
@@ -182,9 +158,7 @@ RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<Ru
182
158
  * Class that represents an AI message prompt template. It extends the
183
159
  * BaseMessageStringPromptTemplate.
184
160
  */
185
- declare class AIMessagePromptTemplate<
186
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
187
- RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
161
+ declare class AIMessagePromptTemplate<RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
188
162
  static _messageClass(): typeof AIMessage;
189
163
  static lc_name(): string;
190
164
  }
@@ -202,20 +176,14 @@ RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<Ru
202
176
  * });
203
177
  * ```
204
178
  */
205
- declare class SystemMessagePromptTemplate<
206
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
207
- RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
179
+ declare class SystemMessagePromptTemplate<RunInput extends InputValues = any> extends _StringImageMessagePromptTemplate<RunInput> {
208
180
  static _messageClass(): typeof SystemMessage;
209
181
  static lc_name(): string;
210
182
  }
211
183
  /**
212
184
  * Interface for the input of a ChatPromptTemplate.
213
185
  */
214
- interface ChatPromptTemplateInput<
215
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
- RunInput extends InputValues = any,
217
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
- PartialVariableName extends string = any> extends BasePromptTemplateInput<RunInput, PartialVariableName> {
186
+ interface ChatPromptTemplateInput<RunInput extends InputValues = any, PartialVariableName extends string = any> extends BasePromptTemplateInput<RunInput, PartialVariableName> {
219
187
  /**
220
188
  * The prompt messages
221
189
  */
@@ -249,11 +217,7 @@ type BaseMessagePromptTemplateLike = BaseMessagePromptTemplate | BaseMessageLike
249
217
  * });
250
218
  * ```
251
219
  */
252
- declare class ChatPromptTemplate<
253
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
254
- RunInput extends InputValues = any,
255
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
256
- PartialVariableName extends string = any> extends BaseChatPromptTemplate<RunInput, PartialVariableName> implements ChatPromptTemplateInput<RunInput, PartialVariableName> {
220
+ declare class ChatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends BaseChatPromptTemplate<RunInput, PartialVariableName> implements ChatPromptTemplateInput<RunInput, PartialVariableName> {
257
221
  static lc_name(): string;
258
222
  get lc_aliases(): Record<string, string>;
259
223
  promptMessages: Array<BaseMessagePromptTemplate | BaseMessage>;
@@ -276,9 +240,7 @@ PartialVariableName extends string = any> extends BaseChatPromptTemplate<RunInpu
276
240
  * @param promptMessages Messages to be passed to the chat model
277
241
  * @returns A new ChatPromptTemplate
278
242
  */
279
- static fromMessages<
280
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
281
- RunInput extends InputValues = any, Extra extends ChatPromptTemplateInput<RunInput> = ChatPromptTemplateInput<RunInput>>(promptMessages: (ChatPromptTemplate<InputValues, string> | BaseMessagePromptTemplateLike)[], extra?: Omit<Extra, "inputVariables" | "promptMessages" | "partialVariables">): ChatPromptTemplate<RunInput>;
243
+ static fromMessages<RunInput extends InputValues = any, Extra extends ChatPromptTemplateInput<RunInput> = ChatPromptTemplateInput<RunInput>>(promptMessages: (ChatPromptTemplate<InputValues, string> | BaseMessagePromptTemplateLike)[], extra?: Omit<Extra, "inputVariables" | "promptMessages" | "partialVariables">): ChatPromptTemplate<RunInput>;
282
244
  }
283
245
  //#endregion
284
246
  export { AIMessagePromptTemplate, BaseChatPromptTemplate, BaseMessagePromptTemplate, BaseMessagePromptTemplateLike, BaseMessageStringPromptTemplate, ChatMessagePromptTemplate, ChatMessagePromptTemplateFields, ChatPromptTemplate, ChatPromptTemplateInput, HumanMessagePromptTemplate, MessageStringPromptTemplateFields, MessagesPlaceholder, MessagesPlaceholderFields, SystemMessagePromptTemplate };