@langchain/core 1.0.6 → 1.1.1

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 (698) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/agents.cjs +1 -0
  3. package/agents.d.cts +1 -0
  4. package/agents.d.ts +1 -0
  5. package/agents.js +1 -0
  6. package/caches.cjs +1 -0
  7. package/caches.d.cts +1 -0
  8. package/caches.d.ts +1 -0
  9. package/caches.js +1 -0
  10. package/callbacks/base.cjs +1 -0
  11. package/callbacks/base.d.cts +1 -0
  12. package/callbacks/base.d.ts +1 -0
  13. package/callbacks/base.js +1 -0
  14. package/callbacks/dispatch/web.cjs +1 -0
  15. package/callbacks/dispatch/web.d.cts +1 -0
  16. package/callbacks/dispatch/web.d.ts +1 -0
  17. package/callbacks/dispatch/web.js +1 -0
  18. package/callbacks/dispatch.cjs +1 -0
  19. package/callbacks/dispatch.d.cts +1 -0
  20. package/callbacks/dispatch.d.ts +1 -0
  21. package/callbacks/dispatch.js +1 -0
  22. package/callbacks/manager.cjs +1 -0
  23. package/callbacks/manager.d.cts +1 -0
  24. package/callbacks/manager.d.ts +1 -0
  25. package/callbacks/manager.js +1 -0
  26. package/callbacks/promises.cjs +1 -0
  27. package/callbacks/promises.d.cts +1 -0
  28. package/callbacks/promises.d.ts +1 -0
  29. package/callbacks/promises.js +1 -0
  30. package/chat_history.cjs +1 -0
  31. package/chat_history.d.cts +1 -0
  32. package/chat_history.d.ts +1 -0
  33. package/chat_history.js +1 -0
  34. package/context.cjs +1 -0
  35. package/context.d.cts +1 -0
  36. package/context.d.ts +1 -0
  37. package/context.js +1 -0
  38. package/dist/caches/{base.cjs → index.cjs} +6 -6
  39. package/dist/caches/index.cjs.map +1 -0
  40. package/dist/caches/{base.d.cts → index.d.cts} +2 -2
  41. package/dist/caches/{base.d.ts → index.d.ts} +2 -2
  42. package/dist/caches/{base.js → index.js} +5 -5
  43. package/dist/caches/index.js.map +1 -0
  44. package/dist/callbacks/dispatch/index.d.ts +1 -0
  45. package/dist/callbacks/dispatch/web.d.ts +1 -0
  46. package/dist/chat_history.d.ts +1 -0
  47. package/dist/language_models/base.cjs +2 -2
  48. package/dist/language_models/base.cjs.map +1 -1
  49. package/dist/language_models/base.d.cts +1 -1
  50. package/dist/language_models/base.d.ts +3 -1
  51. package/dist/language_models/base.js +1 -1
  52. package/dist/language_models/base.js.map +1 -1
  53. package/dist/language_models/chat_models.cjs.map +1 -1
  54. package/dist/language_models/chat_models.d.cts +1 -1
  55. package/dist/language_models/chat_models.d.ts +4 -1
  56. package/dist/language_models/chat_models.js.map +1 -1
  57. package/dist/language_models/llms.cjs.map +1 -1
  58. package/dist/language_models/llms.d.cts +1 -1
  59. package/dist/language_models/llms.d.ts +2 -1
  60. package/dist/language_models/llms.js.map +1 -1
  61. package/dist/load/import_constants.cjs +1 -0
  62. package/dist/load/import_constants.cjs.map +1 -1
  63. package/dist/load/import_constants.js +1 -0
  64. package/dist/load/import_constants.js.map +1 -1
  65. package/dist/load/import_map.cjs +12 -12
  66. package/dist/load/import_map.cjs.map +1 -1
  67. package/dist/load/import_map.js +16 -16
  68. package/dist/load/import_map.js.map +1 -1
  69. package/dist/messages/base.cjs +10 -3
  70. package/dist/messages/base.cjs.map +1 -1
  71. package/dist/messages/base.js +10 -3
  72. package/dist/messages/base.js.map +1 -1
  73. package/dist/messages/message.d.cts +1 -1
  74. package/dist/messages/message.d.ts +1 -1
  75. package/dist/messages/system.cjs +25 -1
  76. package/dist/messages/system.cjs.map +1 -1
  77. package/dist/messages/system.d.cts +6 -0
  78. package/dist/messages/system.d.ts +6 -0
  79. package/dist/messages/system.js +25 -1
  80. package/dist/messages/system.js.map +1 -1
  81. package/dist/messages/transformers.d.cts +2 -1
  82. package/dist/messages/transformers.d.ts +2 -1
  83. package/dist/messages/utils.d.cts +8 -8
  84. package/dist/messages/utils.d.ts +8 -8
  85. package/dist/output_parsers/base.d.ts +3 -0
  86. package/dist/output_parsers/index.cjs +1 -1
  87. package/dist/output_parsers/index.js +1 -1
  88. package/dist/output_parsers/list.d.ts +1 -0
  89. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
  90. package/dist/output_parsers/string.d.ts +1 -0
  91. package/dist/prompts/base.d.ts +1 -0
  92. package/dist/prompts/chat.d.ts +1 -0
  93. package/dist/prompts/few_shot.d.ts +1 -0
  94. package/dist/prompts/image.d.ts +1 -0
  95. package/dist/prompts/prompt.d.ts +1 -0
  96. package/dist/prompts/serde.d.ts +1 -0
  97. package/dist/prompts/structured.d.ts +1 -1
  98. package/dist/prompts/template.d.ts +1 -1
  99. package/dist/retrievers/document_compressors/{base.cjs → index.cjs} +6 -6
  100. package/dist/retrievers/document_compressors/index.cjs.map +1 -0
  101. package/dist/retrievers/document_compressors/{base.d.cts → index.d.cts} +2 -2
  102. package/dist/retrievers/document_compressors/{base.d.ts → index.d.ts} +2 -2
  103. package/dist/retrievers/document_compressors/index.js +17 -0
  104. package/dist/retrievers/document_compressors/index.js.map +1 -0
  105. package/dist/retrievers/index.d.ts +1 -0
  106. package/dist/runnables/base.cjs +2 -2
  107. package/dist/runnables/base.cjs.map +1 -1
  108. package/dist/runnables/base.d.cts +0 -17
  109. package/dist/runnables/base.d.ts +0 -17
  110. package/dist/runnables/base.js +2 -2
  111. package/dist/runnables/base.js.map +1 -1
  112. package/dist/runnables/branch.d.ts +1 -0
  113. package/dist/runnables/history.d.ts +2 -0
  114. package/dist/runnables/index.cjs +4 -1
  115. package/dist/runnables/index.cjs.map +1 -1
  116. package/dist/runnables/index.d.cts +2 -1
  117. package/dist/runnables/index.d.ts +2 -1
  118. package/dist/runnables/index.js +4 -2
  119. package/dist/runnables/index.js.map +1 -1
  120. package/dist/runnables/passthrough.d.ts +1 -0
  121. package/dist/runnables/router.d.ts +1 -0
  122. package/dist/tools/index.cjs +9 -1
  123. package/dist/tools/index.cjs.map +1 -1
  124. package/dist/tools/index.d.cts +7 -0
  125. package/dist/tools/index.d.ts +9 -0
  126. package/dist/tools/index.js +10 -2
  127. package/dist/tools/index.js.map +1 -1
  128. package/dist/tools/types.cjs.map +1 -1
  129. package/dist/tools/types.d.cts +15 -14
  130. package/dist/tools/types.d.ts +17 -14
  131. package/dist/tools/types.js.map +1 -1
  132. package/dist/tracers/event_stream.d.ts +1 -0
  133. package/dist/utils/async_caller.cjs +9 -4
  134. package/dist/utils/async_caller.cjs.map +1 -1
  135. package/dist/utils/async_caller.js +8 -3
  136. package/dist/utils/async_caller.js.map +1 -1
  137. package/dist/utils/fast-json-patch/src/core.d.cts +0 -18
  138. package/dist/utils/fast-json-patch/src/core.d.ts +0 -18
  139. package/dist/utils/json_schema.d.cts +0 -5
  140. package/dist/utils/json_schema.d.ts +1 -5
  141. package/dist/utils/signal.d.cts +13 -0
  142. package/dist/utils/signal.d.ts +13 -0
  143. package/dist/utils/testing/chat_models.d.ts +1 -0
  144. package/dist/utils/testing/message_history.d.ts +1 -0
  145. package/dist/utils/types/index.cjs +2 -0
  146. package/dist/utils/types/index.d.cts +2 -2
  147. package/dist/utils/types/index.d.ts +2 -2
  148. package/dist/utils/types/index.js +3 -2
  149. package/dist/utils/types/zod.cjs +4 -0
  150. package/dist/utils/types/zod.cjs.map +1 -1
  151. package/dist/utils/types/zod.d.cts +3 -2
  152. package/dist/utils/types/zod.d.ts +3 -2
  153. package/dist/utils/types/zod.js +4 -1
  154. package/dist/utils/types/zod.js.map +1 -1
  155. package/dist/utils/zod-to-json-schema/Options.d.ts +3 -0
  156. package/dist/utils/zod-to-json-schema/Refs.d.ts +3 -0
  157. package/dist/utils/zod-to-json-schema/errorMessages.d.ts +1 -0
  158. package/dist/utils/zod-to-json-schema/index.d.ts +37 -0
  159. package/dist/utils/zod-to-json-schema/parseDef.d.ts +3 -0
  160. package/dist/utils/zod-to-json-schema/parsers/any.d.ts +2 -0
  161. package/dist/utils/zod-to-json-schema/parsers/array.d.ts +1 -0
  162. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +1 -0
  163. package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +3 -0
  164. package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +3 -0
  165. package/dist/utils/zod-to-json-schema/parsers/date.d.ts +2 -0
  166. package/dist/utils/zod-to-json-schema/parsers/default.d.ts +3 -0
  167. package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +3 -0
  168. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +1 -0
  169. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +1 -0
  170. package/dist/utils/zod-to-json-schema/parsers/map.d.ts +2 -0
  171. package/dist/utils/zod-to-json-schema/parsers/never.d.ts +1 -0
  172. package/dist/utils/zod-to-json-schema/parsers/null.d.ts +2 -0
  173. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +1 -0
  174. package/dist/utils/zod-to-json-schema/parsers/number.d.ts +1 -0
  175. package/dist/utils/zod-to-json-schema/parsers/object.d.ts +1 -0
  176. package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +3 -0
  177. package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +4 -0
  178. package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +3 -0
  179. package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +3 -0
  180. package/dist/utils/zod-to-json-schema/parsers/record.d.ts +1 -0
  181. package/dist/utils/zod-to-json-schema/parsers/set.d.ts +1 -0
  182. package/dist/utils/zod-to-json-schema/parsers/string.d.ts +1 -0
  183. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +1 -0
  184. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +1 -0
  185. package/dist/utils/zod-to-json-schema/parsers/union.d.ts +2 -1
  186. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +1 -0
  187. package/dist/utils/zod-to-json-schema/selectParser.d.ts +3 -0
  188. package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +3 -0
  189. package/document_loaders/base.cjs +1 -0
  190. package/document_loaders/base.d.cts +1 -0
  191. package/document_loaders/base.d.ts +1 -0
  192. package/document_loaders/base.js +1 -0
  193. package/document_loaders/langsmith.cjs +1 -0
  194. package/document_loaders/langsmith.d.cts +1 -0
  195. package/document_loaders/langsmith.d.ts +1 -0
  196. package/document_loaders/langsmith.js +1 -0
  197. package/documents.cjs +1 -0
  198. package/documents.d.cts +1 -0
  199. package/documents.d.ts +1 -0
  200. package/documents.js +1 -0
  201. package/embeddings.cjs +1 -0
  202. package/embeddings.d.cts +1 -0
  203. package/embeddings.d.ts +1 -0
  204. package/embeddings.js +1 -0
  205. package/example_selectors.cjs +1 -0
  206. package/example_selectors.d.cts +1 -0
  207. package/example_selectors.d.ts +1 -0
  208. package/example_selectors.js +1 -0
  209. package/indexing.cjs +1 -0
  210. package/indexing.d.cts +1 -0
  211. package/indexing.d.ts +1 -0
  212. package/indexing.js +1 -0
  213. package/language_models/base.cjs +1 -0
  214. package/language_models/base.d.cts +1 -0
  215. package/language_models/base.d.ts +1 -0
  216. package/language_models/base.js +1 -0
  217. package/language_models/chat_models.cjs +1 -0
  218. package/language_models/chat_models.d.cts +1 -0
  219. package/language_models/chat_models.d.ts +1 -0
  220. package/language_models/chat_models.js +1 -0
  221. package/language_models/llms.cjs +1 -0
  222. package/language_models/llms.d.cts +1 -0
  223. package/language_models/llms.d.ts +1 -0
  224. package/language_models/llms.js +1 -0
  225. package/language_models/profile.cjs +1 -0
  226. package/language_models/profile.d.cts +1 -0
  227. package/language_models/profile.d.ts +1 -0
  228. package/language_models/profile.js +1 -0
  229. package/load/serializable.cjs +1 -0
  230. package/load/serializable.d.cts +1 -0
  231. package/load/serializable.d.ts +1 -0
  232. package/load/serializable.js +1 -0
  233. package/load.cjs +1 -0
  234. package/load.d.cts +1 -0
  235. package/load.d.ts +1 -0
  236. package/load.js +1 -0
  237. package/memory.cjs +1 -0
  238. package/memory.d.cts +1 -0
  239. package/memory.d.ts +1 -0
  240. package/memory.js +1 -0
  241. package/messages/tool.cjs +1 -0
  242. package/messages/tool.d.cts +1 -0
  243. package/messages/tool.d.ts +1 -0
  244. package/messages/tool.js +1 -0
  245. package/messages.cjs +1 -0
  246. package/messages.d.cts +1 -0
  247. package/messages.d.ts +1 -0
  248. package/messages.js +1 -0
  249. package/output_parsers/openai_functions.cjs +1 -0
  250. package/output_parsers/openai_functions.d.cts +1 -0
  251. package/output_parsers/openai_functions.d.ts +1 -0
  252. package/output_parsers/openai_functions.js +1 -0
  253. package/output_parsers/openai_tools.cjs +1 -0
  254. package/output_parsers/openai_tools.d.cts +1 -0
  255. package/output_parsers/openai_tools.d.ts +1 -0
  256. package/output_parsers/openai_tools.js +1 -0
  257. package/output_parsers.cjs +1 -0
  258. package/output_parsers.d.cts +1 -0
  259. package/output_parsers.d.ts +1 -0
  260. package/output_parsers.js +1 -0
  261. package/outputs.cjs +1 -0
  262. package/outputs.d.cts +1 -0
  263. package/outputs.d.ts +1 -0
  264. package/outputs.js +1 -0
  265. package/package.json +163 -63
  266. package/prompt_values.cjs +1 -0
  267. package/prompt_values.d.cts +1 -0
  268. package/prompt_values.d.ts +1 -0
  269. package/prompt_values.js +1 -0
  270. package/prompts.cjs +1 -0
  271. package/prompts.d.cts +1 -0
  272. package/prompts.d.ts +1 -0
  273. package/prompts.js +1 -0
  274. package/retrievers/document_compressors.cjs +1 -0
  275. package/retrievers/document_compressors.d.cts +1 -0
  276. package/retrievers/document_compressors.d.ts +1 -0
  277. package/retrievers/document_compressors.js +1 -0
  278. package/retrievers.cjs +1 -0
  279. package/retrievers.d.cts +1 -0
  280. package/retrievers.d.ts +1 -0
  281. package/retrievers.js +1 -0
  282. package/runnables/graph.cjs +1 -0
  283. package/runnables/graph.d.cts +1 -0
  284. package/runnables/graph.d.ts +1 -0
  285. package/runnables/graph.js +1 -0
  286. package/runnables.cjs +1 -0
  287. package/runnables.d.cts +1 -0
  288. package/runnables.d.ts +1 -0
  289. package/runnables.js +1 -0
  290. package/singletons.cjs +1 -0
  291. package/singletons.d.cts +1 -0
  292. package/singletons.d.ts +1 -0
  293. package/singletons.js +1 -0
  294. package/stores.cjs +1 -0
  295. package/stores.d.cts +1 -0
  296. package/stores.d.ts +1 -0
  297. package/stores.js +1 -0
  298. package/structured_query.cjs +1 -0
  299. package/structured_query.d.cts +1 -0
  300. package/structured_query.d.ts +1 -0
  301. package/structured_query.js +1 -0
  302. package/tools.cjs +1 -0
  303. package/tools.d.cts +1 -0
  304. package/tools.d.ts +1 -0
  305. package/tools.js +1 -0
  306. package/tracers/base.cjs +1 -0
  307. package/tracers/base.d.cts +1 -0
  308. package/tracers/base.d.ts +1 -0
  309. package/tracers/base.js +1 -0
  310. package/tracers/console.cjs +1 -0
  311. package/tracers/console.d.cts +1 -0
  312. package/tracers/console.d.ts +1 -0
  313. package/tracers/console.js +1 -0
  314. package/tracers/log_stream.cjs +1 -0
  315. package/tracers/log_stream.d.cts +1 -0
  316. package/tracers/log_stream.d.ts +1 -0
  317. package/tracers/log_stream.js +1 -0
  318. package/tracers/run_collector.cjs +1 -0
  319. package/tracers/run_collector.d.cts +1 -0
  320. package/tracers/run_collector.d.ts +1 -0
  321. package/tracers/run_collector.js +1 -0
  322. package/tracers/tracer_langchain.cjs +1 -0
  323. package/tracers/tracer_langchain.d.cts +1 -0
  324. package/tracers/tracer_langchain.d.ts +1 -0
  325. package/tracers/tracer_langchain.js +1 -0
  326. package/types/stream.cjs +1 -0
  327. package/types/stream.d.cts +1 -0
  328. package/types/stream.d.ts +1 -0
  329. package/types/stream.js +1 -0
  330. package/utils/async_caller.cjs +1 -0
  331. package/utils/async_caller.d.cts +1 -0
  332. package/utils/async_caller.d.ts +1 -0
  333. package/utils/async_caller.js +1 -0
  334. package/utils/chunk_array.cjs +1 -0
  335. package/utils/chunk_array.d.cts +1 -0
  336. package/utils/chunk_array.d.ts +1 -0
  337. package/utils/chunk_array.js +1 -0
  338. package/utils/env.cjs +1 -0
  339. package/utils/env.d.cts +1 -0
  340. package/utils/env.d.ts +1 -0
  341. package/utils/env.js +1 -0
  342. package/utils/event_source_parse.cjs +1 -0
  343. package/utils/event_source_parse.d.cts +1 -0
  344. package/utils/event_source_parse.d.ts +1 -0
  345. package/utils/event_source_parse.js +1 -0
  346. package/utils/format.cjs +1 -0
  347. package/utils/format.d.cts +1 -0
  348. package/utils/format.d.ts +1 -0
  349. package/utils/format.js +1 -0
  350. package/utils/function_calling.cjs +1 -0
  351. package/utils/function_calling.d.cts +1 -0
  352. package/utils/function_calling.d.ts +1 -0
  353. package/utils/function_calling.js +1 -0
  354. package/utils/hash.cjs +1 -0
  355. package/utils/hash.d.cts +1 -0
  356. package/utils/hash.d.ts +1 -0
  357. package/utils/hash.js +1 -0
  358. package/utils/json_patch.cjs +1 -0
  359. package/utils/json_patch.d.cts +1 -0
  360. package/utils/json_patch.d.ts +1 -0
  361. package/utils/json_patch.js +1 -0
  362. package/utils/json_schema.cjs +1 -0
  363. package/utils/json_schema.d.cts +1 -0
  364. package/utils/json_schema.d.ts +1 -0
  365. package/utils/json_schema.js +1 -0
  366. package/utils/math.cjs +1 -0
  367. package/utils/math.d.cts +1 -0
  368. package/utils/math.d.ts +1 -0
  369. package/utils/math.js +1 -0
  370. package/utils/stream.cjs +1 -0
  371. package/utils/stream.d.cts +1 -0
  372. package/utils/stream.d.ts +1 -0
  373. package/utils/stream.js +1 -0
  374. package/utils/testing.cjs +1 -0
  375. package/utils/testing.d.cts +1 -0
  376. package/utils/testing.d.ts +1 -0
  377. package/utils/testing.js +1 -0
  378. package/utils/tiktoken.cjs +1 -0
  379. package/utils/tiktoken.d.cts +1 -0
  380. package/utils/tiktoken.d.ts +1 -0
  381. package/utils/tiktoken.js +1 -0
  382. package/utils/types.cjs +1 -0
  383. package/utils/types.d.cts +1 -0
  384. package/utils/types.d.ts +1 -0
  385. package/utils/types.js +1 -0
  386. package/vectorstores.cjs +1 -0
  387. package/vectorstores.d.cts +1 -0
  388. package/vectorstores.d.ts +1 -0
  389. package/vectorstores.js +1 -0
  390. package/dist/agents.d.cts.map +0 -1
  391. package/dist/agents.d.ts.map +0 -1
  392. package/dist/caches/base.cjs.map +0 -1
  393. package/dist/caches/base.d.cts.map +0 -1
  394. package/dist/caches/base.d.ts.map +0 -1
  395. package/dist/caches/base.js.map +0 -1
  396. package/dist/callbacks/base.d.cts.map +0 -1
  397. package/dist/callbacks/base.d.ts.map +0 -1
  398. package/dist/callbacks/dispatch/index.d.cts.map +0 -1
  399. package/dist/callbacks/dispatch/index.d.ts.map +0 -1
  400. package/dist/callbacks/dispatch/web.d.cts.map +0 -1
  401. package/dist/callbacks/dispatch/web.d.ts.map +0 -1
  402. package/dist/callbacks/manager.d.cts.map +0 -1
  403. package/dist/callbacks/manager.d.ts.map +0 -1
  404. package/dist/chat_history.d.cts.map +0 -1
  405. package/dist/chat_history.d.ts.map +0 -1
  406. package/dist/context.d.cts.map +0 -1
  407. package/dist/context.d.ts.map +0 -1
  408. package/dist/document_loaders/base.d.cts.map +0 -1
  409. package/dist/document_loaders/base.d.ts.map +0 -1
  410. package/dist/document_loaders/langsmith.d.cts.map +0 -1
  411. package/dist/document_loaders/langsmith.d.ts.map +0 -1
  412. package/dist/documents/document.d.cts.map +0 -1
  413. package/dist/documents/document.d.ts.map +0 -1
  414. package/dist/documents/transformers.d.cts.map +0 -1
  415. package/dist/documents/transformers.d.ts.map +0 -1
  416. package/dist/embeddings.d.cts.map +0 -1
  417. package/dist/embeddings.d.ts.map +0 -1
  418. package/dist/example_selectors/base.d.cts.map +0 -1
  419. package/dist/example_selectors/base.d.ts.map +0 -1
  420. package/dist/example_selectors/conditional.d.cts.map +0 -1
  421. package/dist/example_selectors/conditional.d.ts.map +0 -1
  422. package/dist/example_selectors/length_based.d.cts.map +0 -1
  423. package/dist/example_selectors/length_based.d.ts.map +0 -1
  424. package/dist/example_selectors/semantic_similarity.d.cts.map +0 -1
  425. package/dist/example_selectors/semantic_similarity.d.ts.map +0 -1
  426. package/dist/indexing/base.d.cts.map +0 -1
  427. package/dist/indexing/base.d.ts.map +0 -1
  428. package/dist/indexing/record_manager.d.cts.map +0 -1
  429. package/dist/indexing/record_manager.d.ts.map +0 -1
  430. package/dist/language_models/base.d.cts.map +0 -1
  431. package/dist/language_models/base.d.ts.map +0 -1
  432. package/dist/language_models/chat_models.d.cts.map +0 -1
  433. package/dist/language_models/chat_models.d.ts.map +0 -1
  434. package/dist/language_models/llms.d.cts.map +0 -1
  435. package/dist/language_models/llms.d.ts.map +0 -1
  436. package/dist/language_models/profile.d.cts.map +0 -1
  437. package/dist/language_models/profile.d.ts.map +0 -1
  438. package/dist/load/import_type.d.cts.map +0 -1
  439. package/dist/load/import_type.d.ts.map +0 -1
  440. package/dist/load/index.d.cts.map +0 -1
  441. package/dist/load/index.d.ts.map +0 -1
  442. package/dist/load/map_keys.d.cts.map +0 -1
  443. package/dist/load/map_keys.d.ts.map +0 -1
  444. package/dist/load/serializable.d.cts.map +0 -1
  445. package/dist/load/serializable.d.ts.map +0 -1
  446. package/dist/memory.d.cts.map +0 -1
  447. package/dist/memory.d.ts.map +0 -1
  448. package/dist/messages/ai.d.cts.map +0 -1
  449. package/dist/messages/ai.d.ts.map +0 -1
  450. package/dist/messages/base.d.cts.map +0 -1
  451. package/dist/messages/base.d.ts.map +0 -1
  452. package/dist/messages/chat.d.cts.map +0 -1
  453. package/dist/messages/chat.d.ts.map +0 -1
  454. package/dist/messages/content/base.d.cts.map +0 -1
  455. package/dist/messages/content/base.d.ts.map +0 -1
  456. package/dist/messages/content/data.d.cts.map +0 -1
  457. package/dist/messages/content/data.d.ts.map +0 -1
  458. package/dist/messages/content/index.d.cts.map +0 -1
  459. package/dist/messages/content/index.d.ts.map +0 -1
  460. package/dist/messages/content/multimodal.d.cts.map +0 -1
  461. package/dist/messages/content/multimodal.d.ts.map +0 -1
  462. package/dist/messages/content/tools.d.cts.map +0 -1
  463. package/dist/messages/content/tools.d.ts.map +0 -1
  464. package/dist/messages/format.d.cts.map +0 -1
  465. package/dist/messages/format.d.ts.map +0 -1
  466. package/dist/messages/function.d.cts.map +0 -1
  467. package/dist/messages/function.d.ts.map +0 -1
  468. package/dist/messages/human.d.cts.map +0 -1
  469. package/dist/messages/human.d.ts.map +0 -1
  470. package/dist/messages/message.d.cts.map +0 -1
  471. package/dist/messages/message.d.ts.map +0 -1
  472. package/dist/messages/metadata.d.cts.map +0 -1
  473. package/dist/messages/metadata.d.ts.map +0 -1
  474. package/dist/messages/modifier.d.cts.map +0 -1
  475. package/dist/messages/modifier.d.ts.map +0 -1
  476. package/dist/messages/system.d.cts.map +0 -1
  477. package/dist/messages/system.d.ts.map +0 -1
  478. package/dist/messages/tool.d.cts.map +0 -1
  479. package/dist/messages/tool.d.ts.map +0 -1
  480. package/dist/messages/transformers.d.cts.map +0 -1
  481. package/dist/messages/transformers.d.ts.map +0 -1
  482. package/dist/messages/utils.d.cts.map +0 -1
  483. package/dist/messages/utils.d.ts.map +0 -1
  484. package/dist/output_parsers/base.d.cts.map +0 -1
  485. package/dist/output_parsers/base.d.ts.map +0 -1
  486. package/dist/output_parsers/bytes.d.cts.map +0 -1
  487. package/dist/output_parsers/bytes.d.ts.map +0 -1
  488. package/dist/output_parsers/json.d.cts.map +0 -1
  489. package/dist/output_parsers/json.d.ts.map +0 -1
  490. package/dist/output_parsers/list.d.cts.map +0 -1
  491. package/dist/output_parsers/list.d.ts.map +0 -1
  492. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts.map +0 -1
  493. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +0 -1
  494. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +0 -1
  495. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +0 -1
  496. package/dist/output_parsers/string.d.cts.map +0 -1
  497. package/dist/output_parsers/string.d.ts.map +0 -1
  498. package/dist/output_parsers/structured.d.cts.map +0 -1
  499. package/dist/output_parsers/structured.d.ts.map +0 -1
  500. package/dist/output_parsers/transform.d.cts.map +0 -1
  501. package/dist/output_parsers/transform.d.ts.map +0 -1
  502. package/dist/output_parsers/xml.d.cts.map +0 -1
  503. package/dist/output_parsers/xml.d.ts.map +0 -1
  504. package/dist/outputs.d.cts.map +0 -1
  505. package/dist/outputs.d.ts.map +0 -1
  506. package/dist/prompt_values.d.cts.map +0 -1
  507. package/dist/prompt_values.d.ts.map +0 -1
  508. package/dist/prompts/base.d.cts.map +0 -1
  509. package/dist/prompts/base.d.ts.map +0 -1
  510. package/dist/prompts/chat.d.cts.map +0 -1
  511. package/dist/prompts/chat.d.ts.map +0 -1
  512. package/dist/prompts/dict.d.cts.map +0 -1
  513. package/dist/prompts/dict.d.ts.map +0 -1
  514. package/dist/prompts/few_shot.d.cts.map +0 -1
  515. package/dist/prompts/few_shot.d.ts.map +0 -1
  516. package/dist/prompts/image.d.cts.map +0 -1
  517. package/dist/prompts/image.d.ts.map +0 -1
  518. package/dist/prompts/pipeline.d.cts.map +0 -1
  519. package/dist/prompts/pipeline.d.ts.map +0 -1
  520. package/dist/prompts/prompt.d.cts.map +0 -1
  521. package/dist/prompts/prompt.d.ts.map +0 -1
  522. package/dist/prompts/serde.d.cts.map +0 -1
  523. package/dist/prompts/serde.d.ts.map +0 -1
  524. package/dist/prompts/string.d.cts.map +0 -1
  525. package/dist/prompts/string.d.ts.map +0 -1
  526. package/dist/prompts/structured.d.cts.map +0 -1
  527. package/dist/prompts/structured.d.ts.map +0 -1
  528. package/dist/prompts/template.d.cts.map +0 -1
  529. package/dist/prompts/template.d.ts.map +0 -1
  530. package/dist/retrievers/document_compressors/base.cjs.map +0 -1
  531. package/dist/retrievers/document_compressors/base.d.cts.map +0 -1
  532. package/dist/retrievers/document_compressors/base.d.ts.map +0 -1
  533. package/dist/retrievers/document_compressors/base.js +0 -17
  534. package/dist/retrievers/document_compressors/base.js.map +0 -1
  535. package/dist/retrievers/index.d.cts.map +0 -1
  536. package/dist/retrievers/index.d.ts.map +0 -1
  537. package/dist/runnables/base.d.cts.map +0 -1
  538. package/dist/runnables/base.d.ts.map +0 -1
  539. package/dist/runnables/branch.d.cts.map +0 -1
  540. package/dist/runnables/branch.d.ts.map +0 -1
  541. package/dist/runnables/config.d.cts.map +0 -1
  542. package/dist/runnables/config.d.ts.map +0 -1
  543. package/dist/runnables/graph.d.cts.map +0 -1
  544. package/dist/runnables/graph.d.ts.map +0 -1
  545. package/dist/runnables/history.d.cts.map +0 -1
  546. package/dist/runnables/history.d.ts.map +0 -1
  547. package/dist/runnables/passthrough.d.cts.map +0 -1
  548. package/dist/runnables/passthrough.d.ts.map +0 -1
  549. package/dist/runnables/router.d.cts.map +0 -1
  550. package/dist/runnables/router.d.ts.map +0 -1
  551. package/dist/runnables/types.d.cts.map +0 -1
  552. package/dist/runnables/types.d.ts.map +0 -1
  553. package/dist/singletons/async_local_storage/context.d.cts.map +0 -1
  554. package/dist/singletons/async_local_storage/context.d.ts.map +0 -1
  555. package/dist/singletons/async_local_storage/globals.d.cts.map +0 -1
  556. package/dist/singletons/async_local_storage/globals.d.ts.map +0 -1
  557. package/dist/singletons/async_local_storage/index.d.cts.map +0 -1
  558. package/dist/singletons/async_local_storage/index.d.ts.map +0 -1
  559. package/dist/singletons/callbacks.d.cts.map +0 -1
  560. package/dist/singletons/callbacks.d.ts.map +0 -1
  561. package/dist/stores.d.cts.map +0 -1
  562. package/dist/stores.d.ts.map +0 -1
  563. package/dist/structured_query/base.d.cts.map +0 -1
  564. package/dist/structured_query/base.d.ts.map +0 -1
  565. package/dist/structured_query/functional.d.cts.map +0 -1
  566. package/dist/structured_query/functional.d.ts.map +0 -1
  567. package/dist/structured_query/ir.d.cts.map +0 -1
  568. package/dist/structured_query/ir.d.ts.map +0 -1
  569. package/dist/structured_query/utils.d.cts.map +0 -1
  570. package/dist/structured_query/utils.d.ts.map +0 -1
  571. package/dist/tools/index.d.cts.map +0 -1
  572. package/dist/tools/index.d.ts.map +0 -1
  573. package/dist/tools/types.d.cts.map +0 -1
  574. package/dist/tools/types.d.ts.map +0 -1
  575. package/dist/tools/utils.d.cts.map +0 -1
  576. package/dist/tools/utils.d.ts.map +0 -1
  577. package/dist/tracers/base.d.cts.map +0 -1
  578. package/dist/tracers/base.d.ts.map +0 -1
  579. package/dist/tracers/console.d.cts.map +0 -1
  580. package/dist/tracers/console.d.ts.map +0 -1
  581. package/dist/tracers/event_stream.d.cts.map +0 -1
  582. package/dist/tracers/event_stream.d.ts.map +0 -1
  583. package/dist/tracers/log_stream.d.cts.map +0 -1
  584. package/dist/tracers/log_stream.d.ts.map +0 -1
  585. package/dist/tracers/run_collector.d.cts.map +0 -1
  586. package/dist/tracers/run_collector.d.ts.map +0 -1
  587. package/dist/tracers/tracer_langchain.d.cts.map +0 -1
  588. package/dist/tracers/tracer_langchain.d.ts.map +0 -1
  589. package/dist/types/_internal.d.cts.map +0 -1
  590. package/dist/types/_internal.d.ts.map +0 -1
  591. package/dist/types/type-utils.d.cts.map +0 -1
  592. package/dist/types/type-utils.d.ts.map +0 -1
  593. package/dist/utils/async_caller.d.cts.map +0 -1
  594. package/dist/utils/async_caller.d.ts.map +0 -1
  595. package/dist/utils/chunk_array.d.cts.map +0 -1
  596. package/dist/utils/chunk_array.d.ts.map +0 -1
  597. package/dist/utils/env.d.cts.map +0 -1
  598. package/dist/utils/env.d.ts.map +0 -1
  599. package/dist/utils/event_source_parse.d.cts.map +0 -1
  600. package/dist/utils/event_source_parse.d.ts.map +0 -1
  601. package/dist/utils/fast-json-patch/src/core.d.cts.map +0 -1
  602. package/dist/utils/fast-json-patch/src/core.d.ts.map +0 -1
  603. package/dist/utils/fast-json-patch/src/duplex.d.cts.map +0 -1
  604. package/dist/utils/fast-json-patch/src/duplex.d.ts.map +0 -1
  605. package/dist/utils/format.d.cts.map +0 -1
  606. package/dist/utils/format.d.ts.map +0 -1
  607. package/dist/utils/function_calling.d.cts.map +0 -1
  608. package/dist/utils/function_calling.d.ts.map +0 -1
  609. package/dist/utils/hash.d.cts.map +0 -1
  610. package/dist/utils/hash.d.ts.map +0 -1
  611. package/dist/utils/js-sha256/hash.d.cts.map +0 -1
  612. package/dist/utils/js-sha256/hash.d.ts.map +0 -1
  613. package/dist/utils/json.d.cts.map +0 -1
  614. package/dist/utils/json.d.ts.map +0 -1
  615. package/dist/utils/json_schema.d.cts.map +0 -1
  616. package/dist/utils/json_schema.d.ts.map +0 -1
  617. package/dist/utils/math.d.cts.map +0 -1
  618. package/dist/utils/math.d.ts.map +0 -1
  619. package/dist/utils/ml-distance/similarities.d.cts.map +0 -1
  620. package/dist/utils/ml-distance/similarities.d.ts.map +0 -1
  621. package/dist/utils/stream.d.cts.map +0 -1
  622. package/dist/utils/stream.d.ts.map +0 -1
  623. package/dist/utils/testing/chat_models.d.cts.map +0 -1
  624. package/dist/utils/testing/chat_models.d.ts.map +0 -1
  625. package/dist/utils/testing/embeddings.d.cts.map +0 -1
  626. package/dist/utils/testing/embeddings.d.ts.map +0 -1
  627. package/dist/utils/testing/llms.d.cts.map +0 -1
  628. package/dist/utils/testing/llms.d.ts.map +0 -1
  629. package/dist/utils/testing/message_history.d.cts.map +0 -1
  630. package/dist/utils/testing/message_history.d.ts.map +0 -1
  631. package/dist/utils/testing/output_parsers.d.cts.map +0 -1
  632. package/dist/utils/testing/output_parsers.d.ts.map +0 -1
  633. package/dist/utils/testing/retrievers.d.cts.map +0 -1
  634. package/dist/utils/testing/retrievers.d.ts.map +0 -1
  635. package/dist/utils/testing/runnables.d.cts.map +0 -1
  636. package/dist/utils/testing/runnables.d.ts.map +0 -1
  637. package/dist/utils/testing/tools.d.cts.map +0 -1
  638. package/dist/utils/testing/tools.d.ts.map +0 -1
  639. package/dist/utils/testing/tracers.d.cts.map +0 -1
  640. package/dist/utils/testing/tracers.d.ts.map +0 -1
  641. package/dist/utils/testing/vectorstores.d.cts.map +0 -1
  642. package/dist/utils/testing/vectorstores.d.ts.map +0 -1
  643. package/dist/utils/tiktoken.d.cts.map +0 -1
  644. package/dist/utils/tiktoken.d.ts.map +0 -1
  645. package/dist/utils/types/index.d.cts.map +0 -1
  646. package/dist/utils/types/index.d.ts.map +0 -1
  647. package/dist/utils/types/zod.d.cts.map +0 -1
  648. package/dist/utils/types/zod.d.ts.map +0 -1
  649. package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +0 -1
  650. package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +0 -1
  651. package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +0 -1
  652. package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +0 -1
  653. package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +0 -1
  654. package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +0 -1
  655. package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +0 -1
  656. package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +0 -1
  657. package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +0 -1
  658. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +0 -1
  659. package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +0 -1
  660. package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +0 -1
  661. package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +0 -1
  662. package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +0 -1
  663. package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +0 -1
  664. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +0 -1
  665. package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +0 -1
  666. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +0 -1
  667. package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +0 -1
  668. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +0 -1
  669. package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +0 -1
  670. package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +0 -1
  671. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +0 -1
  672. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +0 -1
  673. package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +0 -1
  674. package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +0 -1
  675. package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +0 -1
  676. package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +0 -1
  677. package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +0 -1
  678. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +0 -1
  679. package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +0 -1
  680. package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +0 -1
  681. package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +0 -1
  682. package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +0 -1
  683. package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +0 -1
  684. package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +0 -1
  685. package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +0 -1
  686. package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +0 -1
  687. package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +0 -1
  688. package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +0 -1
  689. package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +0 -1
  690. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +0 -1
  691. package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +0 -1
  692. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +0 -1
  693. package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +0 -1
  694. package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +0 -1
  695. package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +0 -1
  696. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +0 -1
  697. package/dist/vectorstores.d.cts.map +0 -1
  698. package/dist/vectorstores.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditional.d.ts","names":["BaseChatModel","BasePromptTemplate","BaseLanguageModelInterface","BaseLLM","PartialValues","BaseGetPromptAsyncOptions","BasePromptSelector","Promise","ConditionalPromptSelector","Array","isLLM","isChatModel"],"sources":["../../src/example_selectors/conditional.d.ts"],"sourcesContent":["import type { BaseChatModel } from \"../language_models/chat_models.js\";\nimport type { BasePromptTemplate } from \"../prompts/base.js\";\nimport type { BaseLanguageModelInterface } from \"../language_models/base.js\";\nimport type { BaseLLM } from \"../language_models/llms.js\";\nimport type { PartialValues } from \"../utils/types/index.js\";\nexport type BaseGetPromptAsyncOptions = {\n partialVariables?: PartialValues;\n};\n/**\n * Abstract class that defines the interface for selecting a prompt for a\n * given language model.\n */\nexport declare abstract class BasePromptSelector {\n /**\n * Abstract method that must be implemented by any class that extends\n * `BasePromptSelector`. It takes a language model as an argument and\n * returns a prompt template.\n * @param llm The language model for which to get a prompt.\n * @returns A prompt template.\n */\n abstract getPrompt(llm: BaseLanguageModelInterface): BasePromptTemplate;\n /**\n * Asynchronous version of `getPrompt` that also accepts an options object\n * for partial variables.\n * @param llm The language model for which to get a prompt.\n * @param options Optional object for partial variables.\n * @returns A Promise that resolves to a prompt template.\n */\n getPromptAsync(llm: BaseLanguageModelInterface, options?: BaseGetPromptAsyncOptions): Promise<BasePromptTemplate>;\n}\n/**\n * Concrete implementation of `BasePromptSelector` that selects a prompt\n * based on a set of conditions. It has a default prompt that it returns\n * if none of the conditions are met.\n */\nexport declare class ConditionalPromptSelector extends BasePromptSelector {\n defaultPrompt: BasePromptTemplate;\n conditionals: Array<[\n condition: (llm: BaseLanguageModelInterface) => boolean,\n prompt: BasePromptTemplate\n ]>;\n constructor(default_prompt: BasePromptTemplate, conditionals?: Array<[\n condition: (llm: BaseLanguageModelInterface) => boolean,\n prompt: BasePromptTemplate\n ]>);\n /**\n * Method that selects a prompt based on a set of conditions. If none of\n * the conditions are met, it returns the default prompt.\n * @param llm The language model for which to get a prompt.\n * @returns A prompt template.\n */\n getPrompt(llm: BaseLanguageModelInterface): BasePromptTemplate;\n}\n/**\n * Type guard function that checks if a given language model is of type\n * `BaseLLM`.\n */\nexport declare function isLLM(llm: BaseLanguageModelInterface): llm is BaseLLM;\n/**\n * Type guard function that checks if a given language model is of type\n * `BaseChatModel`.\n */\nexport declare function isChatModel(llm: BaseLanguageModelInterface): llm is BaseChatModel;\n"],"mappings":";;;;;;;KAKYK,yBAAAA;qBACWD;AADvB,CAAA;AAOA;;;;AAgBwBF,uBAhBMI,kBAAAA,CAgBNJ;EAA0B;;;AAA+C;AAOjG;;;EACqC,SAEZA,SAAAA,CAAAA,GAAAA,EAlBGA,0BAkBHA,CAAAA,EAlBgCD,kBAkBhCC;EAA0B;;;;;;;EAaN,cAAGD,CAAAA,GAAAA,EAvBxBC,0BAuBwBD,EAAAA,OAAAA,CAAAA,EAvBcI,yBAuBdJ,CAAAA,EAvB0CM,OAuB1CN,CAvBkDA,kBAuBlDA,CAAAA;;AAhByB;AAsBzE;;;;AAA8E,cAtBzDO,yBAAAA,SAAkCF,kBAAAA,CAsBuB;EAKtDK,aAAAA,EA1BLV,kBA0BgB;EAAA,YAAA,EAzBjBQ,KAyBiB,CAAA,CAAMP,SAAAA,EAAAA,CAAAA,GAAAA,EAxBhBA,0BAwBgBA,EAAAA,GAAAA,OAAAA,EAAoCF,MAAAA,EAvB7DC,kBAuB6DD,CAAa,CAAA;8BArB1DC,mCAAmCQ,wBAC1CP,gDACTD;;;;;;;iBAQGC,6BAA6BD;;;;;;iBAMxBS,KAAAA,MAAWR,oCAAoCC;;;;;iBAK/CQ,WAAAA,MAAiBT,oCAAoCF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"length_based.d.cts","names":["Example","BaseExampleSelector","PromptTemplate","LengthBasedExampleSelectorInput","LengthBasedExampleSelector","Promise"],"sources":["../../src/example_selectors/length_based.d.ts"],"sourcesContent":["import { Example } from \"../prompts/base.js\";\nimport { BaseExampleSelector } from \"./base.js\";\nimport { PromptTemplate } from \"../prompts/prompt.js\";\n/**\n * Interface for the input parameters of the LengthBasedExampleSelector\n * class.\n */\nexport interface LengthBasedExampleSelectorInput {\n examplePrompt: PromptTemplate;\n maxLength?: number;\n getTextLength?: (text: string) => number;\n}\n/**\n * A specialized example selector that selects examples based on their\n * length, ensuring that the total length of the selected examples does\n * not exceed a specified maximum length.\n * @example\n * ```typescript\n * const exampleSelector = new LengthBasedExampleSelector(\n * [\n * { input: \"happy\", output: \"sad\" },\n * { input: \"tall\", output: \"short\" },\n * { input: \"energetic\", output: \"lethargic\" },\n * { input: \"sunny\", output: \"gloomy\" },\n * { input: \"windy\", output: \"calm\" },\n * ],\n * {\n * examplePrompt: new PromptTemplate({\n * inputVariables: [\"input\", \"output\"],\n * template: \"Input: {input}\\nOutput: {output}\",\n * }),\n * maxLength: 25,\n * },\n * );\n * const dynamicPrompt = new FewShotPromptTemplate({\n * exampleSelector,\n * examplePrompt: new PromptTemplate({\n * inputVariables: [\"input\", \"output\"],\n * template: \"Input: {input}\\nOutput: {output}\",\n * }),\n * prefix: \"Give the antonym of every input\",\n * suffix: \"Input: {adjective}\\nOutput:\",\n * inputVariables: [\"adjective\"],\n * });\n * console.log(dynamicPrompt.format({ adjective: \"big\" }));\n * console.log(\n * dynamicPrompt.format({\n * adjective:\n * \"big and huge and massive and large and gigantic and tall and much much much much much bigger than everything else\",\n * }),\n * );\n * ```\n */\nexport declare class LengthBasedExampleSelector extends BaseExampleSelector {\n protected examples: Example[];\n examplePrompt!: PromptTemplate;\n getTextLength: (text: string) => number;\n maxLength: number;\n exampleTextLengths: number[];\n constructor(data: LengthBasedExampleSelectorInput);\n /**\n * Adds an example to the list of examples and calculates its length.\n * @param example The example to be added.\n * @returns Promise that resolves when the example has been added and its length calculated.\n */\n addExample(example: Example): Promise<void>;\n /**\n * Calculates the lengths of the examples.\n * @param v Array of lengths of the examples.\n * @param values Instance of LengthBasedExampleSelector.\n * @returns Promise that resolves with an array of lengths of the examples.\n */\n calculateExampleTextLengths(v: number[], values: LengthBasedExampleSelector): Promise<number[]>;\n /**\n * Selects examples until the total length of the selected examples\n * reaches the maxLength.\n * @param inputVariables The input variables for the examples.\n * @returns Promise that resolves with an array of selected examples.\n */\n selectExamples(inputVariables: Example): Promise<Example[]>;\n /**\n * Creates a new instance of LengthBasedExampleSelector and adds a list of\n * examples to it.\n * @param examples Array of examples to be added.\n * @param args Input parameters for the LengthBasedExampleSelector.\n * @returns Promise that resolves with a new instance of LengthBasedExampleSelector with the examples added.\n */\n static fromExamples(examples: Example[], args: LengthBasedExampleSelectorInput): Promise<LengthBasedExampleSelector>;\n}\n"],"mappings":";;;;;;;;AAOA;AA8CA;AAA+C,UA9C9BG,+BAAAA,CA8C8B;EAAA,aACvBH,EA9CLE,cA8CKF;EAAO,SACXE,CAAAA,EAAAA,MAAAA;EAAc,aAIZC,CAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GAAAA,MAAAA;;;;;;;;;;;;;AANqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAtDC,0BAAAA,SAAmCH,mBAAAA;sBAChCD;kBACJE;;;;oBAIEC;;;;;;sBAMEH,UAAUK;;;;;;;mDAOmBD,6BAA6BC;;;;;;;iCAO/CL,UAAUK,QAAQL;;;;;;;;gCAQnBA,iBAAiBG,kCAAkCE,QAAQD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"length_based.d.ts","names":["Example","BaseExampleSelector","PromptTemplate","LengthBasedExampleSelectorInput","LengthBasedExampleSelector","Promise"],"sources":["../../src/example_selectors/length_based.d.ts"],"sourcesContent":["import { Example } from \"../prompts/base.js\";\nimport { BaseExampleSelector } from \"./base.js\";\nimport { PromptTemplate } from \"../prompts/prompt.js\";\n/**\n * Interface for the input parameters of the LengthBasedExampleSelector\n * class.\n */\nexport interface LengthBasedExampleSelectorInput {\n examplePrompt: PromptTemplate;\n maxLength?: number;\n getTextLength?: (text: string) => number;\n}\n/**\n * A specialized example selector that selects examples based on their\n * length, ensuring that the total length of the selected examples does\n * not exceed a specified maximum length.\n * @example\n * ```typescript\n * const exampleSelector = new LengthBasedExampleSelector(\n * [\n * { input: \"happy\", output: \"sad\" },\n * { input: \"tall\", output: \"short\" },\n * { input: \"energetic\", output: \"lethargic\" },\n * { input: \"sunny\", output: \"gloomy\" },\n * { input: \"windy\", output: \"calm\" },\n * ],\n * {\n * examplePrompt: new PromptTemplate({\n * inputVariables: [\"input\", \"output\"],\n * template: \"Input: {input}\\nOutput: {output}\",\n * }),\n * maxLength: 25,\n * },\n * );\n * const dynamicPrompt = new FewShotPromptTemplate({\n * exampleSelector,\n * examplePrompt: new PromptTemplate({\n * inputVariables: [\"input\", \"output\"],\n * template: \"Input: {input}\\nOutput: {output}\",\n * }),\n * prefix: \"Give the antonym of every input\",\n * suffix: \"Input: {adjective}\\nOutput:\",\n * inputVariables: [\"adjective\"],\n * });\n * console.log(dynamicPrompt.format({ adjective: \"big\" }));\n * console.log(\n * dynamicPrompt.format({\n * adjective:\n * \"big and huge and massive and large and gigantic and tall and much much much much much bigger than everything else\",\n * }),\n * );\n * ```\n */\nexport declare class LengthBasedExampleSelector extends BaseExampleSelector {\n protected examples: Example[];\n examplePrompt!: PromptTemplate;\n getTextLength: (text: string) => number;\n maxLength: number;\n exampleTextLengths: number[];\n constructor(data: LengthBasedExampleSelectorInput);\n /**\n * Adds an example to the list of examples and calculates its length.\n * @param example The example to be added.\n * @returns Promise that resolves when the example has been added and its length calculated.\n */\n addExample(example: Example): Promise<void>;\n /**\n * Calculates the lengths of the examples.\n * @param v Array of lengths of the examples.\n * @param values Instance of LengthBasedExampleSelector.\n * @returns Promise that resolves with an array of lengths of the examples.\n */\n calculateExampleTextLengths(v: number[], values: LengthBasedExampleSelector): Promise<number[]>;\n /**\n * Selects examples until the total length of the selected examples\n * reaches the maxLength.\n * @param inputVariables The input variables for the examples.\n * @returns Promise that resolves with an array of selected examples.\n */\n selectExamples(inputVariables: Example): Promise<Example[]>;\n /**\n * Creates a new instance of LengthBasedExampleSelector and adds a list of\n * examples to it.\n * @param examples Array of examples to be added.\n * @param args Input parameters for the LengthBasedExampleSelector.\n * @returns Promise that resolves with a new instance of LengthBasedExampleSelector with the examples added.\n */\n static fromExamples(examples: Example[], args: LengthBasedExampleSelectorInput): Promise<LengthBasedExampleSelector>;\n}\n"],"mappings":";;;;;;;;AAOA;AA8CA;AAA+C,UA9C9BG,+BAAAA,CA8C8B;EAAA,aACvBH,EA9CLE,cA8CKF;EAAO,SACXE,CAAAA,EAAAA,MAAAA;EAAc,aAIZC,CAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GAAAA,MAAAA;;;;;;;;;;;;;AANqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAtDC,0BAAAA,SAAmCH,mBAAAA;sBAChCD;kBACJE;;;;oBAIEC;;;;;;sBAMEH,UAAUK;;;;;;;mDAOmBD,6BAA6BC;;;;;;;iCAO/CL,UAAUK,QAAQL;;;;;;;;gCAQnBA,iBAAiBG,kCAAkCE,QAAQD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"semantic_similarity.d.cts","names":["Embeddings","VectorStoreInterface","VectorStoreRetrieverInterface","VectorStore","Example","BaseExampleSelector","SemanticSimilarityExampleSelectorInput","V","SemanticSimilarityExampleSelector","Promise","T","Record","C","Parameters"],"sources":["../../src/example_selectors/semantic_similarity.d.ts"],"sourcesContent":["import type { Embeddings } from \"../embeddings.js\";\nimport type { VectorStoreInterface, VectorStoreRetrieverInterface, VectorStore } from \"../vectorstores.js\";\nimport type { Example } from \"../prompts/base.js\";\nimport { BaseExampleSelector } from \"./base.js\";\n/**\n * Interface for the input data of the SemanticSimilarityExampleSelector\n * class.\n */\nexport type SemanticSimilarityExampleSelectorInput<V extends VectorStoreInterface = VectorStoreInterface> = {\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n exampleKeys?: string[];\n inputKeys?: string[];\n vectorStoreRetriever?: never;\n} | {\n vectorStoreRetriever: VectorStoreRetrieverInterface<V>;\n exampleKeys?: string[];\n inputKeys?: string[];\n vectorStore?: never;\n k?: never;\n filter?: never;\n};\n/**\n * Class that selects examples based on semantic similarity. It extends\n * the BaseExampleSelector class.\n * @example\n * ```typescript\n * const exampleSelector = await SemanticSimilarityExampleSelector.fromExamples(\n * [\n * { input: \"happy\", output: \"sad\" },\n * { input: \"tall\", output: \"short\" },\n * { input: \"energetic\", output: \"lethargic\" },\n * { input: \"sunny\", output: \"gloomy\" },\n * { input: \"windy\", output: \"calm\" },\n * ],\n * new OpenAIEmbeddings(),\n * HNSWLib,\n * { k: 1 },\n * );\n * const dynamicPrompt = new FewShotPromptTemplate({\n * exampleSelector,\n * examplePrompt: PromptTemplate.fromTemplate(\n * \"Input: {input}\\nOutput: {output}\",\n * ),\n * prefix: \"Give the antonym of every input\",\n * suffix: \"Input: {adjective}\\nOutput:\",\n * inputVariables: [\"adjective\"],\n * });\n * console.log(await dynamicPrompt.format({ adjective: \"rainy\" }));\n * ```\n */\nexport declare class SemanticSimilarityExampleSelector<V extends VectorStoreInterface = VectorStoreInterface> extends BaseExampleSelector {\n vectorStoreRetriever: VectorStoreRetrieverInterface<V>;\n exampleKeys?: string[];\n inputKeys?: string[];\n constructor(data: SemanticSimilarityExampleSelectorInput<V>);\n /**\n * Method that adds a new example to the vectorStore. The example is\n * converted to a string and added to the vectorStore as a document.\n * @param example The example to be added to the vectorStore.\n * @returns Promise that resolves when the example has been added to the vectorStore.\n */\n addExample(example: Example): Promise<void>;\n /**\n * Method that selects which examples to use based on semantic similarity.\n * It performs a similarity search in the vectorStore using the input\n * variables and returns the examples with the highest similarity.\n * @param inputVariables The input variables used for the similarity search.\n * @returns Promise that resolves with an array of the selected examples.\n */\n selectExamples<T>(inputVariables: Record<string, T>): Promise<Example[]>;\n /**\n * Static method that creates a new instance of\n * SemanticSimilarityExampleSelector. It takes a list of examples, an\n * instance of Embeddings, a VectorStore class, and an options object as\n * parameters. It converts the examples to strings, creates a VectorStore\n * from the strings and the embeddings, and returns a new\n * SemanticSimilarityExampleSelector with the created VectorStore and the\n * options provided.\n * @param examples The list of examples to be used.\n * @param embeddings The instance of Embeddings to be used.\n * @param vectorStoreCls The VectorStore class to be used.\n * @param options The options object for the SemanticSimilarityExampleSelector.\n * @returns Promise that resolves with a new instance of SemanticSimilarityExampleSelector.\n */\n static fromExamples<C extends typeof VectorStore>(examples: Record<string, string>[], embeddings: Embeddings, vectorStoreCls: C, options?: {\n k?: number;\n inputKeys?: string[];\n } & Parameters<C[\"fromTexts\"]>[3]): Promise<SemanticSimilarityExampleSelector>;\n}\n"],"mappings":";;;;;;;;;AAQA;;AAA6DC,KAAjDK,sCAAiDL,CAAAA,UAAAA,oBAAAA,GAAuBA,oBAAvBA,CAAAA,GAAAA;EAAoB,WAAGA,EACnEM,CADmEN;EAAoB,CAAA,CAAA,EACvFM,MAAAA;EAAC,MAELA,CAAAA,EAAAA,CAAAA,CAAAA,YAAAA,CAAAA;EAAC,WAK0CA,CAAAA,EAAAA,MAAAA,EAAAA;EAAC,SAA/BL,CAAAA,EAAAA,MAAAA,EAAAA;EAA6B,oBAAA,CAAA,EAAA,KAAA;AAoCvD,CAAA,GAAqBM;EAAiC,oBAAA,EApC5BN,6BAoC4B,CApCEK,CAoCF,CAAA;EAAA,WAAWN,CAAAA,EAAAA,MAAAA,EAAAA;EAAoB,SAAGA,CAAAA,EAAAA,MAAAA,EAAAA;EAAoB,WACpDM,CAAAA,EAAAA,KAAAA;EAAC,CAAA,CAAA,EAA/BL,KAAAA;EAA6B,MAGMK,CAAAA,EAAAA,KAAAA;CAAC;;;;;;;;;;;;;;;;AAJ2E;;;;;;;;;;;;;;cAApHC,4CAA4CP,uBAAuBA,8BAA8BI,mBAAAA;wBAC5FH,8BAA8BK;;;oBAGlCD,uCAAuCC;;;;;;;sBAOrCH,UAAUK;;;;;;;;oCAQIE,eAAeD,KAAKD,QAAQL;;;;;;;;;;;;;;;uCAezBD,uBAAuBQ,sCAAsCX,4BAA4BY;;;MAG1HC,WAAWD,qBAAqBH,QAAQD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"semantic_similarity.d.ts","names":["Embeddings","VectorStoreInterface","VectorStoreRetrieverInterface","VectorStore","Example","BaseExampleSelector","SemanticSimilarityExampleSelectorInput","V","SemanticSimilarityExampleSelector","Promise","T","Record","C","Parameters"],"sources":["../../src/example_selectors/semantic_similarity.d.ts"],"sourcesContent":["import type { Embeddings } from \"../embeddings.js\";\nimport type { VectorStoreInterface, VectorStoreRetrieverInterface, VectorStore } from \"../vectorstores.js\";\nimport type { Example } from \"../prompts/base.js\";\nimport { BaseExampleSelector } from \"./base.js\";\n/**\n * Interface for the input data of the SemanticSimilarityExampleSelector\n * class.\n */\nexport type SemanticSimilarityExampleSelectorInput<V extends VectorStoreInterface = VectorStoreInterface> = {\n vectorStore: V;\n k?: number;\n filter?: V[\"FilterType\"];\n exampleKeys?: string[];\n inputKeys?: string[];\n vectorStoreRetriever?: never;\n} | {\n vectorStoreRetriever: VectorStoreRetrieverInterface<V>;\n exampleKeys?: string[];\n inputKeys?: string[];\n vectorStore?: never;\n k?: never;\n filter?: never;\n};\n/**\n * Class that selects examples based on semantic similarity. It extends\n * the BaseExampleSelector class.\n * @example\n * ```typescript\n * const exampleSelector = await SemanticSimilarityExampleSelector.fromExamples(\n * [\n * { input: \"happy\", output: \"sad\" },\n * { input: \"tall\", output: \"short\" },\n * { input: \"energetic\", output: \"lethargic\" },\n * { input: \"sunny\", output: \"gloomy\" },\n * { input: \"windy\", output: \"calm\" },\n * ],\n * new OpenAIEmbeddings(),\n * HNSWLib,\n * { k: 1 },\n * );\n * const dynamicPrompt = new FewShotPromptTemplate({\n * exampleSelector,\n * examplePrompt: PromptTemplate.fromTemplate(\n * \"Input: {input}\\nOutput: {output}\",\n * ),\n * prefix: \"Give the antonym of every input\",\n * suffix: \"Input: {adjective}\\nOutput:\",\n * inputVariables: [\"adjective\"],\n * });\n * console.log(await dynamicPrompt.format({ adjective: \"rainy\" }));\n * ```\n */\nexport declare class SemanticSimilarityExampleSelector<V extends VectorStoreInterface = VectorStoreInterface> extends BaseExampleSelector {\n vectorStoreRetriever: VectorStoreRetrieverInterface<V>;\n exampleKeys?: string[];\n inputKeys?: string[];\n constructor(data: SemanticSimilarityExampleSelectorInput<V>);\n /**\n * Method that adds a new example to the vectorStore. The example is\n * converted to a string and added to the vectorStore as a document.\n * @param example The example to be added to the vectorStore.\n * @returns Promise that resolves when the example has been added to the vectorStore.\n */\n addExample(example: Example): Promise<void>;\n /**\n * Method that selects which examples to use based on semantic similarity.\n * It performs a similarity search in the vectorStore using the input\n * variables and returns the examples with the highest similarity.\n * @param inputVariables The input variables used for the similarity search.\n * @returns Promise that resolves with an array of the selected examples.\n */\n selectExamples<T>(inputVariables: Record<string, T>): Promise<Example[]>;\n /**\n * Static method that creates a new instance of\n * SemanticSimilarityExampleSelector. It takes a list of examples, an\n * instance of Embeddings, a VectorStore class, and an options object as\n * parameters. It converts the examples to strings, creates a VectorStore\n * from the strings and the embeddings, and returns a new\n * SemanticSimilarityExampleSelector with the created VectorStore and the\n * options provided.\n * @param examples The list of examples to be used.\n * @param embeddings The instance of Embeddings to be used.\n * @param vectorStoreCls The VectorStore class to be used.\n * @param options The options object for the SemanticSimilarityExampleSelector.\n * @returns Promise that resolves with a new instance of SemanticSimilarityExampleSelector.\n */\n static fromExamples<C extends typeof VectorStore>(examples: Record<string, string>[], embeddings: Embeddings, vectorStoreCls: C, options?: {\n k?: number;\n inputKeys?: string[];\n } & Parameters<C[\"fromTexts\"]>[3]): Promise<SemanticSimilarityExampleSelector>;\n}\n"],"mappings":";;;;;;;;;AAQA;;AAA6DC,KAAjDK,sCAAiDL,CAAAA,UAAAA,oBAAAA,GAAuBA,oBAAvBA,CAAAA,GAAAA;EAAoB,WAAGA,EACnEM,CADmEN;EAAoB,CAAA,CAAA,EACvFM,MAAAA;EAAC,MAELA,CAAAA,EAAAA,CAAAA,CAAAA,YAAAA,CAAAA;EAAC,WAK0CA,CAAAA,EAAAA,MAAAA,EAAAA;EAAC,SAA/BL,CAAAA,EAAAA,MAAAA,EAAAA;EAA6B,oBAAA,CAAA,EAAA,KAAA;AAoCvD,CAAA,GAAqBM;EAAiC,oBAAA,EApC5BN,6BAoC4B,CApCEK,CAoCF,CAAA;EAAA,WAAWN,CAAAA,EAAAA,MAAAA,EAAAA;EAAoB,SAAGA,CAAAA,EAAAA,MAAAA,EAAAA;EAAoB,WACpDM,CAAAA,EAAAA,KAAAA;EAAC,CAAA,CAAA,EAA/BL,KAAAA;EAA6B,MAGMK,CAAAA,EAAAA,KAAAA;CAAC;;;;;;;;;;;;;;;;AAJ2E;;;;;;;;;;;;;;cAApHC,4CAA4CP,uBAAuBA,8BAA8BI,mBAAAA;wBAC5FH,8BAA8BK;;;oBAGlCD,uCAAuCC;;;;;;;sBAOrCH,UAAUK;;;;;;;;oCAQIE,eAAeD,KAAKD,QAAQL;;;;;;;;;;;;;;;uCAezBD,uBAAuBQ,sCAAsCX,4BAA4BY;;;MAG1HC,WAAWD,qBAAqBH,QAAQD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.cts","names":["VectorStore","RecordManagerInterface","HashKeyEncoder","DocumentInterface","BaseDocumentLoader","Metadata","Record","IndexingResult","StringOrDocFunc","HashedDocumentInterface","HashedDocumentArgs","_HashedDocument","CleanupMode","IndexOptions","_batch","T","_deduplicateInOrder","_getSourceIdAssigner","_isBaseDocumentLoader","IndexArgs","index","Promise"],"sources":["../../src/indexing/base.d.ts"],"sourcesContent":["import { VectorStore } from \"../vectorstores.js\";\nimport { RecordManagerInterface } from \"./record_manager.js\";\nimport { type HashKeyEncoder } from \"../utils/hash.js\";\nimport { DocumentInterface } from \"../documents/document.js\";\nimport { BaseDocumentLoader } from \"../document_loaders/base.js\";\ntype Metadata = Record<string, unknown>;\ntype IndexingResult = {\n numAdded: number;\n numDeleted: number;\n numUpdated: number;\n numSkipped: number;\n};\ntype StringOrDocFunc = string | ((doc: DocumentInterface) => string);\nexport interface HashedDocumentInterface extends DocumentInterface {\n uid: string;\n hash_?: string;\n contentHash?: string;\n metadataHash?: string;\n pageContent: string;\n metadata: Metadata;\n calculateHashes(): void;\n toDocument(): DocumentInterface;\n}\ninterface HashedDocumentArgs {\n pageContent: string;\n metadata: Metadata;\n uid: string;\n}\n/**\n * HashedDocument is a Document with hashes calculated.\n * Hashes are calculated based on page content and metadata.\n * It is used for indexing.\n */\nexport declare class _HashedDocument implements HashedDocumentInterface {\n uid: string;\n hash_?: string;\n contentHash?: string;\n metadataHash?: string;\n pageContent: string;\n metadata: Metadata;\n private keyEncoder;\n constructor(fields: HashedDocumentArgs);\n makeDefaultKeyEncoder(keyEncoderFn: HashKeyEncoder): void;\n calculateHashes(): void;\n toDocument(): DocumentInterface;\n static fromDocument(document: DocumentInterface, uid?: string): _HashedDocument;\n private _hashStringToUUID;\n private _hashNestedDictToUUID;\n}\nexport type CleanupMode = \"full\" | \"incremental\";\nexport type IndexOptions = {\n /**\n * The number of documents to index in one batch.\n */\n batchSize?: number;\n /**\n * The cleanup mode to use. Can be \"full\", \"incremental\" or undefined.\n * - **Incremental**: Cleans up all documents that haven't been updated AND\n * that are associated with source ids that were seen\n * during indexing.\n * Clean up is done continuously during indexing helping\n * to minimize the probability of users seeing duplicated\n * content.\n * - **Full**: Delete all documents that haven to been returned by the loader.\n * Clean up runs after all documents have been indexed.\n * This means that users may see duplicated content during indexing.\n * - **undefined**: Do not delete any documents.\n */\n cleanup?: CleanupMode;\n /**\n * Optional key that helps identify the original source of the document.\n * Must either be a string representing the key of the source in the metadata\n * or a function that takes a document and returns a string representing the source.\n * **Required when cleanup is incremental**.\n */\n sourceIdKey?: StringOrDocFunc;\n /**\n * Batch size to use when cleaning up documents.\n */\n cleanupBatchSize?: number;\n /**\n * Force update documents even if they are present in the\n * record manager. Useful if you are re-indexing with updated embeddings.\n */\n forceUpdate?: boolean;\n};\nexport declare function _batch<T>(size: number, iterable: T[]): T[][];\nexport declare function _deduplicateInOrder(hashedDocuments: HashedDocumentInterface[]): HashedDocumentInterface[];\nexport declare function _getSourceIdAssigner(sourceIdKey: StringOrDocFunc | null): (doc: DocumentInterface) => string | null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare const _isBaseDocumentLoader: (arg: any) => arg is BaseDocumentLoader;\ninterface IndexArgs {\n docsSource: BaseDocumentLoader | DocumentInterface[];\n recordManager: RecordManagerInterface;\n vectorStore: VectorStore;\n options?: IndexOptions;\n}\n/**\n * Index data from the doc source into the vector store.\n *\n * Indexing functionality uses a manager to keep track of which documents\n * are in the vector store.\n *\n * This allows us to keep track of which documents were updated, and which\n * documents were deleted, which documents should be skipped.\n *\n * For the time being, documents are indexed using their hashes, and users\n * are not able to specify the uid of the document.\n *\n * @param {IndexArgs} args\n * @param {BaseDocumentLoader | DocumentInterface[]} args.docsSource The source of documents to index. Can be a DocumentLoader or a list of Documents.\n * @param {RecordManagerInterface} args.recordManager The record manager to use for keeping track of indexed documents.\n * @param {VectorStore} args.vectorStore The vector store to use for storing the documents.\n * @param {IndexOptions | undefined} args.options Options for indexing.\n * @returns {Promise<IndexingResult>}\n */\nexport declare function index(args: IndexArgs): Promise<IndexingResult>;\nexport {};\n"],"mappings":";;;;;;;KAKKK,QAAAA,GAAWC;KACXC,cAAAA;EADAF,QAAAA,EAAAA,MAAQ;EACRE,UAAAA,EAAAA,MAAc;EAMdC,UAAAA,EAAAA,MAAe;EACHC,UAAAA,EAAAA,MAAAA;CAAuB;KADnCD,eAAAA,GAOSH,MAAAA,GAAAA,CAAAA,CAAAA,GAAAA,EAPyBF,iBAOzBE,EAAAA,GAAAA,MAAAA,CAAAA;AAEIF,UARDM,uBAAAA,SAAgCN,iBAQ/BA,CAAAA;EAAiB,GARcA,EAAAA,MAAAA;EAAiB,KAAA,CAAA,EAAA,MAAA;EAUxDO,WAAAA,CAAAA,EAAAA,MAAAA;EAUWC,YAAAA,CAAAA,EAAAA,MAAe;EAAA,WAAA,EAAA,MAAA;EAAA,QAMtBN,EApBAA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;;;iBAqBUO,KAAAA,OAAYD,YAAYE,QAAQd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","names":["VectorStore","RecordManagerInterface","HashKeyEncoder","DocumentInterface","BaseDocumentLoader","Metadata","Record","IndexingResult","StringOrDocFunc","HashedDocumentInterface","HashedDocumentArgs","_HashedDocument","CleanupMode","IndexOptions","_batch","T","_deduplicateInOrder","_getSourceIdAssigner","_isBaseDocumentLoader","IndexArgs","index","Promise"],"sources":["../../src/indexing/base.d.ts"],"sourcesContent":["import { VectorStore } from \"../vectorstores.js\";\nimport { RecordManagerInterface } from \"./record_manager.js\";\nimport { type HashKeyEncoder } from \"../utils/hash.js\";\nimport { DocumentInterface } from \"../documents/document.js\";\nimport { BaseDocumentLoader } from \"../document_loaders/base.js\";\ntype Metadata = Record<string, unknown>;\ntype IndexingResult = {\n numAdded: number;\n numDeleted: number;\n numUpdated: number;\n numSkipped: number;\n};\ntype StringOrDocFunc = string | ((doc: DocumentInterface) => string);\nexport interface HashedDocumentInterface extends DocumentInterface {\n uid: string;\n hash_?: string;\n contentHash?: string;\n metadataHash?: string;\n pageContent: string;\n metadata: Metadata;\n calculateHashes(): void;\n toDocument(): DocumentInterface;\n}\ninterface HashedDocumentArgs {\n pageContent: string;\n metadata: Metadata;\n uid: string;\n}\n/**\n * HashedDocument is a Document with hashes calculated.\n * Hashes are calculated based on page content and metadata.\n * It is used for indexing.\n */\nexport declare class _HashedDocument implements HashedDocumentInterface {\n uid: string;\n hash_?: string;\n contentHash?: string;\n metadataHash?: string;\n pageContent: string;\n metadata: Metadata;\n private keyEncoder;\n constructor(fields: HashedDocumentArgs);\n makeDefaultKeyEncoder(keyEncoderFn: HashKeyEncoder): void;\n calculateHashes(): void;\n toDocument(): DocumentInterface;\n static fromDocument(document: DocumentInterface, uid?: string): _HashedDocument;\n private _hashStringToUUID;\n private _hashNestedDictToUUID;\n}\nexport type CleanupMode = \"full\" | \"incremental\";\nexport type IndexOptions = {\n /**\n * The number of documents to index in one batch.\n */\n batchSize?: number;\n /**\n * The cleanup mode to use. Can be \"full\", \"incremental\" or undefined.\n * - **Incremental**: Cleans up all documents that haven't been updated AND\n * that are associated with source ids that were seen\n * during indexing.\n * Clean up is done continuously during indexing helping\n * to minimize the probability of users seeing duplicated\n * content.\n * - **Full**: Delete all documents that haven to been returned by the loader.\n * Clean up runs after all documents have been indexed.\n * This means that users may see duplicated content during indexing.\n * - **undefined**: Do not delete any documents.\n */\n cleanup?: CleanupMode;\n /**\n * Optional key that helps identify the original source of the document.\n * Must either be a string representing the key of the source in the metadata\n * or a function that takes a document and returns a string representing the source.\n * **Required when cleanup is incremental**.\n */\n sourceIdKey?: StringOrDocFunc;\n /**\n * Batch size to use when cleaning up documents.\n */\n cleanupBatchSize?: number;\n /**\n * Force update documents even if they are present in the\n * record manager. Useful if you are re-indexing with updated embeddings.\n */\n forceUpdate?: boolean;\n};\nexport declare function _batch<T>(size: number, iterable: T[]): T[][];\nexport declare function _deduplicateInOrder(hashedDocuments: HashedDocumentInterface[]): HashedDocumentInterface[];\nexport declare function _getSourceIdAssigner(sourceIdKey: StringOrDocFunc | null): (doc: DocumentInterface) => string | null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare const _isBaseDocumentLoader: (arg: any) => arg is BaseDocumentLoader;\ninterface IndexArgs {\n docsSource: BaseDocumentLoader | DocumentInterface[];\n recordManager: RecordManagerInterface;\n vectorStore: VectorStore;\n options?: IndexOptions;\n}\n/**\n * Index data from the doc source into the vector store.\n *\n * Indexing functionality uses a manager to keep track of which documents\n * are in the vector store.\n *\n * This allows us to keep track of which documents were updated, and which\n * documents were deleted, which documents should be skipped.\n *\n * For the time being, documents are indexed using their hashes, and users\n * are not able to specify the uid of the document.\n *\n * @param {IndexArgs} args\n * @param {BaseDocumentLoader | DocumentInterface[]} args.docsSource The source of documents to index. Can be a DocumentLoader or a list of Documents.\n * @param {RecordManagerInterface} args.recordManager The record manager to use for keeping track of indexed documents.\n * @param {VectorStore} args.vectorStore The vector store to use for storing the documents.\n * @param {IndexOptions | undefined} args.options Options for indexing.\n * @returns {Promise<IndexingResult>}\n */\nexport declare function index(args: IndexArgs): Promise<IndexingResult>;\nexport {};\n"],"mappings":";;;;;;;KAKKK,QAAAA,GAAWC;KACXC,cAAAA;EADAF,QAAAA,EAAAA,MAAQ;EACRE,UAAAA,EAAAA,MAAc;EAMdC,UAAAA,EAAAA,MAAe;EACHC,UAAAA,EAAAA,MAAAA;CAAuB;KADnCD,eAAAA,GAOSH,MAAAA,GAAAA,CAAAA,CAAAA,GAAAA,EAPyBF,iBAOzBE,EAAAA,GAAAA,MAAAA,CAAAA;AAEIF,UARDM,uBAAAA,SAAgCN,iBAQ/BA,CAAAA;EAAiB,GARcA,EAAAA,MAAAA;EAAiB,KAAA,CAAA,EAAA,MAAA;EAUxDO,WAAAA,CAAAA,EAAAA,MAAAA;EAUWC,YAAAA,CAAAA,EAAAA,MAAe;EAAA,WAAA,EAAA,MAAA;EAAA,QAMtBN,EApBAA,QAoBAA;EAAQ,eAEEK,EAAAA,EAAAA,IAAAA;EAAkB,UACFR,EAAAA,EArBtBC,iBAqBsBD;;UAnB9BQ,kBAAAA,CAsBwBP;EAAiB,WAAiBQ,EAAAA,MAAAA;EAAe,QAZnCF,EARlCJ,QAQkCI;EAAuB,GAAA,EAAA,MAAA;AAgBvE;AACA;;;;AAyBiC;AAWTK,cArDHH,eAAAA,YAA2BF,uBAqDlB,CAAA;EAAA,GAAA,EAAA,MAAA;EAAA,KAA4BM,CAAAA,EAAAA,MAAAA;EAAC,WAAKA,CAAAA,EAAAA,MAAAA;EAAC,YAAA,CAAA,EAAA,MAAA;EACzCC,WAAAA,EAAAA,MAAAA;EAAmB,QAAA,EAhD7BX,QAgD6B;EAAA,QAAkBI,UAAAA;EAAuB,WAAKA,CAAAA,MAAAA,EA9CjEC,kBA8CiED;EAAuB,qBAAA,CAAA,YAAA,EA7CxEP,cA6CwE,CAAA,EAAA,IAAA;EACxFe,eAAAA,CAAAA,CAAAA,EAAAA,IAAoB;EAAA,UAAA,CAAA,CAAA,EA5C1Bd,iBA4C0B;EAAA,OAAcK,YAAAA,CAAAA,QAAAA,EA3CxBL,iBA2CwBK,EAAAA,GAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EA3CUG,eA2CVH;EAAe,QAAgBL,iBAAAA;EAAiB,QAAA,qBAAA;AAE1G;AACUgB,KA1CEP,WAAAA,GA0CO,MAAA,GAAA,aAAA;AAAA,KAzCPC,YAAAA,GAyCO;EAAA;;;EAEsB,SACxBb,CAAAA,EAAAA,MAAAA;EAAW;AACF;AAqB1B;;;;;AAAuD;;;;;;YAhDzCY;;;;;;;gBAOIJ;;;;;;;;;;;iBAWMM,kCAAkCC,MAAMA;iBACxCC,mBAAAA,kBAAqCP,4BAA4BA;iBACjEQ,oBAAAA,cAAkCT,+BAA+BL;;cAEpEe,4CAA4Cd;UACvDe,SAAAA;cACMf,qBAAqBD;iBAClBF;eACFD;YACHa;;;;;;;;;;;;;;;;;;;;;iBAqBUO,KAAAA,OAAYD,YAAYE,QAAQd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"record_manager.d.cts","names":["Serializable","UUIDV5_NAMESPACE","UpdateOptions","ListKeyOptions","RecordManagerInterface","Promise","RecordManager"],"sources":["../../src/indexing/record_manager.d.ts"],"sourcesContent":["import { Serializable } from \"../load/serializable.js\";\n// Arbitrary value, used for generating namespaced UUIDs.\nexport declare const UUIDV5_NAMESPACE = \"10f90ea3-90a4-4962-bf75-83a0f3c1c62a\";\nexport type UpdateOptions = {\n groupIds?: (string | null)[];\n timeAtLeast?: number;\n};\nexport type ListKeyOptions = {\n before?: number;\n after?: number;\n groupIds?: (string | null)[];\n limit?: number;\n};\nexport interface RecordManagerInterface {\n /**\n * Creates schema in the record manager.\n * @returns Promise\n */\n createSchema(): Promise<void>;\n /**\n * Returns current time from the record manager.\n * @returns Current time\n */\n getTime(): Promise<number>;\n /**\n * Updates keys in the record manager.\n * @param keys List of keys to update\n * @param groupIds List of groupIds to update\n * @param timeAtLeast Update only if current time is at least this value\n * @returns Promise\n * @throws Error if timeAtLeast is provided and current time is less than timeAtLeast\n * @throws Error if number of keys does not match number of groupIds\n */\n update(keys: string[], updateOptions: UpdateOptions): Promise<void>;\n /**\n * Checks if keys exist in the record manager.\n * @param keys List of keys to check\n * @returns List of booleans indicating if key exists in same order as provided keys\n */\n exists(keys: string[]): Promise<boolean[]>;\n /**\n * Lists keys from the record manager.\n * @param before List keys before this timestamp\n * @param after List keys after this timestamp\n * @param groupIds List keys with these groupIds\n * @param limit Limit the number of keys returned\n * @returns List of keys\n *\n */\n listKeys(options: ListKeyOptions): Promise<string[]>;\n /**\n * Deletes keys from the record manager.\n * @param keys List of keys to delete\n */\n deleteKeys(keys: string[]): Promise<void>;\n}\nexport declare abstract class RecordManager extends Serializable implements RecordManagerInterface {\n lc_namespace: string[];\n abstract createSchema(): Promise<void>;\n abstract getTime(): Promise<number>;\n abstract update(keys: string[], updateOptions?: UpdateOptions): Promise<void>;\n abstract exists(keys: string[]): Promise<boolean[]>;\n abstract listKeys(options?: ListKeyOptions): Promise<string[]>;\n abstract deleteKeys(keys: string[]): Promise<void>;\n}\n"],"mappings":";;;;cAEqBC,gBAAAA;AAAAA,KACTC,aAAAA,GADyB;EACzBA,QAAAA,CAAAA,EAAAA,CAAAA,MAAa,GAAA,IAAA,CAAA,EAAA;EAIbC,WAAAA,CAAAA,EAAAA,MAAc;AAM1B,CAAA;AAAuC,KAN3BA,cAAAA,GAM2B;EAAA,MAKnBE,CAAAA,EAAAA,MAAAA;EAAO,KAKZA,CAAAA,EAAAA,MAAAA;EAAO,QAUoBH,CAAAA,EAAAA,CAAAA,MAAAA,GAAAA,IAAAA,CAAAA,EAAAA;EAAa,KAAGG,CAAAA,EAAAA,MAAAA;CAAO;AAgB3CF,UApCLC,sBAAAA,CAoCKD;EAAc;;AAKG;AAEvC;EAA2C,YAAA,EAAA,EAtCvBE,OAsCuB,CAAA,IAAA,CAAA;EAAA;;;;EAIgC,OACtCA,EAAAA,EAtCtBA,OAsCsBA,CAAAA,MAAAA,CAAAA;EAAO;;;;;AALsD;;;;wCAvBxDH,gBAAgBG;;;;;;0BAM9BA;;;;;;;;;;oBAUNF,iBAAiBE;;;;;8BAKPA;;uBAEFC,aAAAA,SAAsBN,YAAAA,YAAwBI;;2BAE/CC;sBACLA;kDAC4BH,gBAAgBG;mCAC/BA;8BACLF,iBAAiBE;uCACRA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"record_manager.d.ts","names":["Serializable","UUIDV5_NAMESPACE","UpdateOptions","ListKeyOptions","RecordManagerInterface","Promise","RecordManager"],"sources":["../../src/indexing/record_manager.d.ts"],"sourcesContent":["import { Serializable } from \"../load/serializable.js\";\n// Arbitrary value, used for generating namespaced UUIDs.\nexport declare const UUIDV5_NAMESPACE = \"10f90ea3-90a4-4962-bf75-83a0f3c1c62a\";\nexport type UpdateOptions = {\n groupIds?: (string | null)[];\n timeAtLeast?: number;\n};\nexport type ListKeyOptions = {\n before?: number;\n after?: number;\n groupIds?: (string | null)[];\n limit?: number;\n};\nexport interface RecordManagerInterface {\n /**\n * Creates schema in the record manager.\n * @returns Promise\n */\n createSchema(): Promise<void>;\n /**\n * Returns current time from the record manager.\n * @returns Current time\n */\n getTime(): Promise<number>;\n /**\n * Updates keys in the record manager.\n * @param keys List of keys to update\n * @param groupIds List of groupIds to update\n * @param timeAtLeast Update only if current time is at least this value\n * @returns Promise\n * @throws Error if timeAtLeast is provided and current time is less than timeAtLeast\n * @throws Error if number of keys does not match number of groupIds\n */\n update(keys: string[], updateOptions: UpdateOptions): Promise<void>;\n /**\n * Checks if keys exist in the record manager.\n * @param keys List of keys to check\n * @returns List of booleans indicating if key exists in same order as provided keys\n */\n exists(keys: string[]): Promise<boolean[]>;\n /**\n * Lists keys from the record manager.\n * @param before List keys before this timestamp\n * @param after List keys after this timestamp\n * @param groupIds List keys with these groupIds\n * @param limit Limit the number of keys returned\n * @returns List of keys\n *\n */\n listKeys(options: ListKeyOptions): Promise<string[]>;\n /**\n * Deletes keys from the record manager.\n * @param keys List of keys to delete\n */\n deleteKeys(keys: string[]): Promise<void>;\n}\nexport declare abstract class RecordManager extends Serializable implements RecordManagerInterface {\n lc_namespace: string[];\n abstract createSchema(): Promise<void>;\n abstract getTime(): Promise<number>;\n abstract update(keys: string[], updateOptions?: UpdateOptions): Promise<void>;\n abstract exists(keys: string[]): Promise<boolean[]>;\n abstract listKeys(options?: ListKeyOptions): Promise<string[]>;\n abstract deleteKeys(keys: string[]): Promise<void>;\n}\n"],"mappings":";;;;cAEqBC,gBAAAA;AAAAA,KACTC,aAAAA,GADyB;EACzBA,QAAAA,CAAAA,EAAAA,CAAAA,MAAa,GAAA,IAAA,CAAA,EAAA;EAIbC,WAAAA,CAAAA,EAAAA,MAAc;AAM1B,CAAA;AAAuC,KAN3BA,cAAAA,GAM2B;EAAA,MAKnBE,CAAAA,EAAAA,MAAAA;EAAO,KAKZA,CAAAA,EAAAA,MAAAA;EAAO,QAUoBH,CAAAA,EAAAA,CAAAA,MAAAA,GAAAA,IAAAA,CAAAA,EAAAA;EAAa,KAAGG,CAAAA,EAAAA,MAAAA;CAAO;AAgB3CF,UApCLC,sBAAAA,CAoCKD;EAAc;;AAKG;AAEvC;EAA2C,YAAA,EAAA,EAtCvBE,OAsCuB,CAAA,IAAA,CAAA;EAAA;;;;EAIgC,OACtCA,EAAAA,EAtCtBA,OAsCsBA,CAAAA,MAAAA,CAAAA;EAAO;;;;;AALsD;;;;wCAvBxDH,gBAAgBG;;;;;;0BAM9BA;;;;;;;;;;oBAUNF,iBAAiBE;;;;;8BAKPA;;uBAEFC,aAAAA,SAAsBN,YAAAA,YAAwBI;;2BAE/CC;sBACLA;kDAC4BH,gBAAgBG;mCAC/BA;8BACLF,iBAAiBE;uCACRA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.cts","names":["TiktokenModel","ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseCache","BasePromptValueInterface","BaseMessage","BaseMessageLike","MessageContent","LLMResult","CallbackManager","Callbacks","AsyncCaller","AsyncCallerParams","Runnable","RunnableInterface","RunnableConfig","JSONSchema","InferInteropZodOutput","InteropZodObject","InteropZodType","ModelProfile","getModelNameForTiktoken","getEmbeddingContextSize","getModelContextSize","isOpenAITool","ToolDefinition","CalculateMaxTokenProps","calculateMaxTokens","prompt","modelName","Promise","SerializedLLM","Record","BaseLangChainParams","BaseLangChain","RunInput","RunOutput","CallOptions","BaseLanguageModelParams","BaseLanguageModelTracingCallOptions","BaseLanguageModelCallOptions","FunctionDefinition","FunctionCallOption","BaseFunctionCallOptions","BaseLanguageModelInput","StructuredOutputType","StructuredOutputMethodOptions","IncludeRaw","StructuredOutputMethodParams","BaseLanguageModelInterface","LanguageModelOutput","LanguageModelLike","BaseLanguageModel","callbacks","callbackManager","config","TokenUsage"],"sources":["../../src/language_models/base.d.ts"],"sourcesContent":["import type { TiktokenModel } from \"js-tiktoken/lite\";\nimport type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseCache } from \"../caches/base.js\";\nimport { type BasePromptValueInterface } from \"../prompt_values.js\";\nimport { type BaseMessage, type BaseMessageLike, type MessageContent } from \"../messages/base.js\";\nimport { type LLMResult } from \"../outputs.js\";\nimport { CallbackManager, Callbacks } from \"../callbacks/manager.js\";\nimport { AsyncCaller, AsyncCallerParams } from \"../utils/async_caller.js\";\nimport { Runnable, type RunnableInterface } from \"../runnables/base.js\";\nimport { RunnableConfig } from \"../runnables/config.js\";\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport { InferInteropZodOutput, InteropZodObject, InteropZodType } from \"../utils/types/zod.js\";\nimport { ModelProfile } from \"./profile.js\";\n// https://www.npmjs.com/package/js-tiktoken\nexport declare const getModelNameForTiktoken: (modelName: string) => TiktokenModel;\nexport declare const getEmbeddingContextSize: (modelName?: string | undefined) => number;\n/**\n * Get the context window size (max input tokens) for a given model.\n *\n * Context window sizes are sourced from official model documentation:\n * - OpenAI: https://platform.openai.com/docs/models\n * - Anthropic: https://docs.anthropic.com/claude/docs/models-overview\n * - Google: https://ai.google.dev/gemini/docs/models/gemini\n *\n * @param modelName - The name of the model\n * @returns The context window size in tokens\n */\nexport declare const getModelContextSize: (modelName: string) => number;\n/**\n * Whether or not the input matches the OpenAI tool definition.\n * @param {unknown} tool The input to check.\n * @returns {boolean} Whether the input is an OpenAI tool definition.\n */\nexport declare function isOpenAITool(tool: unknown): tool is ToolDefinition;\ninterface CalculateMaxTokenProps {\n prompt: string;\n modelName: TiktokenModel;\n}\nexport declare const calculateMaxTokens: ({ prompt, modelName, }: CalculateMaxTokenProps) => Promise<number>;\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\nexport interface BaseLangChainParams {\n verbose?: boolean;\n callbacks?: Callbacks;\n tags?: string[];\n metadata?: Record<string, unknown>;\n}\n/**\n * Base class for language models, chains, tools.\n */\nexport declare abstract class BaseLangChain<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> implements BaseLangChainParams {\n /**\n * Whether to print out response text.\n */\n verbose: boolean;\n callbacks?: Callbacks;\n tags?: string[];\n metadata?: Record<string, unknown>;\n get lc_attributes(): {\n [key: string]: undefined;\n } | undefined;\n constructor(params: BaseLangChainParams);\n}\n/**\n * Base interface for language model parameters.\n * A subclass of {@link BaseLanguageModel} should have a constructor that\n * takes in a parameter that extends this interface.\n */\nexport interface BaseLanguageModelParams extends AsyncCallerParams, BaseLangChainParams {\n /**\n * @deprecated Use `callbacks` instead\n */\n callbackManager?: CallbackManager;\n cache?: BaseCache | boolean;\n}\nexport interface BaseLanguageModelTracingCallOptions {\n /**\n * Describes the format of structured outputs.\n * This should be provided if an output is considered to be structured\n */\n ls_structured_output_format?: {\n /**\n * An object containing the method used for structured output (e.g., \"jsonMode\").\n */\n kwargs: {\n method: string;\n };\n /**\n * The JSON schema describing the expected output structure.\n */\n schema?: JSONSchema;\n };\n}\nexport interface BaseLanguageModelCallOptions extends RunnableConfig, BaseLanguageModelTracingCallOptions {\n /**\n * Stop tokens to use for this call.\n * If not provided, the default stop tokens for the model will be used.\n */\n stop?: string[];\n}\nexport interface FunctionDefinition {\n /**\n * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain\n * underscores and dashes, with a maximum length of 64.\n */\n name: string;\n /**\n * The parameters the functions accepts, described as a JSON Schema object. See the\n * [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for\n * examples, and the\n * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\n * documentation about the format.\n *\n * To describe a function that accepts no parameters, provide the value\n * `{\"type\": \"object\", \"properties\": {}}`.\n */\n parameters: Record<string, unknown> | JSONSchema;\n /**\n * A description of what the function does, used by the model to choose when and\n * how to call the function.\n */\n description?: string;\n}\nexport interface ToolDefinition {\n type: \"function\";\n function: FunctionDefinition;\n}\nexport type FunctionCallOption = {\n name: string;\n};\nexport interface BaseFunctionCallOptions extends BaseLanguageModelCallOptions {\n function_call?: FunctionCallOption;\n functions?: FunctionDefinition[];\n}\nexport type BaseLanguageModelInput = BasePromptValueInterface | string | BaseMessageLike[];\nexport type StructuredOutputType = InferInteropZodOutput<InteropZodObject>;\nexport type StructuredOutputMethodOptions<IncludeRaw extends boolean = false> = {\n name?: string;\n method?: \"functionCalling\" | \"jsonMode\" | \"jsonSchema\" | string;\n includeRaw?: IncludeRaw;\n /** Whether to use strict mode. Currently only supported by OpenAI models. */\n strict?: boolean;\n};\n/** @deprecated Use StructuredOutputMethodOptions instead */\nexport type StructuredOutputMethodParams<RunOutput, IncludeRaw extends boolean = false> = {\n /** @deprecated Pass schema in as the first argument */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: InteropZodType<RunOutput> | Record<string, any>;\n name?: string;\n method?: \"functionCalling\" | \"jsonMode\";\n includeRaw?: IncludeRaw;\n};\nexport interface BaseLanguageModelInterface<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nRunOutput = any, CallOptions extends BaseLanguageModelCallOptions = BaseLanguageModelCallOptions> extends RunnableInterface<BaseLanguageModelInput, RunOutput, CallOptions> {\n get callKeys(): string[];\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n _modelType(): string;\n _llmType(): string;\n getNumTokens(content: MessageContent): Promise<number>;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n serialize(): SerializedLLM;\n}\nexport type LanguageModelOutput = BaseMessage | string;\nexport type LanguageModelLike = Runnable<BaseLanguageModelInput, LanguageModelOutput>;\n/**\n * Base class for language models.\n */\nexport declare abstract class BaseLanguageModel<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nRunOutput = any, CallOptions extends BaseLanguageModelCallOptions = BaseLanguageModelCallOptions> extends BaseLangChain<BaseLanguageModelInput, RunOutput, CallOptions> implements BaseLanguageModelParams, BaseLanguageModelInterface<RunOutput, CallOptions> {\n /**\n * Keys that the language model accepts as call options.\n */\n get callKeys(): string[];\n /**\n * The async caller should be used by subclasses to make any async calls,\n * which will thus benefit from the concurrency and retry logic.\n */\n caller: AsyncCaller;\n cache?: BaseCache;\n constructor({ callbacks, callbackManager, ...params }: BaseLanguageModelParams);\n abstract generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _modelType(): string;\n abstract _llmType(): string;\n private _encoding?;\n /**\n * Get the number of tokens in the content.\n * @param content The content to get the number of tokens for.\n * @returns The number of tokens in the content.\n */\n getNumTokens(content: MessageContent): Promise<number>;\n protected static _convertInputToPromptValue(input: BaseLanguageModelInput): BasePromptValueInterface;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n /**\n * Create a unique cache key for a specific call to a specific language model.\n * @param callOptions Call options for the model\n * @returns A unique cache key.\n */\n _getSerializedCacheKeyParametersForCall(\n // TODO: Fix when we remove the RunnableLambda backwards compatibility shim.\n { config, ...callOptions }: CallOptions & {\n config?: RunnableConfig;\n }): string;\n /**\n * @deprecated\n * Return a json-like object representing this LLM.\n */\n serialize(): SerializedLLM;\n /**\n * @deprecated\n * Load an LLM from a json-like object describing it.\n */\n static deserialize(_data: SerializedLLM): Promise<BaseLanguageModel>;\n /**\n * Return profiling information for the model.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n /**\n * Model wrapper that returns outputs formatted to match the given schema.\n *\n * @template {BaseLanguageModelInput} RunInput The input type for the Runnable, expected to be the same input for the LLM.\n * @template {Record<string, any>} RunOutput The output type for the Runnable, expected to be a Zod schema object for structured output validation.\n *\n * @param {InteropZodType<RunOutput>} schema The schema for the structured output. Either as a Zod schema or a valid JSON schema object.\n * If a Zod schema is passed, the returned attributes will be validated, whereas with JSON schema they will not be.\n * @param {string} name The name of the function to call.\n * @param {\"functionCalling\" | \"jsonMode\"} [method=functionCalling] The method to use for getting the structured output. Defaults to \"functionCalling\".\n * @param {boolean | undefined} [includeRaw=false] Whether to include the raw output in the result. Defaults to false.\n * @returns {Runnable<RunInput, RunOutput> | Runnable<RunInput, { raw: BaseMessage; parsed: RunOutput }>} A new runnable that calls the LLM with structured output.\n */\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * Shared interface for token usage\n * return type from LLM calls.\n */\nexport interface TokenUsage {\n completionTokens?: number;\n promptTokens?: number;\n totalTokens?: number;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;cAeqBuB,gDAAgDvB;AAAhDuB,cACAC,uBADgDxB,EAAAA,CAAAA,SAAa,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,MAAA;AAClF;AAYA;AAMA;AAA4E;AAK5E;;;;;;AAAoG;AACxFiC,cAZSR,mBAeX,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GAAA,MAAA;AACV;;;;AAIqB;AAKSW,iBAnBNV,YAAAA,CAmBmB,IAAA,EAAA,OAAA,CAAA,EAAA,IAA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,CAAAA,EAAAA,MAAAA;EAAM,SAAwBc,QAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAA6B,QAAqBF,SAAAA;EAAsB;;;;;EAEpF,YAFmG/B,CAAAA,OAAAA,EA5ElGN,cA4EkGM,CAAAA,EA5EjFiB,OA4EiFjB,CAAAA,MAAAA,CAAAA;EAAQ,iBAjG1BqB,0BAAAA,CAAAA,KAAAA,EAsBnDU,sBAtBmDV,CAAAA,EAsB1B9B,wBAtB0B8B;EAAa;;AAA+G;EA0GrNsB;wBA/ESxB;;;;;;;;;;;KAQMK;aACftB;;;;;;eAMAgB;;;;;4BAKaA,gBAAgBD,QAAQsB;;;;;;iBAMnChC;;;oBAGGY,sBAAsBA,6BAA6BhC,QAAUoC;;IAE5EJ,8BAA8Bc,uCAAuCjC,SAAS+B,wBAAwBR;;;oBAGvFJ,sBAAsBA,6BAA6BhC,QAAUoC;;IAE5EJ,8BAA8Bc,sCAAsCjC,SAAS+B;SACvEvC;YACG+B;;;;oBAIMJ,sBAAsBA,6BAA6B9B,SAAUkC;;IAE5EJ,8BAA8Bc,uCAAuCjC,SAAS+B,wBAAwBR;;;oBAGvFJ,sBAAsBA,6BAA6B9B,SAAUkC;;IAE5EJ,8BAA8Bc,sCAAsCjC,SAAS+B;SACvEvC;YACG+B;;;;;;;;;;;;;;;;;oBAiBMJ,sBAAsBA,6BAA6Bb,eAAeiB;;IAEjFJ,8BAA8Bc,yCAAyCjC,SAAS+B,wBAAwBR,aAAavB,SAAS+B;SACxHvC;YACG+B;;;;;;;UAOCoB,UAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","names":["TiktokenModel","ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseCache","BasePromptValueInterface","BaseMessage","BaseMessageLike","MessageContent","LLMResult","CallbackManager","Callbacks","AsyncCaller","AsyncCallerParams","Runnable","RunnableInterface","RunnableConfig","JSONSchema","InferInteropZodOutput","InteropZodObject","InteropZodType","ModelProfile","getModelNameForTiktoken","getEmbeddingContextSize","getModelContextSize","isOpenAITool","ToolDefinition","CalculateMaxTokenProps","calculateMaxTokens","prompt","modelName","Promise","SerializedLLM","Record","BaseLangChainParams","BaseLangChain","RunInput","RunOutput","CallOptions","BaseLanguageModelParams","BaseLanguageModelTracingCallOptions","BaseLanguageModelCallOptions","FunctionDefinition","FunctionCallOption","BaseFunctionCallOptions","BaseLanguageModelInput","StructuredOutputType","StructuredOutputMethodOptions","IncludeRaw","StructuredOutputMethodParams","BaseLanguageModelInterface","LanguageModelOutput","LanguageModelLike","BaseLanguageModel","callbacks","callbackManager","config","TokenUsage"],"sources":["../../src/language_models/base.d.ts"],"sourcesContent":["import type { TiktokenModel } from \"js-tiktoken/lite\";\nimport type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseCache } from \"../caches/base.js\";\nimport { type BasePromptValueInterface } from \"../prompt_values.js\";\nimport { type BaseMessage, type BaseMessageLike, type MessageContent } from \"../messages/base.js\";\nimport { type LLMResult } from \"../outputs.js\";\nimport { CallbackManager, Callbacks } from \"../callbacks/manager.js\";\nimport { AsyncCaller, AsyncCallerParams } from \"../utils/async_caller.js\";\nimport { Runnable, type RunnableInterface } from \"../runnables/base.js\";\nimport { RunnableConfig } from \"../runnables/config.js\";\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport { InferInteropZodOutput, InteropZodObject, InteropZodType } from \"../utils/types/zod.js\";\nimport { ModelProfile } from \"./profile.js\";\n// https://www.npmjs.com/package/js-tiktoken\nexport declare const getModelNameForTiktoken: (modelName: string) => TiktokenModel;\nexport declare const getEmbeddingContextSize: (modelName?: string | undefined) => number;\n/**\n * Get the context window size (max input tokens) for a given model.\n *\n * Context window sizes are sourced from official model documentation:\n * - OpenAI: https://platform.openai.com/docs/models\n * - Anthropic: https://docs.anthropic.com/claude/docs/models-overview\n * - Google: https://ai.google.dev/gemini/docs/models/gemini\n *\n * @param modelName - The name of the model\n * @returns The context window size in tokens\n */\nexport declare const getModelContextSize: (modelName: string) => number;\n/**\n * Whether or not the input matches the OpenAI tool definition.\n * @param {unknown} tool The input to check.\n * @returns {boolean} Whether the input is an OpenAI tool definition.\n */\nexport declare function isOpenAITool(tool: unknown): tool is ToolDefinition;\ninterface CalculateMaxTokenProps {\n prompt: string;\n modelName: TiktokenModel;\n}\nexport declare const calculateMaxTokens: ({ prompt, modelName, }: CalculateMaxTokenProps) => Promise<number>;\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\nexport interface BaseLangChainParams {\n verbose?: boolean;\n callbacks?: Callbacks;\n tags?: string[];\n metadata?: Record<string, unknown>;\n}\n/**\n * Base class for language models, chains, tools.\n */\nexport declare abstract class BaseLangChain<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> implements BaseLangChainParams {\n /**\n * Whether to print out response text.\n */\n verbose: boolean;\n callbacks?: Callbacks;\n tags?: string[];\n metadata?: Record<string, unknown>;\n get lc_attributes(): {\n [key: string]: undefined;\n } | undefined;\n constructor(params: BaseLangChainParams);\n}\n/**\n * Base interface for language model parameters.\n * A subclass of {@link BaseLanguageModel} should have a constructor that\n * takes in a parameter that extends this interface.\n */\nexport interface BaseLanguageModelParams extends AsyncCallerParams, BaseLangChainParams {\n /**\n * @deprecated Use `callbacks` instead\n */\n callbackManager?: CallbackManager;\n cache?: BaseCache | boolean;\n}\nexport interface BaseLanguageModelTracingCallOptions {\n /**\n * Describes the format of structured outputs.\n * This should be provided if an output is considered to be structured\n */\n ls_structured_output_format?: {\n /**\n * An object containing the method used for structured output (e.g., \"jsonMode\").\n */\n kwargs: {\n method: string;\n };\n /**\n * The JSON schema describing the expected output structure.\n */\n schema?: JSONSchema;\n };\n}\nexport interface BaseLanguageModelCallOptions extends RunnableConfig, BaseLanguageModelTracingCallOptions {\n /**\n * Stop tokens to use for this call.\n * If not provided, the default stop tokens for the model will be used.\n */\n stop?: string[];\n}\nexport interface FunctionDefinition {\n /**\n * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain\n * underscores and dashes, with a maximum length of 64.\n */\n name: string;\n /**\n * The parameters the functions accepts, described as a JSON Schema object. See the\n * [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for\n * examples, and the\n * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\n * documentation about the format.\n *\n * To describe a function that accepts no parameters, provide the value\n * `{\"type\": \"object\", \"properties\": {}}`.\n */\n parameters: Record<string, unknown> | JSONSchema;\n /**\n * A description of what the function does, used by the model to choose when and\n * how to call the function.\n */\n description?: string;\n}\nexport interface ToolDefinition {\n type: \"function\";\n function: FunctionDefinition;\n}\nexport type FunctionCallOption = {\n name: string;\n};\nexport interface BaseFunctionCallOptions extends BaseLanguageModelCallOptions {\n function_call?: FunctionCallOption;\n functions?: FunctionDefinition[];\n}\nexport type BaseLanguageModelInput = BasePromptValueInterface | string | BaseMessageLike[];\nexport type StructuredOutputType = InferInteropZodOutput<InteropZodObject>;\nexport type StructuredOutputMethodOptions<IncludeRaw extends boolean = false> = {\n name?: string;\n method?: \"functionCalling\" | \"jsonMode\" | \"jsonSchema\" | string;\n includeRaw?: IncludeRaw;\n /** Whether to use strict mode. Currently only supported by OpenAI models. */\n strict?: boolean;\n};\n/** @deprecated Use StructuredOutputMethodOptions instead */\nexport type StructuredOutputMethodParams<RunOutput, IncludeRaw extends boolean = false> = {\n /** @deprecated Pass schema in as the first argument */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: InteropZodType<RunOutput> | Record<string, any>;\n name?: string;\n method?: \"functionCalling\" | \"jsonMode\";\n includeRaw?: IncludeRaw;\n};\nexport interface BaseLanguageModelInterface<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nRunOutput = any, CallOptions extends BaseLanguageModelCallOptions = BaseLanguageModelCallOptions> extends RunnableInterface<BaseLanguageModelInput, RunOutput, CallOptions> {\n get callKeys(): string[];\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n _modelType(): string;\n _llmType(): string;\n getNumTokens(content: MessageContent): Promise<number>;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n serialize(): SerializedLLM;\n}\nexport type LanguageModelOutput = BaseMessage | string;\nexport type LanguageModelLike = Runnable<BaseLanguageModelInput, LanguageModelOutput>;\n/**\n * Base class for language models.\n */\nexport declare abstract class BaseLanguageModel<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nRunOutput = any, CallOptions extends BaseLanguageModelCallOptions = BaseLanguageModelCallOptions> extends BaseLangChain<BaseLanguageModelInput, RunOutput, CallOptions> implements BaseLanguageModelParams, BaseLanguageModelInterface<RunOutput, CallOptions> {\n /**\n * Keys that the language model accepts as call options.\n */\n get callKeys(): string[];\n /**\n * The async caller should be used by subclasses to make any async calls,\n * which will thus benefit from the concurrency and retry logic.\n */\n caller: AsyncCaller;\n cache?: BaseCache;\n constructor({ callbacks, callbackManager, ...params }: BaseLanguageModelParams);\n abstract generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _modelType(): string;\n abstract _llmType(): string;\n private _encoding?;\n /**\n * Get the number of tokens in the content.\n * @param content The content to get the number of tokens for.\n * @returns The number of tokens in the content.\n */\n getNumTokens(content: MessageContent): Promise<number>;\n protected static _convertInputToPromptValue(input: BaseLanguageModelInput): BasePromptValueInterface;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n /**\n * Create a unique cache key for a specific call to a specific language model.\n * @param callOptions Call options for the model\n * @returns A unique cache key.\n */\n _getSerializedCacheKeyParametersForCall(\n // TODO: Fix when we remove the RunnableLambda backwards compatibility shim.\n { config, ...callOptions }: CallOptions & {\n config?: RunnableConfig;\n }): string;\n /**\n * @deprecated\n * Return a json-like object representing this LLM.\n */\n serialize(): SerializedLLM;\n /**\n * @deprecated\n * Load an LLM from a json-like object describing it.\n */\n static deserialize(_data: SerializedLLM): Promise<BaseLanguageModel>;\n /**\n * Return profiling information for the model.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n */\n get profile(): ModelProfile;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n /**\n * Model wrapper that returns outputs formatted to match the given schema.\n *\n * @template {BaseLanguageModelInput} RunInput The input type for the Runnable, expected to be the same input for the LLM.\n * @template {Record<string, any>} RunOutput The output type for the Runnable, expected to be a Zod schema object for structured output validation.\n *\n * @param {InteropZodType<RunOutput>} schema The schema for the structured output. Either as a Zod schema or a valid JSON schema object.\n * If a Zod schema is passed, the returned attributes will be validated, whereas with JSON schema they will not be.\n * @param {string} name The name of the function to call.\n * @param {\"functionCalling\" | \"jsonMode\"} [method=functionCalling] The method to use for getting the structured output. Defaults to \"functionCalling\".\n * @param {boolean | undefined} [includeRaw=false] Whether to include the raw output in the result. Defaults to false.\n * @returns {Runnable<RunInput, RunOutput> | Runnable<RunInput, { raw: BaseMessage; parsed: RunOutput }>} A new runnable that calls the LLM with structured output.\n */\n withStructuredOutput?<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * Shared interface for token usage\n * return type from LLM calls.\n */\nexport interface TokenUsage {\n completionTokens?: number;\n promptTokens?: number;\n totalTokens?: number;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;cAeqBuB,gDAAgDvB;AAAhDuB,cACAC,uBADgDxB,EAAAA,CAAAA,SAAa,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,MAAA;AAClF;AAYA;AAMA;AAA4E;AAK5E;;;;;;AAAoG;AACxFiC,cAZSR,mBAeX,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GAAA,MAAA;AACV;;;;AAIqB;AAKSW,iBAnBNV,YAAAA,CAmBmB,IAAA,EAAA,OAAA,CAAA,EAAA,IAAA,IAnBkBC,cAmBlB;UAlBjCC,sBAAAA,CAkBiC;EAAA,MAA0CX,EAAAA,MAAAA;EAAc,SAAGA,EAhBvFjB,aAgBuFiB;;AAA2CqB,cAd5HT,kBAc4HS,EAAAA,CAAAA;EAAAA,MA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A,EA5EjFiB,OA4EiFjB,CAAAA,MAAAA,CAAAA;EAAQ,iBAjG1BqB,0BAAAA,CAAAA,KAAAA,EAsBnDU,sBAtBmDV,CAAAA,EAsB1B9B,wBAtB0B8B;EAAa;;AAA+G;EA0GrNsB;wBA/ESxB;;;;;;;;;;;KAQMK;aACftB;;;;;;eAMAgB;;;;;4BAKaA,gBAAgBD,QAAQsB;;;;;;iBAMnChC;;;oBAGGY,sBAAsBA,6BAA6BhC,QAAUoC;;IAE5EJ,8BAA8Bc,uCAAuCjC,SAAS+B,wBAAwBR;;;oBAGvFJ,sBAAsBA,6BAA6BhC,QAAUoC;;IAE5EJ,8BAA8Bc,sCAAsCjC,SAAS+B;SACvEvC;YACG+B;;;;oBAIMJ,sBAAsBA,6BAA6B9B,SAAUkC;;IAE5EJ,8BAA8Bc,uCAAuCjC,SAAS+B,wBAAwBR;;;oBAGvFJ,sBAAsBA,6BAA6B9B,SAAUkC;;IAE5EJ,8BAA8Bc,sCAAsCjC,SAAS+B;SACvEvC;YACG+B;;;;;;;;;;;;;;;;;oBAiBMJ,sBAAsBA,6BAA6Bb,eAAeiB;;IAEjFJ,8BAA8Bc,yCAAyCjC,SAAS+B,wBAAwBR,aAAavB,SAAS+B;SACxHvC;YACG+B;;;;;;;UAOCoB,UAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_models.d.cts","names":["ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseMessage","BaseMessageChunk","BaseMessageLike","AIMessageChunk","MessageOutputVersion","BasePromptValueInterface","LLMResult","ChatGenerationChunk","ChatResult","Generation","BaseLanguageModel","StructuredOutputMethodOptions","ToolDefinition","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","CallbackManagerForLLMRun","Callbacks","RunnableConfig","BaseCache","StructuredToolInterface","StructuredToolParams","Runnable","RunnableToolLike","ToolChoice","Record","SerializedChatModel","SerializedLLM","BaseChatModelParams","BaseChatModelCallOptions","LangSmithParams","Array","BindToolsInput","BaseChatModel","OutputMessageType","CallOptions","Exclude","Omit","Partial","Promise","AsyncGenerator","messages","cache","llmStringKey","parsedOptions","handledOptions","RunOutput","SimpleChatModel"],"sources":["../../src/language_models/chat_models.d.ts"],"sourcesContent":["import type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseMessage, BaseMessageChunk, type BaseMessageLike, AIMessageChunk, MessageOutputVersion } from \"../messages/index.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { LLMResult, ChatGenerationChunk, type ChatResult, type Generation } from \"../outputs.js\";\nimport { BaseLanguageModel, type StructuredOutputMethodOptions, type ToolDefinition, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport { type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/base.js\";\nimport { StructuredToolInterface, StructuredToolParams } from \"../tools/index.js\";\nimport { Runnable, RunnableToolLike } from \"../runnables/base.js\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ToolChoice = string | Record<string, any> | \"auto\" | \"any\";\n/**\n * Represents a serialized chat model.\n */\nexport type SerializedChatModel = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n// todo?\n/**\n * Represents a serialized large language model.\n */\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents the parameters for a base chat model.\n */\nexport type BaseChatModelParams = BaseLanguageModelParams & {\n /**\n * Whether to disable streaming.\n *\n * If streaming is bypassed, then `stream()` will defer to\n * `invoke()`.\n *\n * - If true, will always bypass streaming case.\n * - If false (default), will always use streaming case if available.\n */\n disableStreaming?: boolean;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\n/**\n * Represents the call options for a base chat model.\n */\nexport type BaseChatModelCallOptions = BaseLanguageModelCallOptions & {\n /**\n * Specifies how the chat model should use tools.\n * @default undefined\n *\n * Possible values:\n * - \"auto\": The model may choose to use any of the provided tools, or none.\n * - \"any\": The model must use one of the provided tools.\n * - \"none\": The model must not use any tools.\n * - A string (not \"auto\", \"any\", or \"none\"): The name of a specific tool the model must use.\n * - An object: A custom schema specifying tool choice parameters. Specific to the provider.\n *\n * Note: Not all providers support tool_choice. An error will be thrown\n * if used with an unsupported model.\n */\n tool_choice?: ToolChoice;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\nexport type LangSmithParams = {\n ls_provider?: string;\n ls_model_name?: string;\n ls_model_type: \"chat\";\n ls_temperature?: number;\n ls_max_tokens?: number;\n ls_stop?: Array<string>;\n};\nexport type BindToolsInput = StructuredToolInterface\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any> | ToolDefinition | RunnableToolLike | StructuredToolParams;\n/**\n * Base class for chat models. It extends the BaseLanguageModel class and\n * provides methods for generating chat based on input messages.\n */\nexport declare abstract class BaseChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions, \n// TODO: Fix the parameter order on the next minor version.\nOutputMessageType extends BaseMessageChunk = AIMessageChunk> extends BaseLanguageModel<OutputMessageType, CallOptions> {\n // Backwards compatibility since fields have been moved to RunnableConfig\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n // Only ever instantiated in main LangChain\n lc_namespace: string[];\n disableStreaming: boolean;\n outputVersion?: MessageOutputVersion;\n get callKeys(): string[];\n constructor(fields: BaseChatModelParams);\n _combineLLMOutput?(...llmOutputs: LLMResult[\"llmOutput\"][]): LLMResult[\"llmOutput\"];\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or an object\n * matching the provider's specific tool schema.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools?(tools: BindToolsInput[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, OutputMessageType, CallOptions>;\n /**\n * Invokes the chat model with a single input.\n * @param input The input for the language model.\n * @param options The call options.\n * @returns A Promise that resolves to a BaseMessageChunk.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<OutputMessageType>;\n // eslint-disable-next-line require-yield\n _streamResponseChunks(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<OutputMessageType>;\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _generateUncached(messages: BaseMessageLike[][], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: RunnableConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ messages, cache, llmStringKey, parsedOptions, handledOptions }: {\n messages: BaseMessageLike[][];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsedOptions: any;\n handledOptions: RunnableConfig;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Generates chat based on the input messages.\n * @param messages An array of arrays of BaseMessage instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generate(messages: BaseMessageLike[][], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _modelType(): string;\n abstract _llmType(): string;\n /**\n * Generates a prompt based on the input prompt values.\n * @param promptValues An array of BasePromptValue instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * An abstract class that extends BaseChatModel and provides a simple\n * implementation of _generate.\n */\nexport declare abstract class SimpleChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions> extends BaseChatModel<CallOptions> {\n abstract _call(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;KAYY4B,UAAAA,YAAsBC;;;AAAlC;AAIYC,KAAAA,mBAAAA,GAAmB;EAQnBC,MAAAA,EAAAA,MAAAA;EAOAC,KAAAA,EAAAA,MAAAA;CAAmB,GAZ3BH,MAY2B,CAAA,MAAA,EAAA,GAAA,CAAA;;;AA0BS;AAKxC;AAAoC,KAtCxBE,aAAAA,GAsCwB;EAAA,MAAGd,EAAAA,MAAAA;EAA4B,KAejDW,EAAAA,MAAAA;CAAU,GAlDxBC,MAkEgBrB,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAAoB;AAExC;AAQA;AAA0B,KAxEdwB,mBAAAA,GAAsBb,uBAwER,GAAA;EAAA;;;;;AAEuD;AAKjF;;;EAAwF,gBAAGc,CAAAA,EAAAA,OAAAA;EAAwB;;;;;;;;;;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,sBAAsBA,mCAAmC5B,QAAUiD;;IAElFrB,8BAA8Bd,sCAAsCW,SAASR;SACvEd;YACG8C;;;;;;;uBAOcC,oCAAoClB,2BAA2BA,kCAAkCI,cAAcE;2BAChHnC,gEAAgEgB,2BAA2BuB;sBAChGvC,gEAAgEgB,2BAA2BuB,QAAQ/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_models.d.ts","names":["ZodType","ZodTypeV3","$ZodType","ZodTypeV4","BaseMessage","BaseMessageChunk","BaseMessageLike","AIMessageChunk","MessageOutputVersion","BasePromptValueInterface","LLMResult","ChatGenerationChunk","ChatResult","Generation","BaseLanguageModel","StructuredOutputMethodOptions","ToolDefinition","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","CallbackManagerForLLMRun","Callbacks","RunnableConfig","BaseCache","StructuredToolInterface","StructuredToolParams","Runnable","RunnableToolLike","ToolChoice","Record","SerializedChatModel","SerializedLLM","BaseChatModelParams","BaseChatModelCallOptions","LangSmithParams","Array","BindToolsInput","BaseChatModel","OutputMessageType","CallOptions","Exclude","Omit","Partial","Promise","AsyncGenerator","messages","cache","llmStringKey","parsedOptions","handledOptions","RunOutput","SimpleChatModel"],"sources":["../../src/language_models/chat_models.d.ts"],"sourcesContent":["import type { ZodType as ZodTypeV3 } from \"zod/v3\";\nimport type { $ZodType as ZodTypeV4 } from \"zod/v4/core\";\nimport { type BaseMessage, BaseMessageChunk, type BaseMessageLike, AIMessageChunk, MessageOutputVersion } from \"../messages/index.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { LLMResult, ChatGenerationChunk, type ChatResult, type Generation } from \"../outputs.js\";\nimport { BaseLanguageModel, type StructuredOutputMethodOptions, type ToolDefinition, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport { type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/base.js\";\nimport { StructuredToolInterface, StructuredToolParams } from \"../tools/index.js\";\nimport { Runnable, RunnableToolLike } from \"../runnables/base.js\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ToolChoice = string | Record<string, any> | \"auto\" | \"any\";\n/**\n * Represents a serialized chat model.\n */\nexport type SerializedChatModel = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n// todo?\n/**\n * Represents a serialized large language model.\n */\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\n/**\n * Represents the parameters for a base chat model.\n */\nexport type BaseChatModelParams = BaseLanguageModelParams & {\n /**\n * Whether to disable streaming.\n *\n * If streaming is bypassed, then `stream()` will defer to\n * `invoke()`.\n *\n * - If true, will always bypass streaming case.\n * - If false (default), will always use streaming case if available.\n */\n disableStreaming?: boolean;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\n/**\n * Represents the call options for a base chat model.\n */\nexport type BaseChatModelCallOptions = BaseLanguageModelCallOptions & {\n /**\n * Specifies how the chat model should use tools.\n * @default undefined\n *\n * Possible values:\n * - \"auto\": The model may choose to use any of the provided tools, or none.\n * - \"any\": The model must use one of the provided tools.\n * - \"none\": The model must not use any tools.\n * - A string (not \"auto\", \"any\", or \"none\"): The name of a specific tool the model must use.\n * - An object: A custom schema specifying tool choice parameters. Specific to the provider.\n *\n * Note: Not all providers support tool_choice. An error will be thrown\n * if used with an unsupported model.\n */\n tool_choice?: ToolChoice;\n /**\n * Version of `AIMessage` output format to store in message content.\n *\n * `AIMessage.contentBlocks` will lazily parse the contents of `content` into a\n * standard format. This flag can be used to additionally store the standard format\n * as the message content, e.g., for serialization purposes.\n *\n * - \"v0\": provider-specific format in content (can lazily parse with `.contentBlocks`)\n * - \"v1\": standardized format in content (consistent with `.contentBlocks`)\n *\n * You can also set `LC_OUTPUT_VERSION` as an environment variable to \"v1\" to\n * enable this by default.\n *\n * @default \"v0\"\n */\n outputVersion?: MessageOutputVersion;\n};\nexport type LangSmithParams = {\n ls_provider?: string;\n ls_model_name?: string;\n ls_model_type: \"chat\";\n ls_temperature?: number;\n ls_max_tokens?: number;\n ls_stop?: Array<string>;\n};\nexport type BindToolsInput = StructuredToolInterface\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any> | ToolDefinition | RunnableToolLike | StructuredToolParams;\n/**\n * Base class for chat models. It extends the BaseLanguageModel class and\n * provides methods for generating chat based on input messages.\n */\nexport declare abstract class BaseChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions, \n// TODO: Fix the parameter order on the next minor version.\nOutputMessageType extends BaseMessageChunk = AIMessageChunk> extends BaseLanguageModel<OutputMessageType, CallOptions> {\n // Backwards compatibility since fields have been moved to RunnableConfig\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n // Only ever instantiated in main LangChain\n lc_namespace: string[];\n disableStreaming: boolean;\n outputVersion?: MessageOutputVersion;\n get callKeys(): string[];\n constructor(fields: BaseChatModelParams);\n _combineLLMOutput?(...llmOutputs: LLMResult[\"llmOutput\"][]): LLMResult[\"llmOutput\"];\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n /**\n * Bind tool-like objects to this chat model.\n *\n * @param tools A list of tool definitions to bind to this chat model.\n * Can be a structured tool, an OpenAI formatted tool, or an object\n * matching the provider's specific tool schema.\n * @param kwargs Any additional parameters to bind.\n */\n bindTools?(tools: BindToolsInput[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, OutputMessageType, CallOptions>;\n /**\n * Invokes the chat model with a single input.\n * @param input The input for the language model.\n * @param options The call options.\n * @returns A Promise that resolves to a BaseMessageChunk.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<OutputMessageType>;\n // eslint-disable-next-line require-yield\n _streamResponseChunks(_messages: BaseMessage[], _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<OutputMessageType>;\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /** @ignore */\n _generateUncached(messages: BaseMessageLike[][], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: RunnableConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ messages, cache, llmStringKey, parsedOptions, handledOptions }: {\n messages: BaseMessageLike[][];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsedOptions: any;\n handledOptions: RunnableConfig;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Generates chat based on the input messages.\n * @param messages An array of arrays of BaseMessage instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generate(messages: BaseMessageLike[][], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _modelType(): string;\n abstract _llmType(): string;\n /**\n * Generates a prompt based on the input prompt values.\n * @param promptValues An array of BasePromptValue instances.\n * @param options The call options or an array of stop sequences.\n * @param callbacks The callbacks for the language model.\n * @returns A Promise that resolves to an LLMResult.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n abstract _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV4<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: ZodTypeV3<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n/**\n * An abstract class that extends BaseChatModel and provides a simple\n * implementation of _generate.\n */\nexport declare abstract class SimpleChatModel<CallOptions extends BaseChatModelCallOptions = BaseChatModelCallOptions> extends BaseChatModel<CallOptions> {\n abstract _call(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;KAYY4B,UAAAA,YAAsBC;;;AAAlC;AAIYC,KAAAA,mBAAAA,GAAmB;EAQnBC,MAAAA,EAAAA,MAAAA;EAOAC,KAAAA,EAAAA,MAAAA;CAAmB,GAZ3BH,MAY2B,CAAA,MAAA,EAAA,GAAA,CAAA;;;AA0BS;AAKxC;AAAoC,KAtCxBE,aAAAA,GAsCwB;EAAA,MAAGd,EAAAA,MAAAA;EAA4B,KAejDW,EAAAA,MAAAA;CAAU,GAlDxBC,MAkEgBrB,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAAoB;AAExC;AAQA;AAA0B,KAxEdwB,mBAAAA,GAAsBb,uBAwER,GAAA;EAAA;;;;;AAEuD;AAKjF;;;EAAwF,gBAAGc,CAAAA,EAAAA,OAAAA;EAAwB;;;;;;;;;;;;;;;EAYR,aASrFG,CAAAA,EA1EF5B,oBA0EE4B;CAAc;;;;AAAwFG,KArEhHN,wBAAAA,GAA2BhB,4BAqEqFsB,GAAAA;EAAW;;;;;;;;;;;;;;EAWnE,WAEpCjC,CAAAA,EAnEdsB,UAmEctB;EAAe;;;;;;;;;;;;;;;EAUM,aAF7CqC,CAAAA,EA3DYnC,oBA2DZmC;CAAO;AAWkDJ,KApErDL,eAAAA,GAoEqDK;EAAW,WAAclB,CAAAA,EAAAA,MAAAA;EAAS,aAAWX,CAAAA,EAAAA,MAAAA;EAAS,aAAjBiC,EAAAA,MAAAA;EAAO,cAe5ElC,CAAAA,EAAAA,MAAAA;EAAwB,aAAyB8B,CAAAA,EAAAA,MAAAA;EAAW,OAAclB,CAAAA,EA7E7Fc,KA6E6Fd,CAAAA,MAAAA,CAAAA;CAAS;AAAGsB,KA3E3GP,cAAAA,GAAiBZ;;EAE1BK,MA0E8FT,CAAAA,MAAAA,EAAAA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AwB,CAAA,CAAA,EA3D7GU,OA2DqIJ,CA3D7H7B,SA2D6H6B,GAAAA;IAChHnC,oBAAAA,EAAAA,MAAAA,EAAAA;IAAgEgB,kBAAAA,CAAAA,EA1DhEA,wBA0DgEA,EAAAA;EAAwB,CAAA,CAAA;EAAU;;;;;AADa;;qBAhDrHd,0CAA0CiC,yBAAyBlB,YAAYsB,QAAQjC;;;;;;;;;;;;;;;+BAe7ED,iDAAiD8B,yBAAyBlB,YAAYsB,QAAQjC;+BAC9FN,gEAAgEgB,2BAA2BuB,QAAQ/B;;;oBAG9GiB,sBAAsBA,mCAAmC1B,SAAU+C;;IAElFrB,8BAA8Bd,uCAAuCW,SAASR,wBAAwBgC;;;oBAGvFrB,sBAAsBA,mCAAmC1B,SAAU+C;;IAElFrB,8BAA8Bd,sCAAsCW,SAASR;SACvEd;YACG8C;;;;oBAIMrB,sBAAsBA,mCAAmC5B,QAAUiD;;IAElFrB,8BAA8Bd,uCAAuCW,SAASR,wBAAwBgC;;;oBAGvFrB,sBAAsBA,mCAAmC5B,QAAUiD;;IAElFrB,8BAA8Bd,sCAAsCW,SAASR;SACvEd;YACG8C;;;;;;;uBAOcC,oCAAoClB,2BAA2BA,kCAAkCI,cAAcE;2BAChHnC,gEAAgEgB,2BAA2BuB;sBAChGvC,gEAAgEgB,2BAA2BuB,QAAQ/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"llms.d.cts","names":["BasePromptValueInterface","LLMResult","Generation","GenerationChunk","BaseCallbackConfig","CallbackManagerForLLMRun","Callbacks","BaseLanguageModel","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","RunnableConfig","BaseCache","SerializedLLM","Record","BaseLLMParams","BaseLLMCallOptions","BaseLLM","CallOptions","Exclude","Omit","Promise","AsyncGenerator","Partial","prompts","cache","llmStringKey","parsedOptions","handledOptions","runId","LLM"],"sources":["../../src/language_models/llms.d.ts"],"sourcesContent":["import type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { type LLMResult, type Generation, GenerationChunk } from \"../outputs.js\";\nimport { type BaseCallbackConfig, type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport { BaseLanguageModel, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/base.js\";\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\nexport interface BaseLLMParams extends BaseLanguageModelParams {\n}\nexport interface BaseLLMCallOptions extends BaseLanguageModelCallOptions {\n}\n/**\n * LLM Wrapper. Takes in a prompt (or prompts) and returns a string.\n */\nexport declare abstract class BaseLLM<CallOptions extends BaseLLMCallOptions = BaseLLMCallOptions> extends BaseLanguageModel<string, CallOptions> {\n // Backwards compatibility since fields have been moved to RunnableConfig\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n // Only ever instantiated in main LangChain\n lc_namespace: string[];\n /**\n * This method takes an input and options, and returns a string. It\n * converts the input to a prompt value and generates a result based on\n * the prompt.\n * @param input Input for the LLM.\n * @param options Options for the LLM call.\n * @returns A string result based on the prompt.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<string>;\n // eslint-disable-next-line require-yield\n _streamResponseChunks(_input: string, _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<GenerationChunk>;\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<string>;\n /**\n * This method takes prompt values, options, and callbacks, and generates\n * a result based on the prompts.\n * @param promptValues Prompt values for the LLM.\n * @param options Options for the LLM call.\n * @param callbacks Callbacks for the LLM call.\n * @returns An LLMResult based on the prompts.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Run the LLM on the given prompts and input.\n */\n abstract _generate(prompts: string[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _flattenLLMResult(llmResult: LLMResult): LLMResult[];\n /** @ignore */\n _generateUncached(prompts: string[], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: BaseCallbackConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ prompts, cache, llmStringKey, parsedOptions, handledOptions, runId }: {\n prompts: string[];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsedOptions: any;\n handledOptions: RunnableConfig;\n runId?: string;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Run the LLM on the given prompts and input, handling caching.\n */\n generate(prompts: string[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n /**\n * Return the string type key uniquely identifying this class of LLM.\n */\n abstract _llmType(): string;\n _modelType(): string;\n}\n/**\n * LLM class that provides a simpler interface to subclass than {@link BaseLLM}.\n *\n * Requires only implementing a simpler {@link _call} method instead of {@link _generate}.\n *\n * @augments BaseLLM\n */\nexport declare abstract class LLM<CallOptions extends BaseLLMCallOptions = BaseLLMCallOptions> extends BaseLLM<CallOptions> {\n /**\n * Run the LLM on the given prompt and input.\n */\n abstract _call(prompt: string, options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(prompts: string[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForL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C4G,GAAA;IAyE9F6B,oBAAG,EAAA,MAAA,EAAA;IAAA,kBAAA,CAAA,EAxBJzB,wBAwBI,EAAA;EAAA,CAAA,CAAA;EAAuC;;;EAIoC,QAAGgB,CAAAA,OAAAA,EAAAA,MAAAA,EAAAA,EAAAA,OAAAA,CAAAA,EAAAA,MAAAA,EAAAA,GAvB1DH,WAuB0DG,EAAAA,SAAAA,CAAAA,EAvBjCf,SAuBiCe,CAAAA,EAvBrBA,OAuBqBA,CAvBbpB,SAuBaoB,CAAAA;EAAO;;;EACF;EALN,kBAAA,CAAA,CAAA,EAdpFP,MAcoF,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;;;;;;;;;uBAAhFgB,wBAAwBd,qBAAqBA,4BAA4BC,QAAQC;;;;kFAI3Bb,2BAA2BgB;gFAC7BhB,2BAA2BgB,QAAQpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"llms.d.ts","names":["BasePromptValueInterface","LLMResult","Generation","GenerationChunk","BaseCallbackConfig","CallbackManagerForLLMRun","Callbacks","BaseLanguageModel","BaseLanguageModelCallOptions","BaseLanguageModelInput","BaseLanguageModelParams","RunnableConfig","BaseCache","SerializedLLM","Record","BaseLLMParams","BaseLLMCallOptions","BaseLLM","CallOptions","Exclude","Omit","Promise","AsyncGenerator","Partial","prompts","cache","llmStringKey","parsedOptions","handledOptions","runId","LLM"],"sources":["../../src/language_models/llms.d.ts"],"sourcesContent":["import type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport { type LLMResult, type Generation, GenerationChunk } from \"../outputs.js\";\nimport { type BaseCallbackConfig, type CallbackManagerForLLMRun, type Callbacks } from \"../callbacks/manager.js\";\nimport { BaseLanguageModel, type BaseLanguageModelCallOptions, type BaseLanguageModelInput, type BaseLanguageModelParams } from \"./base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BaseCache } from \"../caches/base.js\";\nexport type SerializedLLM = {\n _model: string;\n _type: string;\n} & Record<string, any>;\nexport interface BaseLLMParams extends BaseLanguageModelParams {\n}\nexport interface BaseLLMCallOptions extends BaseLanguageModelCallOptions {\n}\n/**\n * LLM Wrapper. Takes in a prompt (or prompts) and returns a string.\n */\nexport declare abstract class BaseLLM<CallOptions extends BaseLLMCallOptions = BaseLLMCallOptions> extends BaseLanguageModel<string, CallOptions> {\n // Backwards compatibility since fields have been moved to RunnableConfig\n ParsedCallOptions: Omit<CallOptions, Exclude<keyof RunnableConfig, \"signal\" | \"timeout\" | \"maxConcurrency\">>;\n // Only ever instantiated in main LangChain\n lc_namespace: string[];\n /**\n * This method takes an input and options, and returns a string. It\n * converts the input to a prompt value and generates a result based on\n * the prompt.\n * @param input Input for the LLM.\n * @param options Options for the LLM call.\n * @returns A string result based on the prompt.\n */\n invoke(input: BaseLanguageModelInput, options?: CallOptions): Promise<string>;\n // eslint-disable-next-line require-yield\n _streamResponseChunks(_input: string, _options: this[\"ParsedCallOptions\"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<GenerationChunk>;\n protected _separateRunnableConfigFromCallOptionsCompat(options?: Partial<CallOptions>): [RunnableConfig, this[\"ParsedCallOptions\"]];\n _streamIterator(input: BaseLanguageModelInput, options?: CallOptions): AsyncGenerator<string>;\n /**\n * This method takes prompt values, options, and callbacks, and generates\n * a result based on the prompts.\n * @param promptValues Prompt values for the LLM.\n * @param options Options for the LLM call.\n * @param callbacks Callbacks for the LLM call.\n * @returns An LLMResult based on the prompts.\n */\n generatePrompt(promptValues: BasePromptValueInterface[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Run the LLM on the given prompts and input.\n */\n abstract _generate(prompts: string[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<LLMResult>;\n /**\n * Get the parameters used to invoke the model\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n invocationParams(_options?: this[\"ParsedCallOptions\"]): any;\n _flattenLLMResult(llmResult: LLMResult): LLMResult[];\n /** @ignore */\n _generateUncached(prompts: string[], parsedOptions: this[\"ParsedCallOptions\"], handledOptions: BaseCallbackConfig, startedRunManagers?: CallbackManagerForLLMRun[]): Promise<LLMResult>;\n _generateCached({ prompts, cache, llmStringKey, parsedOptions, handledOptions, runId }: {\n prompts: string[];\n cache: BaseCache<Generation[]>;\n llmStringKey: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsedOptions: any;\n handledOptions: RunnableConfig;\n runId?: string;\n }): Promise<LLMResult & {\n missingPromptIndices: number[];\n startedRunManagers?: CallbackManagerForLLMRun[];\n }>;\n /**\n * Run the LLM on the given prompts and input, handling caching.\n */\n generate(prompts: string[], options?: string[] | CallOptions, callbacks?: Callbacks): Promise<LLMResult>;\n /**\n * Get the identifying parameters of the LLM.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _identifyingParams(): Record<string, any>;\n /**\n * Return the string type key uniquely identifying this class of LLM.\n */\n abstract _llmType(): string;\n _modelType(): string;\n}\n/**\n * LLM class that provides a simpler interface to subclass than {@link BaseLLM}.\n *\n * Requires only implementing a simpler {@link _call} method instead of {@link _generate}.\n *\n * @augments BaseLLM\n */\nexport declare abstract class LLM<CallOptions extends BaseLLMCallOptions = BaseLLMCallOptions> extends BaseLLM<CallOptions> {\n /**\n * Run the LLM on the given prompt and input.\n */\n abstract _call(prompt: string, options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<string>;\n _generate(prompts: string[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<LLMResult>;\n}\n"],"mappings":";;;;;;;;KAMYa,aAAAA;;EAAAA,KAAAA,EAAAA,MAAAA;AAIZ,CAAA,GADIC,MACaC,CAAAA,MAAAA,EAAAA,GAAa,CAAA;AAEbC,UAFAD,aAAAA,SAAsBL,uBAEKF,CAAAA,CAK5C;AAAqC,UALpBQ,kBAAAA,SAA2BR,4BAKP,CAAA;;;;AAEkBG,uBAFzBM,OAEyBN,CAAAA,oBAFGK,kBAEHL,GAFwBK,k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SAuBaoB,CAAAA;EAAO;;;EACF;EALN,kBAAA,CAAA,CAAA,EAdpFP,MAcoF,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;;;;;;;;;uBAAhFgB,wBAAwBd,qBAAqBA,4BAA4BC,QAAQC;;;;kFAI3Bb,2BAA2BgB;gFAC7BhB,2BAA2BgB,QAAQpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.d.cts","names":["ModelProfile"],"sources":["../../src/language_models/profile.d.ts"],"sourcesContent":["/**\n * Represents the capabilities and constraints of a language model.\n *\n * This interface defines the various features and limitations that a model may have,\n * including input/output constraints, multimodal support, and advanced capabilities\n * like tool calling and structured output.\n */\nexport interface ModelProfile {\n /**\n * Maximum number of tokens that can be included in the input context window.\n *\n * This represents the total token budget for the model's input, including\n * the prompt, system messages, conversation history, and any other context.\n *\n * @example\n * ```typescript\n * const profile: ModelProfile = {\n * maxInputTokens: 128000 // Model supports up to 128k tokens\n * };\n * ```\n */\n maxInputTokens?: number;\n /**\n * Whether the model supports image inputs.\n *\n * When `true`, the model can process images as part of its input, enabling\n * multimodal interactions where visual content can be analyzed alongside text.\n *\n * @see {@link imageUrlInputs} for URL-based image input support\n */\n imageInputs?: boolean;\n /**\n * Whether the model supports image URL inputs.\n *\n * When `true`, the model can accept URLs pointing to images rather than\n * requiring the image data to be embedded directly in the request. This can\n * be more efficient for large images or when images are already hosted.\n *\n * @see {@link imageInputs} for direct image input support\n */\n imageUrlInputs?: boolean;\n /**\n * Whether the model supports PDF document inputs.\n *\n * When `true`, the model can process PDF files as input, allowing it to\n * analyze document content, extract information, or answer questions about\n * PDF documents.\n */\n pdfInputs?: boolean;\n /**\n * Whether the model supports audio inputs.\n *\n * When `true`, the model can process audio data as input, enabling\n * capabilities like speech recognition, audio analysis, or multimodal\n * interactions involving sound.\n */\n audioInputs?: boolean;\n /**\n * Whether the model supports video inputs.\n *\n * When `true`, the model can process video data as input, enabling\n * capabilities like video analysis, scene understanding, or multimodal\n * interactions involving moving images.\n */\n videoInputs?: boolean;\n /**\n * Whether the model supports image content in tool messages.\n *\n * When `true`, tool responses can include images that the model can process\n * and reason about. This enables workflows where tools return visual data\n * that the model needs to interpret.\n */\n imageToolMessage?: boolean;\n /**\n * Whether the model supports PDF content in tool messages.\n *\n * When `true`, tool responses can include PDF documents that the model can\n * process and reason about. This enables workflows where tools return\n * document data that the model needs to interpret.\n */\n pdfToolMessage?: boolean;\n /**\n * Maximum number of tokens the model can generate in its output.\n *\n * This represents the upper limit on the length of the model's response.\n * The actual output may be shorter depending on the completion criteria\n * (e.g., natural stopping point, stop sequences).\n *\n * @example\n * ```typescript\n * const profile: ModelProfile = {\n * maxOutputTokens: 4096 // Model can generate up to 4k tokens\n * };\n * ```\n */\n maxOutputTokens?: number;\n /**\n * Whether the model supports reasoning or chain-of-thought output.\n *\n * When `true`, the model can produce explicit reasoning steps or\n * chain-of-thought explanations as part of its output. This is useful\n * for understanding the model's decision-making process and improving\n * transparency in complex reasoning tasks.\n */\n reasoningOutput?: boolean;\n /**\n * Whether the model can generate image outputs.\n *\n * When `true`, the model can produce images as part of its response,\n * enabling capabilities like image generation, editing, or visual\n * content creation.\n */\n imageOutputs?: boolean;\n /**\n * Whether the model can generate audio outputs.\n *\n * When `true`, the model can produce audio data as part of its response,\n * enabling capabilities like text-to-speech, audio generation, or\n * sound synthesis.\n */\n audioOutputs?: boolean;\n /**\n * Whether the model can generate video outputs.\n *\n * When `true`, the model can produce video data as part of its response,\n * enabling capabilities like video generation, editing, or visual\n * content creation with motion.\n */\n videoOutputs?: boolean;\n /**\n * Whether the model supports tool calling (function calling).\n *\n * When `true`, the model can invoke external tools or functions during\n * its reasoning process. The model can decide which tools to call,\n * with what arguments, and can incorporate the tool results into its\n * final response.\n *\n * @see {@link toolChoice} for controlling tool selection behavior\n * @see {@link https://docs.langchain.com/oss/javascript/langchain/models#tool-calling}\n */\n toolCalling?: boolean;\n /**\n * Whether the model supports tool choice control.\n *\n * When `true`, the caller can specify how the model should select tools,\n * such as forcing the use of a specific tool, allowing any tool, or\n * preventing tool use entirely. This provides fine-grained control over\n * the model's tool-calling behavior.\n *\n * @see {@link toolCalling} for basic tool calling support\n */\n toolChoice?: boolean;\n /**\n * Whether the model supports structured output generation.\n *\n * When `true`, the model can generate responses that conform to a\n * specified schema or structure (e.g., JSON with a particular format).\n * This is useful for ensuring the model's output can be reliably parsed\n * and processed programmatically.\n *\n * @example\n * ```typescript\n * // Model can be instructed to return JSON matching a schema\n * const profile: ModelProfile = {\n * structuredOutput: true\n * };\n * ```\n */\n structuredOutput?: boolean;\n}\n"],"mappings":";;AAOA;;;;;;UAAiBA,YAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.d.ts","names":["ModelProfile"],"sources":["../../src/language_models/profile.d.ts"],"sourcesContent":["/**\n * Represents the capabilities and constraints of a language model.\n *\n * This interface defines the various features and limitations that a model may have,\n * including input/output constraints, multimodal support, and advanced capabilities\n * like tool calling and structured output.\n */\nexport interface ModelProfile {\n /**\n * Maximum number of tokens that can be included in the input context window.\n *\n * This represents the total token budget for the model's input, including\n * the prompt, system messages, conversation history, and any other context.\n *\n * @example\n * ```typescript\n * const profile: ModelProfile = {\n * maxInputTokens: 128000 // Model supports up to 128k tokens\n * };\n * ```\n */\n maxInputTokens?: number;\n /**\n * Whether the model supports image inputs.\n *\n * When `true`, the model can process images as part of its input, enabling\n * multimodal interactions where visual content can be analyzed alongside text.\n *\n * @see {@link imageUrlInputs} for URL-based image input support\n */\n imageInputs?: boolean;\n /**\n * Whether the model supports image URL inputs.\n *\n * When `true`, the model can accept URLs pointing to images rather than\n * requiring the image data to be embedded directly in the request. This can\n * be more efficient for large images or when images are already hosted.\n *\n * @see {@link imageInputs} for direct image input support\n */\n imageUrlInputs?: boolean;\n /**\n * Whether the model supports PDF document inputs.\n *\n * When `true`, the model can process PDF files as input, allowing it to\n * analyze document content, extract information, or answer questions about\n * PDF documents.\n */\n pdfInputs?: boolean;\n /**\n * Whether the model supports audio inputs.\n *\n * When `true`, the model can process audio data as input, enabling\n * capabilities like speech recognition, audio analysis, or multimodal\n * interactions involving sound.\n */\n audioInputs?: boolean;\n /**\n * Whether the model supports video inputs.\n *\n * When `true`, the model can process video data as input, enabling\n * capabilities like video analysis, scene understanding, or multimodal\n * interactions involving moving images.\n */\n videoInputs?: boolean;\n /**\n * Whether the model supports image content in tool messages.\n *\n * When `true`, tool responses can include images that the model can process\n * and reason about. This enables workflows where tools return visual data\n * that the model needs to interpret.\n */\n imageToolMessage?: boolean;\n /**\n * Whether the model supports PDF content in tool messages.\n *\n * When `true`, tool responses can include PDF documents that the model can\n * process and reason about. This enables workflows where tools return\n * document data that the model needs to interpret.\n */\n pdfToolMessage?: boolean;\n /**\n * Maximum number of tokens the model can generate in its output.\n *\n * This represents the upper limit on the length of the model's response.\n * The actual output may be shorter depending on the completion criteria\n * (e.g., natural stopping point, stop sequences).\n *\n * @example\n * ```typescript\n * const profile: ModelProfile = {\n * maxOutputTokens: 4096 // Model can generate up to 4k tokens\n * };\n * ```\n */\n maxOutputTokens?: number;\n /**\n * Whether the model supports reasoning or chain-of-thought output.\n *\n * When `true`, the model can produce explicit reasoning steps or\n * chain-of-thought explanations as part of its output. This is useful\n * for understanding the model's decision-making process and improving\n * transparency in complex reasoning tasks.\n */\n reasoningOutput?: boolean;\n /**\n * Whether the model can generate image outputs.\n *\n * When `true`, the model can produce images as part of its response,\n * enabling capabilities like image generation, editing, or visual\n * content creation.\n */\n imageOutputs?: boolean;\n /**\n * Whether the model can generate audio outputs.\n *\n * When `true`, the model can produce audio data as part of its response,\n * enabling capabilities like text-to-speech, audio generation, or\n * sound synthesis.\n */\n audioOutputs?: boolean;\n /**\n * Whether the model can generate video outputs.\n *\n * When `true`, the model can produce video data as part of its response,\n * enabling capabilities like video generation, editing, or visual\n * content creation with motion.\n */\n videoOutputs?: boolean;\n /**\n * Whether the model supports tool calling (function calling).\n *\n * When `true`, the model can invoke external tools or functions during\n * its reasoning process. The model can decide which tools to call,\n * with what arguments, and can incorporate the tool results into its\n * final response.\n *\n * @see {@link toolChoice} for controlling tool selection behavior\n * @see {@link https://docs.langchain.com/oss/javascript/langchain/models#tool-calling}\n */\n toolCalling?: boolean;\n /**\n * Whether the model supports tool choice control.\n *\n * When `true`, the caller can specify how the model should select tools,\n * such as forcing the use of a specific tool, allowing any tool, or\n * preventing tool use entirely. This provides fine-grained control over\n * the model's tool-calling behavior.\n *\n * @see {@link toolCalling} for basic tool calling support\n */\n toolChoice?: boolean;\n /**\n * Whether the model supports structured output generation.\n *\n * When `true`, the model can generate responses that conform to a\n * specified schema or structure (e.g., JSON with a particular format).\n * This is useful for ensuring the model's output can be reliably parsed\n * and processed programmatically.\n *\n * @example\n * ```typescript\n * // Model can be instructed to return JSON matching a schema\n * const profile: ModelProfile = {\n * structuredOutput: true\n * };\n * ```\n */\n structuredOutput?: boolean;\n}\n"],"mappings":";;AAOA;;;;;;UAAiBA,YAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"import_type.d.cts","names":["OptionalImportMap","SecretMap"],"sources":["../../src/load/import_type.d.ts"],"sourcesContent":["// Auto-generated by lc-secrets plugin. Do not edit manually.\nexport interface OptionalImportMap {\n}\nexport interface SecretMap {\n}\n"],"mappings":";;AACiBA,UAAAA,iBAAAA,CAAiB,CAElC;UAAiBC,SAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"import_type.d.ts","names":["OptionalImportMap","SecretMap"],"sources":["../../src/load/import_type.d.ts"],"sourcesContent":["// Auto-generated by lc-secrets plugin. Do not edit manually.\nexport interface OptionalImportMap {\n}\nexport interface SecretMap {\n}\n"],"mappings":";;AACiBA,UAAAA,iBAAAA,CAAiB,CAElC;UAAiBC,SAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":["OptionalImportMap","SecretMap","load","Record","T","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import type { OptionalImportMap, SecretMap } from \"./import_type.js\";\nexport declare function load<T>(text: string, mappings?: {\n secretsMap?: SecretMap;\n optionalImportsMap?: OptionalImportMap;\n optionalImportEntrypoints?: string[];\n importMap?: Record<string, unknown>;\n}): Promise<T>;\n"],"mappings":";;;iBACwBE,8BACE;eAATD;EADOC,kBAAI,CAAA,EAEHF,iBAFG;EAAA,yBAAA,CAAA,EAAA,MAAA,EAAA;EAAA,SACXC,CAAAA,EAGDE,MAHCF,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;CAAS,CAAA,EAItBI,OAHqBL,CAGbI,CAHaJ,CAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":["OptionalImportMap","SecretMap","load","Record","T","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import type { OptionalImportMap, SecretMap } from \"./import_type.js\";\nexport declare function load<T>(text: string, mappings?: {\n secretsMap?: SecretMap;\n optionalImportsMap?: OptionalImportMap;\n optionalImportEntrypoints?: string[];\n importMap?: Record<string, unknown>;\n}): Promise<T>;\n"],"mappings":";;;iBACwBE,8BACE;eAATD;EADOC,kBAAI,CAAA,EAEHF,iBAFG;EAAA,yBAAA,CAAA,EAAA,MAAA,EAAA;EAAA,SACXC,CAAAA,EAGDE,MAHCF,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;CAAS,CAAA,EAItBI,OAHqBL,CAGbI,CAHaJ,CAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"map_keys.d.cts","names":["SerializedFields","SerializedKeyAlias","keyToJson","keyFromJson","mapKeys"],"sources":["../../src/load/map_keys.d.ts"],"sourcesContent":["export interface SerializedFields {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\nexport interface SerializedKeyAlias {\n [key: string]: string;\n}\nexport declare function keyToJson(key: string, map?: SerializedKeyAlias): string;\nexport declare function keyFromJson(key: string, map?: SerializedKeyAlias): string;\nexport declare function mapKeys(fields: SerializedFields, mapper: typeof keyToJson, map?: SerializedKeyAlias): SerializedFields;\n"],"mappings":";UAAiBA,gBAAAA;EAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"map_keys.d.ts","names":["SerializedFields","SerializedKeyAlias","keyToJson","keyFromJson","mapKeys"],"sources":["../../src/load/map_keys.d.ts"],"sourcesContent":["export interface SerializedFields {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\nexport interface SerializedKeyAlias {\n [key: string]: string;\n}\nexport declare function keyToJson(key: string, map?: SerializedKeyAlias): string;\nexport declare function keyFromJson(key: string, map?: SerializedKeyAlias): string;\nexport declare function mapKeys(fields: SerializedFields, mapper: typeof keyToJson, map?: SerializedKeyAlias): SerializedFields;\n"],"mappings":";UAAiBA,gBAAAA;EAAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"serializable.d.cts","names":["SerializedFields","BaseSerialized","T","Record","SerializedConstructor","SerializedSecret","SerializedNotImplemented","Serialized","get_lc_unique_name","Serializable","SerializableInterface"],"sources":["../../src/load/serializable.d.ts"],"sourcesContent":["import { type SerializedFields } from \"./map_keys.js\";\nexport interface BaseSerialized<T extends string> {\n lc: number;\n type: T;\n id: string[];\n name?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n graph?: Record<string, any>;\n}\nexport interface SerializedConstructor extends BaseSerialized<\"constructor\"> {\n kwargs: SerializedFields;\n}\nexport interface SerializedSecret extends BaseSerialized<\"secret\"> {\n}\nexport interface SerializedNotImplemented extends BaseSerialized<\"not_implemented\"> {\n}\nexport type Serialized = SerializedConstructor | SerializedSecret | SerializedNotImplemented;\n/**\n * Get a unique name for the module, rather than parent class implementations.\n * Should not be subclassed, subclass lc_name above instead.\n */\nexport declare function get_lc_unique_name(serializableClass: typeof Serializable): string;\nexport interface SerializableInterface {\n get lc_id(): string[];\n}\nexport declare abstract class Serializable implements SerializableInterface {\n lc_serializable: boolean;\n lc_kwargs: SerializedFields;\n /**\n * A path to the module that contains the class, eg. [\"langchain\", \"llms\"]\n * Usually should be the same as the entrypoint the class is exported from.\n */\n abstract lc_namespace: string[];\n /**\n * The name of the serializable. Override to provide an alias or\n * to preserve the serialized module name in minified environments.\n *\n * Implemented as a static method to support loading logic.\n */\n static lc_name(): string;\n /**\n * The final serialized identifier for the module.\n */\n get lc_id(): string[];\n /**\n * A map of secrets, which will be omitted from serialization.\n * Keys are paths to the secret in constructor args, e.g. \"foo.bar.baz\".\n * Values are the secret ids, which will be used when deserializing.\n */\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n /**\n * A map of additional attributes to merge with constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the attribute values, which will be serialized.\n * These attributes need to be accepted by the constructor as arguments.\n */\n get lc_attributes(): SerializedFields | undefined;\n /**\n * A map of aliases for constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the alias that will replace the key in serialization.\n * This is used to eg. make argument names match Python.\n */\n get lc_aliases(): {\n [key: string]: string;\n } | undefined;\n /**\n * A manual list of keys that should be serialized.\n * If not overridden, all fields passed into the constructor will be serialized.\n */\n get lc_serializable_keys(): string[] | undefined;\n constructor(kwargs?: SerializedFields, ..._args: never[]);\n toJSON(): Serialized;\n toJSONNotImplemented(): SerializedNotImplemented;\n}\n"],"mappings":";;;UACiBC;;EAAAA,IAAAA,EAEPC,CAFOD;EAAc,EAAA,EAAA,MAAA,EAAA;EAAA,IAErBC,CAAAA,EAAAA,MAAAA;EAAC;EAIO,KAAA,CAAA,EAANC,MAAM,CAAA,MAAA,EAAA,GAAA,CAAA;AAElB;AAAsC,UAArBC,qBAAAA,SAA8BH,cAAT,CAAA,aAAA,CAAA,CAAA;EAAA,MAC1BD,EAAAA,gBAAAA;;AADiD,UAG5CK,gBAAAA,SAAyBJ,cAHmB,CAAA,QAAA,CAAA,CAAA,CAG7D;AAEiBK,UAAAA,wBAAAA,SAAiCL,cAAc,CAAA,iBAAA,CAAA,CAAA,CAEhE;AAAsB,KAAVM,UAAAA,GAAaH,qBAAH,GAA2BC,gBAA3B,GAA8CC,wBAA9C;;;;AAAsE;AAKpEE,iBAAAA,kBAAAA,CAA6CC,iBAAY,EAAA,OAAZA,YAAY,CAAA,EAAA,MAAA;AAChEC,UAAAA,qBAAAA,CAAqB;EAGRD,IAAAA,KAAAA,EAAAA,EAAAA,MAAY,EAAA;;AAE3BT,uBAFeS,YAAAA,YAAwBC,qBAEvCV,CAAAA;EAAgB,eA+BNA,EAAAA,OAAAA;EAAgB,SAehBA,EA9CVA,gBA8CUA;EAAgB;;;AAhDkC;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAiClDA;;;;;;;;;;;;;;;uBAeAA;YACXO;0BACcD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"serializable.d.ts","names":["SerializedFields","BaseSerialized","T","Record","SerializedConstructor","SerializedSecret","SerializedNotImplemented","Serialized","get_lc_unique_name","Serializable","SerializableInterface"],"sources":["../../src/load/serializable.d.ts"],"sourcesContent":["import { type SerializedFields } from \"./map_keys.js\";\nexport interface BaseSerialized<T extends string> {\n lc: number;\n type: T;\n id: string[];\n name?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n graph?: Record<string, any>;\n}\nexport interface SerializedConstructor extends BaseSerialized<\"constructor\"> {\n kwargs: SerializedFields;\n}\nexport interface SerializedSecret extends BaseSerialized<\"secret\"> {\n}\nexport interface SerializedNotImplemented extends BaseSerialized<\"not_implemented\"> {\n}\nexport type Serialized = SerializedConstructor | SerializedSecret | SerializedNotImplemented;\n/**\n * Get a unique name for the module, rather than parent class implementations.\n * Should not be subclassed, subclass lc_name above instead.\n */\nexport declare function get_lc_unique_name(serializableClass: typeof Serializable): string;\nexport interface SerializableInterface {\n get lc_id(): string[];\n}\nexport declare abstract class Serializable implements SerializableInterface {\n lc_serializable: boolean;\n lc_kwargs: SerializedFields;\n /**\n * A path to the module that contains the class, eg. [\"langchain\", \"llms\"]\n * Usually should be the same as the entrypoint the class is exported from.\n */\n abstract lc_namespace: string[];\n /**\n * The name of the serializable. Override to provide an alias or\n * to preserve the serialized module name in minified environments.\n *\n * Implemented as a static method to support loading logic.\n */\n static lc_name(): string;\n /**\n * The final serialized identifier for the module.\n */\n get lc_id(): string[];\n /**\n * A map of secrets, which will be omitted from serialization.\n * Keys are paths to the secret in constructor args, e.g. \"foo.bar.baz\".\n * Values are the secret ids, which will be used when deserializing.\n */\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n /**\n * A map of additional attributes to merge with constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the attribute values, which will be serialized.\n * These attributes need to be accepted by the constructor as arguments.\n */\n get lc_attributes(): SerializedFields | undefined;\n /**\n * A map of aliases for constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the alias that will replace the key in serialization.\n * This is used to eg. make argument names match Python.\n */\n get lc_aliases(): {\n [key: string]: string;\n } | undefined;\n /**\n * A manual list of keys that should be serialized.\n * If not overridden, all fields passed into the constructor will be serialized.\n */\n get lc_serializable_keys(): string[] | undefined;\n constructor(kwargs?: SerializedFields, ..._args: never[]);\n toJSON(): Serialized;\n toJSONNotImplemented(): SerializedNotImplemented;\n}\n"],"mappings":";;;UACiBC;;EAAAA,IAAAA,EAEPC,CAFOD;EAAc,EAAA,EAAA,MAAA,EAAA;EAAA,IAErBC,CAAAA,EAAAA,MAAAA;EAAC;EAIO,KAAA,CAAA,EAANC,MAAM,CAAA,MAAA,EAAA,GAAA,CAAA;AAElB;AAAsC,UAArBC,qBAAAA,SAA8BH,cAAT,CAAA,aAAA,CAAA,CAAA;EAAA,MAC1BD,EAAAA,gBAAAA;;AADiD,UAG5CK,gBAAAA,SAAyBJ,cAHmB,CAAA,QAAA,CAAA,CAAA,CAG7D;AAEiBK,UAAAA,wBAAAA,SAAiCL,cAAc,CAAA,iBAAA,CAAA,CAAA,CAEhE;AAAsB,KAAVM,UAAAA,GAAaH,qBAAH,GAA2BC,gBAA3B,GAA8CC,wBAA9C;;;;AAAsE;AAKpEE,iBAAAA,kBAAAA,CAA6CC,iBAAY,EAAA,OAAZA,YAAY,CAAA,EAAA,MAAA;AAChEC,UAAAA,qBAAAA,CAAqB;EAGRD,IAAAA,KAAAA,EAAAA,EAAAA,MAAY,EAAA;;AAE3BT,uBAFeS,YAAAA,YAAwBC,qBAEvCV,CAAAA;EAAgB,eA+BNA,EAAAA,OAAAA;EAAgB,SAehBA,EA9CVA,gBA8CUA;EAAgB;;;AAhDkC;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAiClDA;;;;;;;;;;;;;;;uBAeAA;YACXO;0BACcD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.d.cts","names":["InputValues","Record","OutputValues","MemoryVariables","BaseMemory","Promise","getInputValue","getOutputValue","getPromptInputKey"],"sources":["../src/memory.d.ts"],"sourcesContent":["/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the input values for a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the output values from a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type OutputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the memory variables in a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type MemoryVariables = Record<string, any>;\n/**\n * Abstract base class for memory in LangChain's Chains. Memory refers to\n * the state in Chains. It can be used to store information about past\n * executions of a Chain and inject that information into the inputs of\n * future executions of the Chain.\n */\nexport declare abstract class BaseMemory {\n abstract get memoryKeys(): string[];\n /**\n * Abstract method that should take an object of input values and return a\n * Promise that resolves with an object of memory variables. The\n * implementation of this method should load the memory variables from the\n * provided input values.\n * @param values An object of input values.\n * @returns Promise that resolves with an object of memory variables.\n */\n abstract loadMemoryVariables(values: InputValues): Promise<MemoryVariables>;\n /**\n * Abstract method that should take two objects, one of input values and\n * one of output values, and return a Promise that resolves when the\n * context has been saved. The implementation of this method should save\n * the context based on the provided input and output values.\n * @param inputValues An object of input values.\n * @param outputValues An object of output values.\n * @returns Promise that resolves when the context has been saved.\n */\n abstract saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n/**\n * This function is used by memory classes to select the input value\n * to use for the memory. If there is only one input value, it is used.\n * If there are multiple input values, the inputKey must be specified.\n */\nexport declare const getInputValue: (inputValues: InputValues, inputKey?: string | undefined) => any;\n/**\n * This function is used by memory classes to select the output value\n * to use for the memory. If there is only one output value, it is used.\n * If there are multiple output values, the outputKey must be specified.\n * If no outputKey is specified, an error is thrown.\n */\nexport declare const getOutputValue: (outputValues: OutputValues, outputKey?: string | undefined) => any;\n/**\n * Function used by memory classes to get the key of the prompt input,\n * excluding any keys that are memory variables or the \"stop\" key. If\n * there is not exactly one prompt input key, an error is thrown.\n */\nexport declare function getPromptInputKey(inputs: Record<string, unknown>, memoryVariables: string[]): string;\n"],"mappings":";;AAKA;AAMA;AAMA;AAOA;AAAwC,KAnB5BA,WAAAA,GAAcC,MAmBc,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;AAoBwCI,KAjCpEH,YAAAA,GAAeD,MAiCqDI,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAAO;AAOvF;AAOA;AAMA;;KA/CYF,eAAAA,GAAkBF;;;;;;;uBAOAG,UAAAA;;;;;;;;;;uCAUWJ,cAAcK,QAAQF;;;;;;;;;;oCAUzBH,2BAA2BE,eAAeG;;;;;;;cAO3DC,6BAA6BN;;;;;;;cAO7BO,+BAA+BL;;;;;;iBAM5BM,iBAAAA,SAA0BP"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.d.ts","names":["InputValues","Record","OutputValues","MemoryVariables","BaseMemory","Promise","getInputValue","getOutputValue","getPromptInputKey"],"sources":["../src/memory.d.ts"],"sourcesContent":["/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the input values for a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the output values from a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type OutputValues = Record<string, any>;\n/**\n * Type alias for a record where the keys are strings and the values can\n * be any type. This is used to represent the memory variables in a Chain.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type MemoryVariables = Record<string, any>;\n/**\n * Abstract base class for memory in LangChain's Chains. Memory refers to\n * the state in Chains. It can be used to store information about past\n * executions of a Chain and inject that information into the inputs of\n * future executions of the Chain.\n */\nexport declare abstract class BaseMemory {\n abstract get memoryKeys(): string[];\n /**\n * Abstract method that should take an object of input values and return a\n * Promise that resolves with an object of memory variables. The\n * implementation of this method should load the memory variables from the\n * provided input values.\n * @param values An object of input values.\n * @returns Promise that resolves with an object of memory variables.\n */\n abstract loadMemoryVariables(values: InputValues): Promise<MemoryVariables>;\n /**\n * Abstract method that should take two objects, one of input values and\n * one of output values, and return a Promise that resolves when the\n * context has been saved. The implementation of this method should save\n * the context based on the provided input and output values.\n * @param inputValues An object of input values.\n * @param outputValues An object of output values.\n * @returns Promise that resolves when the context has been saved.\n */\n abstract saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n/**\n * This function is used by memory classes to select the input value\n * to use for the memory. If there is only one input value, it is used.\n * If there are multiple input values, the inputKey must be specified.\n */\nexport declare const getInputValue: (inputValues: InputValues, inputKey?: string | undefined) => any;\n/**\n * This function is used by memory classes to select the output value\n * to use for the memory. If there is only one output value, it is used.\n * If there are multiple output values, the outputKey must be specified.\n * If no outputKey is specified, an error is thrown.\n */\nexport declare const getOutputValue: (outputValues: OutputValues, outputKey?: string | undefined) => any;\n/**\n * Function used by memory classes to get the key of the prompt input,\n * excluding any keys that are memory variables or the \"stop\" key. If\n * there is not exactly one prompt input key, an error is thrown.\n */\nexport declare function getPromptInputKey(inputs: Record<string, unknown>, memoryVariables: string[]): string;\n"],"mappings":";;AAKA;AAMA;AAMA;AAOA;AAAwC,KAnB5BA,WAAAA,GAAcC,MAmBc,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;AAoBwCI,KAjCpEH,YAAAA,GAAeD,MAiCqDI,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAAO;AAOvF;AAOA;AAMA;;KA/CYF,eAAAA,GAAkBF;;;;;;;uBAOAG,UAAAA;;;;;;;;;;uCAUWJ,cAAcK,QAAQF;;;;;;;;;;oCAUzBH,2BAA2BE,eAAeG;;;;;;;cAO3DC,6BAA6BN;;;;;;;cAO7BO,+BAA+BL;;;;;;iBAM5BM,iBAAAA,SAA0BP"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","ContentBlock","$InferMessageContent","$InferMessageProperty","MessageStructure","InvalidToolCall","ToolCall","ToolCallChunk","AIMessageFields","TStructure","AIMessage","Record","Standard","Array","isAIMessage","isAIMessageChunk","AIMessageChunk","AIMessageChunkFields"],"sources":["../../src/messages/ai.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, BaseMessageFields } from \"./base.js\";\nimport { ContentBlock } from \"./content/index.js\";\nimport { $InferMessageContent, $InferMessageProperty, MessageStructure } from \"./message.js\";\nimport { InvalidToolCall, ToolCall, ToolCallChunk } from \"./tool.js\";\nexport interface AIMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"ai\"> {\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: $InferMessageProperty<TStructure, \"ai\", \"usage_metadata\">;\n}\nexport declare class AIMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"ai\"> implements AIMessageFields<TStructure> {\n readonly type: \"ai\";\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: AIMessageFields<TStructure>[\"usage_metadata\"];\n get lc_aliases(): Record<string, string>;\n constructor(fields: $InferMessageContent<TStructure, \"ai\"> | AIMessageFields<TStructure>);\n static lc_name(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is AIMessage;\n}\n/**\n * @deprecated Use {@link AIMessage.isInstance} instead\n */\nexport declare function isAIMessage<TStructure extends MessageStructure>(x: BaseMessage): x is AIMessage<TStructure>;\n/**\n * @deprecated Use {@link AIMessageChunk.isInstance} instead\n */\nexport declare function isAIMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is AIMessageChunk<TStructure>;\nexport type AIMessageChunkFields<TStructure extends MessageStructure = MessageStructure> = AIMessageFields<TStructure> & {\n tool_call_chunks?: ToolCallChunk[];\n};\n/**\n * Represents a chunk of an AI message, which can be concatenated with\n * other AI message chunks.\n */\nexport declare class AIMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"ai\"> implements AIMessage<TStructure>, AIMessageChunkFields<TStructure> {\n readonly type: \"ai\";\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n tool_call_chunks?: ToolCallChunk[];\n usage_metadata?: AIMessageChunkFields<TStructure>[\"usage_metadata\"];\n constructor(fields: $InferMessageContent<TStructure, \"ai\"> | AIMessageChunkFields<TStructure>);\n get lc_aliases(): Record<string, string>;\n static lc_name(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n get _printableFields(): Record<string, unknown>;\n concat(chunk: AIMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is AIMessageChunk;\n}\n"],"mappings":";;;;;;UAIiBU,mCAAmCJ,mBAAmBA,0BAA0BJ,kBAAkBS;eAClGH;EADAE,kBAAe,CAAA,EAEPH,eAFO,EAAA;EAAA,cAAA,CAAA,EAGXF,qBAHW,CAGWM,UAHX,EAAA,IAAA,EAAA,gBAAA,CAAA;;AAAuCL,cAKlDM,SALkDN,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBN,WALxBM,CAKoCK,UALpCL,EAAAA,IAAAA,CAAAA,YAKiEI,eALjEJ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idToolCall","ToolCall","ToolCallChunk","AIMessageFields","TStructure","AIMessage","Record","Standard","Array","isAIMessage","isAIMessageChunk","AIMessageChunk","AIMessageChunkFields"],"sources":["../../src/messages/ai.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, BaseMessageFields } from \"./base.js\";\nimport { ContentBlock } from \"./content/index.js\";\nimport { $InferMessageContent, $InferMessageProperty, MessageStructure } from \"./message.js\";\nimport { InvalidToolCall, ToolCall, ToolCallChunk } from \"./tool.js\";\nexport interface AIMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"ai\"> {\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: $InferMessageProperty<TStructure, \"ai\", \"usage_metadata\">;\n}\nexport declare class AIMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"ai\"> implements AIMessageFields<TStructure> {\n readonly type: \"ai\";\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n usage_metadata?: AIMessageFields<TStructure>[\"usage_metadata\"];\n get lc_aliases(): Record<string, string>;\n constructor(fields: $InferMessageContent<TStructure, \"ai\"> | AIMessageFields<TStructure>);\n static lc_name(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is AIMessage;\n}\n/**\n * @deprecated Use {@link AIMessage.isInstance} instead\n */\nexport declare function isAIMessage<TStructure extends MessageStructure>(x: BaseMessage): x is AIMessage<TStructure>;\n/**\n * @deprecated Use {@link AIMessageChunk.isInstance} instead\n */\nexport declare function isAIMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is AIMessageChunk<TStructure>;\nexport type AIMessageChunkFields<TStructure extends MessageStructure = MessageStructure> = AIMessageFields<TStructure> & {\n tool_call_chunks?: ToolCallChunk[];\n};\n/**\n * Represents a chunk of an AI message, which can be concatenated with\n * other AI message chunks.\n */\nexport declare class AIMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"ai\"> implements AIMessage<TStructure>, AIMessageChunkFields<TStructure> {\n readonly type: \"ai\";\n tool_calls?: ToolCall[];\n invalid_tool_calls?: InvalidToolCall[];\n tool_call_chunks?: ToolCallChunk[];\n usage_metadata?: AIMessageChunkFields<TStructure>[\"usage_metadata\"];\n constructor(fields: $InferMessageContent<TStructure, \"ai\"> | AIMessageChunkFields<TStructure>);\n get lc_aliases(): Record<string, string>;\n static lc_name(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n get _printableFields(): Record<string, unknown>;\n concat(chunk: AIMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is AIMessageChunk;\n}\n"],"mappings":";;;;;;UAIiBU,mCAAmCJ,mBAAmBA,0BAA0BJ,kBAAkBS;eAClGH;EADAE,kBAAe,CAAA,EAEPH,eAFO,EAAA;EAAA,cAAA,CAAA,EAGXF,qBAHW,CAGWM,UAHX,EAAA,IAAA,EAAA,gBAAA,CAAA;;AAAuCL,cAKlDM,SALkDN,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBN,WALxBM,CAKoCK,UALpCL,EAAAA,IAAAA,CAAAA,YAKiEI,eALjEJ,CAKiFK,UALjFL,CAAAA,CAAAA;EAAgB,SAA4BK,IAAAA,EAAAA,IAAAA;EAAU,UAC5GH,CAAAA,EAMAA,QANAA,EAAAA;EAAQ,kBACAD,CAAAA,EAMAA,eANAA,EAAAA;EAAe,cACGI,CAAAA,EAMtBD,eANsBC,CAMNA,UANMA,CAAAA,CAAAA,gBAAAA,CAAAA;EAAU,IAAhCN,UAAAA,CAAAA,CAAAA,EAOCQ,MAPDR,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAqB,WAHuDH,CAAAA,MAAAA,EAWzEE,oBAXyEF,CAWpDS,UAXoDT,EAAAA,IAAAA,CAAAA,GAWhCQ,eAXgCR,CAWhBS,UAXgBT,CAAAA;EAAiB,OAAA,OAAA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A,CAAAA,gBAAAA,CAAAA;EAAgB,WAAKN,CAAAA,MAAAA,EAkBpDI,oBAlBoDJ,CAkB/BW,UAlB+BX,EAAAA,IAAAA,CAAAA,GAkBXmB,oBAlBWnB,CAkBUW,UAlBVX,CAAAA;EAAW,IAAkBW,UAAAA,CAAAA,CAAAA,EAmBnFE,MAnBmFF,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAU,OAApBC,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAS,IAAA,aAAA,CAAA,CAAA,EAqB/EG,KArB+E,CAqBzEZ,YAAAA,CAAaW,QArB4D,CAAA;EAIhFG,IAAAA,gBAAgB,CAAA,CAAA,EAkBZJ,MAlBY,CAAA,MAAA,EAAA,OAAA,CAAA;EAAA,MAAA,CAAA,KAAA,EAmBtBK,cAnBsB,CAmBPP,UAnBO,CAAA,CAAA,EAAA,IAAA;EAAA,OAAoBL,UAAAA,CAAAA,GAAAA,EAAAA,OAAAA,CAAAA,EAAAA,GAAAA,IAoBhBY,cApBgBZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.cts","names":["Serializable","SerializedConstructor","ContentBlock","$InferMessageContent","$InferResponseMetadata","MessageStructure","MessageType","Message","MessageStringFormat","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":["../../src/messages/base.d.ts"],"sourcesContent":["import { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { ContentBlock } from \"./content/index.js\";\nimport { $InferMessageContent, $InferResponseMetadata, MessageStructure, MessageType, Message } from \"./message.js\";\nimport { type MessageStringFormat } from \"./format.js\";\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\nexport interface 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}\nexport interface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\nexport interface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\nexport interface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\nexport type MessageContent = string | Array<ContentBlock>;\nexport interface 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}\nexport type 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};\nexport declare 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 */\nexport declare 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 */\nexport declare 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 */\nexport type 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};\nexport declare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\nexport declare 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>;\nexport declare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare 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 */\nexport declare 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}\nexport type MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\nexport declare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\nexport type BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */\n | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\nexport declare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\nexport declare function isBaseMessageChunk(messageLike?: unknown): messageLike is BaseMessageChunk;\nexport {};\n"],"mappings":";;;;;;;cAKcS;AAAAA,UACGC,iBAAAA,CAD0B;EAC1BA,OAAAA,EAAAA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