langchain 0.2.10 → 0.2.12

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 (345) hide show
  1. package/chat_models/universal.cjs +1 -0
  2. package/chat_models/universal.d.cts +1 -0
  3. package/chat_models/universal.d.ts +1 -0
  4. package/chat_models/universal.js +1 -0
  5. package/dist/chat_models/universal.cjs +600 -0
  6. package/dist/chat_models/universal.d.ts +115 -0
  7. package/dist/chat_models/universal.js +595 -0
  8. package/dist/document_loaders/web/assemblyai.cjs +9 -1
  9. package/dist/document_loaders/web/assemblyai.js +9 -1
  10. package/dist/experimental/chrome_ai/app/dist/bundle.cjs +1250 -0
  11. package/dist/experimental/chrome_ai/app/dist/bundle.d.ts +1 -0
  12. package/dist/experimental/chrome_ai/app/dist/bundle.js +1249 -0
  13. package/dist/load/import_constants.cjs +1 -0
  14. package/dist/load/import_constants.js +1 -0
  15. package/package.json +99 -43
  16. package/dist/agents/tests/agent.int.test.d.ts +0 -1
  17. package/dist/agents/tests/agent.int.test.js +0 -309
  18. package/dist/agents/tests/chat_convo_output_parser.test.d.ts +0 -1
  19. package/dist/agents/tests/chat_convo_output_parser.test.js +0 -91
  20. package/dist/agents/tests/create_openai_functions_agent.int.test.d.ts +0 -2
  21. package/dist/agents/tests/create_openai_functions_agent.int.test.js +0 -71
  22. package/dist/agents/tests/create_openai_tools_agent.int.test.d.ts +0 -1
  23. package/dist/agents/tests/create_openai_tools_agent.int.test.js +0 -75
  24. package/dist/agents/tests/create_react_agent.int.test.d.ts +0 -1
  25. package/dist/agents/tests/create_react_agent.int.test.js +0 -32
  26. package/dist/agents/tests/create_structured_chat_agent.int.test.d.ts +0 -1
  27. package/dist/agents/tests/create_structured_chat_agent.int.test.js +0 -32
  28. package/dist/agents/tests/create_tool_calling_agent.int.test.d.ts +0 -1
  29. package/dist/agents/tests/create_tool_calling_agent.int.test.js +0 -122
  30. package/dist/agents/tests/create_xml_agent.int.test.d.ts +0 -1
  31. package/dist/agents/tests/create_xml_agent.int.test.js +0 -32
  32. package/dist/agents/tests/json.test.d.ts +0 -1
  33. package/dist/agents/tests/json.test.js +0 -74
  34. package/dist/agents/tests/react.test.d.ts +0 -1
  35. package/dist/agents/tests/react.test.js +0 -44
  36. package/dist/agents/tests/runnable.int.test.d.ts +0 -1
  37. package/dist/agents/tests/runnable.int.test.js +0 -104
  38. package/dist/agents/tests/sql.test.d.ts +0 -1
  39. package/dist/agents/tests/sql.test.js +0 -133
  40. package/dist/agents/tests/structured_chat_output_parser.test.d.ts +0 -1
  41. package/dist/agents/tests/structured_chat_output_parser.test.js +0 -35
  42. package/dist/agents/tests/structured_chat_output_parser_with_retries.int.test.d.ts +0 -1
  43. package/dist/agents/tests/structured_chat_output_parser_with_retries.int.test.js +0 -44
  44. package/dist/agents/tests/structured_output_runnables.int.test.d.ts +0 -1
  45. package/dist/agents/tests/structured_output_runnables.int.test.js +0 -112
  46. package/dist/agents/toolkits/tests/conversational_retrieval.int.test.d.ts +0 -1
  47. package/dist/agents/toolkits/tests/conversational_retrieval.int.test.js +0 -41
  48. package/dist/cache/tests/file_system.int.test.d.ts +0 -1
  49. package/dist/cache/tests/file_system.int.test.js +0 -32
  50. package/dist/chains/openai_functions/tests/create_runnable_chains.int.test.d.ts +0 -1
  51. package/dist/chains/openai_functions/tests/create_runnable_chains.int.test.js +0 -139
  52. package/dist/chains/openai_functions/tests/extraction.int.test.d.ts +0 -1
  53. package/dist/chains/openai_functions/tests/extraction.int.test.js +0 -33
  54. package/dist/chains/openai_functions/tests/openapi.int.test.d.ts +0 -1
  55. package/dist/chains/openai_functions/tests/openapi.int.test.js +0 -130
  56. package/dist/chains/openai_functions/tests/openapi.test.d.ts +0 -1
  57. package/dist/chains/openai_functions/tests/openapi.test.js +0 -172
  58. package/dist/chains/openai_functions/tests/structured_output.int.test.d.ts +0 -1
  59. package/dist/chains/openai_functions/tests/structured_output.int.test.js +0 -40
  60. package/dist/chains/openai_functions/tests/structured_output.test.d.ts +0 -1
  61. package/dist/chains/openai_functions/tests/structured_output.test.js +0 -102
  62. package/dist/chains/openai_functions/tests/tagging.int.test.d.ts +0 -1
  63. package/dist/chains/openai_functions/tests/tagging.int.test.js +0 -21
  64. package/dist/chains/query_constructor/tests/query_chain.int.test.d.ts +0 -1
  65. package/dist/chains/query_constructor/tests/query_chain.int.test.js +0 -93
  66. package/dist/chains/query_constructor/tests/query_parser.test.d.ts +0 -1
  67. package/dist/chains/query_constructor/tests/query_parser.test.js +0 -28
  68. package/dist/chains/question_answering/tests/load.int.test.d.ts +0 -1
  69. package/dist/chains/question_answering/tests/load.int.test.js +0 -39
  70. package/dist/chains/router/tests/multi_prompt.int.test.d.ts +0 -1
  71. package/dist/chains/router/tests/multi_prompt.int.test.js +0 -45
  72. package/dist/chains/router/tests/multi_prompt.test.d.ts +0 -1
  73. package/dist/chains/router/tests/multi_prompt.test.js +0 -62
  74. package/dist/chains/router/tests/multi_retrieval_qa.int.test.d.ts +0 -1
  75. package/dist/chains/router/tests/multi_retrieval_qa.int.test.js +0 -67
  76. package/dist/chains/router/tests/multi_retrieval_qa.test.d.ts +0 -1
  77. package/dist/chains/router/tests/multi_retrieval_qa.test.js +0 -125
  78. package/dist/chains/summarization/tests/load.int.test.d.ts +0 -1
  79. package/dist/chains/summarization/tests/load.int.test.js +0 -37
  80. package/dist/chains/tests/api_chain.int.test.d.ts +0 -1
  81. package/dist/chains/tests/api_chain.int.test.js +0 -55
  82. package/dist/chains/tests/combine_docs_chain.int.test.d.ts +0 -1
  83. package/dist/chains/tests/combine_docs_chain.int.test.js +0 -50
  84. package/dist/chains/tests/combine_docs_chain.test.d.ts +0 -1
  85. package/dist/chains/tests/combine_docs_chain.test.js +0 -98
  86. package/dist/chains/tests/constitutional_chain.int.test.d.ts +0 -1
  87. package/dist/chains/tests/constitutional_chain.int.test.js +0 -30
  88. package/dist/chains/tests/constitutional_chain.test.d.ts +0 -1
  89. package/dist/chains/tests/constitutional_chain.test.js +0 -63
  90. package/dist/chains/tests/conversation_chain.int.test.d.ts +0 -1
  91. package/dist/chains/tests/conversation_chain.int.test.js +0 -9
  92. package/dist/chains/tests/conversational_retrieval_chain.int.test.d.ts +0 -1
  93. package/dist/chains/tests/conversational_retrieval_chain.int.test.js +0 -243
  94. package/dist/chains/tests/example_data/open_meteo_docs.d.ts +0 -1
  95. package/dist/chains/tests/example_data/open_meteo_docs.js +0 -29
  96. package/dist/chains/tests/history_aware_retriever.int.test.d.ts +0 -1
  97. package/dist/chains/tests/history_aware_retriever.int.test.js +0 -41
  98. package/dist/chains/tests/history_aware_retriever.test.d.ts +0 -1
  99. package/dist/chains/tests/history_aware_retriever.test.js +0 -27
  100. package/dist/chains/tests/llm_chain.int.test.d.ts +0 -1
  101. package/dist/chains/tests/llm_chain.int.test.js +0 -119
  102. package/dist/chains/tests/openai_moderation.int.test.d.ts +0 -1
  103. package/dist/chains/tests/openai_moderation.int.test.js +0 -30
  104. package/dist/chains/tests/retrieval_chain.int.test.d.ts +0 -1
  105. package/dist/chains/tests/retrieval_chain.int.test.js +0 -69
  106. package/dist/chains/tests/retrieval_chain.test.d.ts +0 -1
  107. package/dist/chains/tests/retrieval_chain.test.js +0 -36
  108. package/dist/chains/tests/sequential_chain.int.test.d.ts +0 -1
  109. package/dist/chains/tests/sequential_chain.int.test.js +0 -88
  110. package/dist/chains/tests/sequential_chain.test.d.ts +0 -1
  111. package/dist/chains/tests/sequential_chain.test.js +0 -295
  112. package/dist/chains/tests/simple_sequential_chain.int.test.d.ts +0 -1
  113. package/dist/chains/tests/simple_sequential_chain.int.test.js +0 -81
  114. package/dist/chains/tests/simple_sequential_chain.test.d.ts +0 -1
  115. package/dist/chains/tests/simple_sequential_chain.test.js +0 -128
  116. package/dist/chains/tests/sql_db_chain.int.test.d.ts +0 -1
  117. package/dist/chains/tests/sql_db_chain.int.test.js +0 -125
  118. package/dist/chains/tests/transform.test.d.ts +0 -1
  119. package/dist/chains/tests/transform.test.js +0 -12
  120. package/dist/chains/tests/vector_db_qa_chain.int.test.d.ts +0 -1
  121. package/dist/chains/tests/vector_db_qa_chain.int.test.js +0 -45
  122. package/dist/document_loaders/tests/assemblyai.int.test.d.ts +0 -1
  123. package/dist/document_loaders/tests/assemblyai.int.test.js +0 -111
  124. package/dist/document_loaders/tests/chatgpt-blob.test.d.ts +0 -1
  125. package/dist/document_loaders/tests/chatgpt-blob.test.js +0 -30
  126. package/dist/document_loaders/tests/chatgpt.test.d.ts +0 -1
  127. package/dist/document_loaders/tests/chatgpt.test.js +0 -29
  128. package/dist/document_loaders/tests/cheerio.int.test.d.ts +0 -1
  129. package/dist/document_loaders/tests/cheerio.int.test.js +0 -21
  130. package/dist/document_loaders/tests/college_confidential.int.test.d.ts +0 -1
  131. package/dist/document_loaders/tests/college_confidential.int.test.js +0 -6
  132. package/dist/document_loaders/tests/confluence.test.d.ts +0 -1
  133. package/dist/document_loaders/tests/confluence.test.js +0 -52
  134. package/dist/document_loaders/tests/couchbase.int.test.d.ts +0 -1
  135. package/dist/document_loaders/tests/couchbase.int.test.js +0 -28
  136. package/dist/document_loaders/tests/csv-blob.test.d.ts +0 -1
  137. package/dist/document_loaders/tests/csv-blob.test.js +0 -53
  138. package/dist/document_loaders/tests/csv.test.d.ts +0 -1
  139. package/dist/document_loaders/tests/csv.test.js +0 -41
  140. package/dist/document_loaders/tests/directory.test.d.ts +0 -1
  141. package/dist/document_loaders/tests/directory.test.js +0 -38
  142. package/dist/document_loaders/tests/docx.test.d.ts +0 -1
  143. package/dist/document_loaders/tests/docx.test.js +0 -11
  144. package/dist/document_loaders/tests/epub.test.d.ts +0 -1
  145. package/dist/document_loaders/tests/epub.test.js +0 -18
  146. package/dist/document_loaders/tests/example_data/github_api_responses.d.ts +0 -5
  147. package/dist/document_loaders/tests/example_data/github_api_responses.js +0 -91
  148. package/dist/document_loaders/tests/figma.int.test.d.ts +0 -1
  149. package/dist/document_loaders/tests/figma.int.test.js +0 -13
  150. package/dist/document_loaders/tests/firecrawl.int.test.d.ts +0 -1
  151. package/dist/document_loaders/tests/firecrawl.int.test.js +0 -30
  152. package/dist/document_loaders/tests/gitbook.int.test.d.ts +0 -1
  153. package/dist/document_loaders/tests/gitbook.int.test.js +0 -14
  154. package/dist/document_loaders/tests/github.int.test.d.ts +0 -1
  155. package/dist/document_loaders/tests/github.int.test.js +0 -86
  156. package/dist/document_loaders/tests/github.test.d.ts +0 -1
  157. package/dist/document_loaders/tests/github.test.js +0 -51
  158. package/dist/document_loaders/tests/hn.int.test.d.ts +0 -1
  159. package/dist/document_loaders/tests/hn.int.test.js +0 -6
  160. package/dist/document_loaders/tests/imsdb.test.d.ts +0 -1
  161. package/dist/document_loaders/tests/imsdb.test.js +0 -6
  162. package/dist/document_loaders/tests/json-blob.test.d.ts +0 -1
  163. package/dist/document_loaders/tests/json-blob.test.js +0 -91
  164. package/dist/document_loaders/tests/json.test.d.ts +0 -1
  165. package/dist/document_loaders/tests/json.test.js +0 -69
  166. package/dist/document_loaders/tests/jsonl-blob.test.d.ts +0 -1
  167. package/dist/document_loaders/tests/jsonl-blob.test.js +0 -46
  168. package/dist/document_loaders/tests/jsonl.test.d.ts +0 -1
  169. package/dist/document_loaders/tests/jsonl.test.js +0 -15
  170. package/dist/document_loaders/tests/multi_file.test.d.ts +0 -1
  171. package/dist/document_loaders/tests/multi_file.test.js +0 -49
  172. package/dist/document_loaders/tests/notion.test.d.ts +0 -1
  173. package/dist/document_loaders/tests/notion.test.js +0 -11
  174. package/dist/document_loaders/tests/notionapi.int.test.d.ts +0 -1
  175. package/dist/document_loaders/tests/notionapi.int.test.js +0 -80
  176. package/dist/document_loaders/tests/notionapi.test.d.ts +0 -1
  177. package/dist/document_loaders/tests/notionapi.test.js +0 -84
  178. package/dist/document_loaders/tests/notiondb.int.test.d.ts +0 -1
  179. package/dist/document_loaders/tests/notiondb.int.test.js +0 -13
  180. package/dist/document_loaders/tests/obsidian.test.d.ts +0 -1
  181. package/dist/document_loaders/tests/obsidian.test.js +0 -119
  182. package/dist/document_loaders/tests/pdf-blob.test.d.ts +0 -1
  183. package/dist/document_loaders/tests/pdf-blob.test.js +0 -44
  184. package/dist/document_loaders/tests/pdf.test.d.ts +0 -1
  185. package/dist/document_loaders/tests/pdf.test.js +0 -25
  186. package/dist/document_loaders/tests/playwright_web.int.test.d.ts +0 -1
  187. package/dist/document_loaders/tests/playwright_web.int.test.js +0 -27
  188. package/dist/document_loaders/tests/pptx.test.d.ts +0 -1
  189. package/dist/document_loaders/tests/pptx.test.js +0 -17
  190. package/dist/document_loaders/tests/puppeteer.int.test.d.ts +0 -1
  191. package/dist/document_loaders/tests/puppeteer.int.test.js +0 -47
  192. package/dist/document_loaders/tests/recursive_url.int.test.d.ts +0 -1
  193. package/dist/document_loaders/tests/recursive_url.int.test.js +0 -64
  194. package/dist/document_loaders/tests/s3.int.test.d.ts +0 -1
  195. package/dist/document_loaders/tests/s3.int.test.js +0 -48
  196. package/dist/document_loaders/tests/searchapi.test.d.ts +0 -1
  197. package/dist/document_loaders/tests/searchapi.test.js +0 -29
  198. package/dist/document_loaders/tests/serpapi.test.d.ts +0 -1
  199. package/dist/document_loaders/tests/serpapi.test.js +0 -21
  200. package/dist/document_loaders/tests/sitemap.int.test.d.ts +0 -1
  201. package/dist/document_loaders/tests/sitemap.int.test.js +0 -28
  202. package/dist/document_loaders/tests/sonix_audio.int.test.d.ts +0 -1
  203. package/dist/document_loaders/tests/sonix_audio.int.test.js +0 -55
  204. package/dist/document_loaders/tests/sort_xyz_blockchain.int.test.d.ts +0 -1
  205. package/dist/document_loaders/tests/sort_xyz_blockchain.int.test.js +0 -38
  206. package/dist/document_loaders/tests/srt-blob.test.d.ts +0 -1
  207. package/dist/document_loaders/tests/srt-blob.test.js +0 -18
  208. package/dist/document_loaders/tests/srt.test.d.ts +0 -1
  209. package/dist/document_loaders/tests/srt.test.js +0 -16
  210. package/dist/document_loaders/tests/text-blob.test.d.ts +0 -1
  211. package/dist/document_loaders/tests/text-blob.test.js +0 -14
  212. package/dist/document_loaders/tests/text.test.d.ts +0 -1
  213. package/dist/document_loaders/tests/text.test.js +0 -22
  214. package/dist/document_loaders/tests/unstructured.int.test.d.ts +0 -1
  215. package/dist/document_loaders/tests/unstructured.int.test.js +0 -58
  216. package/dist/document_loaders/tests/webpdf.int.test.d.ts +0 -1
  217. package/dist/document_loaders/tests/webpdf.int.test.js +0 -90
  218. package/dist/document_transformers/tests/openai_functions.int.test.d.ts +0 -1
  219. package/dist/document_transformers/tests/openai_functions.int.test.js +0 -40
  220. package/dist/embeddings/tests/cache.test.d.ts +0 -1
  221. package/dist/embeddings/tests/cache.test.js +0 -24
  222. package/dist/embeddings/tests/fake.test.d.ts +0 -1
  223. package/dist/embeddings/tests/fake.test.js +0 -34
  224. package/dist/evaluation/agents/tests/trajectory_eval_chain.int.test.d.ts +0 -1
  225. package/dist/evaluation/agents/tests/trajectory_eval_chain.int.test.js +0 -33
  226. package/dist/evaluation/comparison/tests/pairwise_eval_chain.int.test.d.ts +0 -1
  227. package/dist/evaluation/comparison/tests/pairwise_eval_chain.int.test.js +0 -46
  228. package/dist/evaluation/criteria/tests/criteria_eval_chain.int.test.d.ts +0 -1
  229. package/dist/evaluation/criteria/tests/criteria_eval_chain.int.test.js +0 -108
  230. package/dist/evaluation/embedding_distance/tests/embedding_distance_eval_chain.int.test.d.ts +0 -1
  231. package/dist/evaluation/embedding_distance/tests/embedding_distance_eval_chain.int.test.js +0 -26
  232. package/dist/evaluation/qa/tests/eval_chain.int.test.d.ts +0 -1
  233. package/dist/evaluation/qa/tests/eval_chain.int.test.js +0 -27
  234. package/dist/experimental/autogpt/tests/output_parser.test.d.ts +0 -1
  235. package/dist/experimental/autogpt/tests/output_parser.test.js +0 -8
  236. package/dist/experimental/autogpt/tests/prompt.test.d.ts +0 -1
  237. package/dist/experimental/autogpt/tests/prompt.test.js +0 -69
  238. package/dist/experimental/autogpt/tests/prompt_generator.test.d.ts +0 -1
  239. package/dist/experimental/autogpt/tests/prompt_generator.test.js +0 -91
  240. package/dist/experimental/chains/tests/violation_of_expectations_chain.int.test.d.ts +0 -1
  241. package/dist/experimental/chains/tests/violation_of_expectations_chain.int.test.js +0 -26
  242. package/dist/experimental/generative_agents/tests/generative_agent.int.test.d.ts +0 -1
  243. package/dist/experimental/generative_agents/tests/generative_agent.int.test.js +0 -304
  244. package/dist/experimental/masking/tests/masking-extended.test.d.ts +0 -1
  245. package/dist/experimental/masking/tests/masking-extended.test.js +0 -58
  246. package/dist/experimental/masking/tests/masking.test.d.ts +0 -1
  247. package/dist/experimental/masking/tests/masking.test.js +0 -388
  248. package/dist/experimental/openai_assistant/tests/openai_assistant.int.test.d.ts +0 -1
  249. package/dist/experimental/openai_assistant/tests/openai_assistant.int.test.js +0 -203
  250. package/dist/experimental/openai_files/tests/openai_file.int.test.d.ts +0 -1
  251. package/dist/experimental/openai_files/tests/openai_file.int.test.js +0 -87
  252. package/dist/experimental/plan_and_execute/tests/plan_and_execute.int.test.d.ts +0 -1
  253. package/dist/experimental/plan_and_execute/tests/plan_and_execute.int.test.js +0 -54
  254. package/dist/experimental/prompts/tests/handlebars.test.d.ts +0 -1
  255. package/dist/experimental/prompts/tests/handlebars.test.js +0 -24
  256. package/dist/experimental/tools/tests/pyinterpreter.int.test.d.ts +0 -1
  257. package/dist/experimental/tools/tests/pyinterpreter.int.test.js +0 -22
  258. package/dist/load/tests/cross_language.test.d.ts +0 -1
  259. package/dist/load/tests/cross_language.test.js +0 -83
  260. package/dist/load/tests/load.int.test.d.ts +0 -1
  261. package/dist/load/tests/load.int.test.js +0 -9
  262. package/dist/load/tests/load.test.d.ts +0 -1
  263. package/dist/load/tests/load.test.js +0 -412
  264. package/dist/memory/tests/buffer_memory.test.d.ts +0 -1
  265. package/dist/memory/tests/buffer_memory.test.js +0 -34
  266. package/dist/memory/tests/buffer_token_memory.int.test.d.ts +0 -1
  267. package/dist/memory/tests/buffer_token_memory.int.test.js +0 -47
  268. package/dist/memory/tests/buffer_window_memory.test.d.ts +0 -1
  269. package/dist/memory/tests/buffer_window_memory.test.js +0 -42
  270. package/dist/memory/tests/combined_memory.int.test.d.ts +0 -1
  271. package/dist/memory/tests/combined_memory.int.test.js +0 -74
  272. package/dist/memory/tests/entity_memory.int.test.d.ts +0 -1
  273. package/dist/memory/tests/entity_memory.int.test.js +0 -79
  274. package/dist/memory/tests/entity_memory.test.d.ts +0 -1
  275. package/dist/memory/tests/entity_memory.test.js +0 -48
  276. package/dist/memory/tests/summary.int.test.d.ts +0 -1
  277. package/dist/memory/tests/summary.int.test.js +0 -50
  278. package/dist/memory/tests/summary_buffer.int.test.d.ts +0 -1
  279. package/dist/memory/tests/summary_buffer.int.test.js +0 -55
  280. package/dist/memory/tests/vector_store_memory.int.test.d.ts +0 -1
  281. package/dist/memory/tests/vector_store_memory.int.test.js +0 -55
  282. package/dist/output_parsers/tests/combining.int.test.d.ts +0 -1
  283. package/dist/output_parsers/tests/combining.int.test.js +0 -26
  284. package/dist/output_parsers/tests/combining.test.d.ts +0 -1
  285. package/dist/output_parsers/tests/combining.test.js +0 -54
  286. package/dist/output_parsers/tests/datetime.test.d.ts +0 -1
  287. package/dist/output_parsers/tests/datetime.test.js +0 -14
  288. package/dist/output_parsers/tests/expression.test.d.ts +0 -1
  289. package/dist/output_parsers/tests/expression.test.js +0 -339
  290. package/dist/output_parsers/tests/http_response.test.d.ts +0 -1
  291. package/dist/output_parsers/tests/http_response.test.js +0 -39
  292. package/dist/output_parsers/tests/list.test.d.ts +0 -1
  293. package/dist/output_parsers/tests/list.test.js +0 -27
  294. package/dist/output_parsers/tests/openai_functions.int.test.d.ts +0 -1
  295. package/dist/output_parsers/tests/openai_functions.int.test.js +0 -89
  296. package/dist/output_parsers/tests/openai_tools.int.test.d.ts +0 -1
  297. package/dist/output_parsers/tests/openai_tools.int.test.js +0 -36
  298. package/dist/output_parsers/tests/structured.int.test.d.ts +0 -1
  299. package/dist/output_parsers/tests/structured.int.test.js +0 -150
  300. package/dist/prompts/tests/selectors.test.d.ts +0 -1
  301. package/dist/prompts/tests/selectors.test.js +0 -59
  302. package/dist/retrievers/self_query/tests/memory_self_query.int.test.d.ts +0 -1
  303. package/dist/retrievers/self_query/tests/memory_self_query.int.test.js +0 -330
  304. package/dist/retrievers/tests/chain_extract.int.test.d.ts +0 -1
  305. package/dist/retrievers/tests/chain_extract.int.test.js +0 -32
  306. package/dist/retrievers/tests/ensemble_retriever.int.test.d.ts +0 -1
  307. package/dist/retrievers/tests/ensemble_retriever.int.test.js +0 -74
  308. package/dist/retrievers/tests/hyde.int.test.d.ts +0 -1
  309. package/dist/retrievers/tests/hyde.int.test.js +0 -44
  310. package/dist/retrievers/tests/matryoshka_retriever.int.test.d.ts +0 -1
  311. package/dist/retrievers/tests/matryoshka_retriever.int.test.js +0 -113
  312. package/dist/retrievers/tests/multi_query.int.test.d.ts +0 -1
  313. package/dist/retrievers/tests/multi_query.int.test.js +0 -45
  314. package/dist/retrievers/tests/parent_document.int.test.d.ts +0 -1
  315. package/dist/retrievers/tests/parent_document.int.test.js +0 -122
  316. package/dist/retrievers/tests/score_threshold.int.test.d.ts +0 -1
  317. package/dist/retrievers/tests/score_threshold.int.test.js +0 -83
  318. package/dist/retrievers/tests/time_weighted.test.d.ts +0 -1
  319. package/dist/retrievers/tests/time_weighted.test.js +0 -320
  320. package/dist/retrievers/tests/vectorstores.test.d.ts +0 -1
  321. package/dist/retrievers/tests/vectorstores.test.js +0 -50
  322. package/dist/smith/tests/run_on_dataset.int.test.d.ts +0 -1
  323. package/dist/smith/tests/run_on_dataset.int.test.js +0 -257
  324. package/dist/smith/tests/runner_utils.int.test.d.ts +0 -9
  325. package/dist/smith/tests/runner_utils.int.test.js +0 -234
  326. package/dist/storage/tests/file_system.test.d.ts +0 -1
  327. package/dist/storage/tests/file_system.test.js +0 -81
  328. package/dist/tools/tests/chain.test.d.ts +0 -1
  329. package/dist/tools/tests/chain.test.js +0 -136
  330. package/dist/tools/tests/webbrowser.int.test.d.ts +0 -1
  331. package/dist/tools/tests/webbrowser.int.test.js +0 -80
  332. package/dist/tools/tests/webbrowser.test.d.ts +0 -1
  333. package/dist/tools/tests/webbrowser.test.js +0 -21
  334. package/dist/util/tests/async_caller.int.test.d.ts +0 -1
  335. package/dist/util/tests/async_caller.int.test.js +0 -34
  336. package/dist/util/tests/azure.test.d.ts +0 -1
  337. package/dist/util/tests/azure.test.js +0 -42
  338. package/dist/util/tests/openai-stream.test.d.ts +0 -1
  339. package/dist/util/tests/openai-stream.test.js +0 -135
  340. package/dist/util/tests/set.test.d.ts +0 -1
  341. package/dist/util/tests/set.test.js +0 -36
  342. package/dist/util/tests/sql_utils.test.d.ts +0 -1
  343. package/dist/util/tests/sql_utils.test.js +0 -50
  344. package/dist/vectorstores/tests/memory.test.d.ts +0 -1
  345. package/dist/vectorstores/tests/memory.test.js +0 -78
@@ -1,339 +0,0 @@
1
- import { test } from "@jest/globals";
2
- import { ExpressionParser } from "../expression.js";
3
- const correctExps = [
4
- { type: "call_expression", funcCall: "hello", args: [] },
5
- {
6
- type: "call_expression",
7
- funcCall: "hello",
8
- args: [{ type: "string_literal", value: "world" }],
9
- },
10
- {
11
- type: "call_expression",
12
- funcCall: "hello",
13
- args: [
14
- { type: "string_literal", value: "world" },
15
- { type: "string_literal", value: "hello" },
16
- ],
17
- },
18
- {
19
- type: "call_expression",
20
- funcCall: "hello",
21
- args: [
22
- { type: "string_literal", value: "world" },
23
- { type: "string_literal", value: "hello" },
24
- {
25
- type: "array_literal",
26
- values: [
27
- { type: "string_literal", value: "hello" },
28
- { type: "string_literal", value: "world" },
29
- { type: "numeric_literal", value: 1 },
30
- { type: "numeric_literal", value: 2.1 },
31
- { type: "numeric_literal", value: 3 },
32
- ],
33
- },
34
- ],
35
- },
36
- {
37
- type: "call_expression",
38
- funcCall: "hello",
39
- args: [
40
- { type: "string_literal", value: "world" },
41
- { type: "string_literal", value: "hello" },
42
- {
43
- type: "array_literal",
44
- values: [
45
- { type: "string_literal", value: "hello" },
46
- { type: "string_literal", value: "world" },
47
- { type: "numeric_literal", value: 1 },
48
- { type: "numeric_literal", value: 2.1 },
49
- { type: "numeric_literal", value: 3 },
50
- ],
51
- },
52
- {
53
- type: "object_literal",
54
- values: [
55
- {
56
- type: "property_assignment",
57
- identifier: "hello",
58
- value: { type: "string_literal", value: "world" },
59
- },
60
- ],
61
- },
62
- ],
63
- },
64
- {
65
- type: "call_expression",
66
- funcCall: "hello",
67
- args: [
68
- { type: "string_literal", value: "world" },
69
- { type: "string_literal", value: "hello" },
70
- {
71
- type: "array_literal",
72
- values: [
73
- { type: "string_literal", value: "hello" },
74
- { type: "string_literal", value: "world" },
75
- { type: "numeric_literal", value: 1 },
76
- { type: "numeric_literal", value: 2.1 },
77
- { type: "numeric_literal", value: 3 },
78
- ],
79
- },
80
- {
81
- type: "object_literal",
82
- values: [
83
- {
84
- type: "property_assignment",
85
- identifier: "hello",
86
- value: { type: "string_literal", value: "world" },
87
- },
88
- ],
89
- },
90
- { type: "numeric_literal", value: 1 },
91
- { type: "numeric_literal", value: 2.1 },
92
- { type: "numeric_literal", value: 3 },
93
- ],
94
- },
95
- {
96
- type: "call_expression",
97
- funcCall: "hello",
98
- args: [
99
- { type: "string_literal", value: "world" },
100
- { type: "string_literal", value: "hello" },
101
- {
102
- type: "array_literal",
103
- values: [
104
- { type: "string_literal", value: "hello" },
105
- { type: "string_literal", value: "world" },
106
- { type: "numeric_literal", value: 1 },
107
- { type: "numeric_literal", value: 2.1 },
108
- { type: "numeric_literal", value: 3 },
109
- ],
110
- },
111
- {
112
- type: "object_literal",
113
- values: [
114
- {
115
- type: "property_assignment",
116
- identifier: "hello",
117
- value: { type: "string_literal", value: "world" },
118
- },
119
- ],
120
- },
121
- { type: "numeric_literal", value: 1 },
122
- { type: "numeric_literal", value: 2.1 },
123
- { type: "numeric_literal", value: 3 },
124
- {
125
- type: "call_expression",
126
- funcCall: "world",
127
- args: [
128
- { type: "string_literal", value: "hello" },
129
- { type: "string_literal", value: "world" },
130
- {
131
- type: "array_literal",
132
- values: [
133
- {
134
- type: "object_literal",
135
- values: [
136
- {
137
- type: "property_assignment",
138
- identifier: "hello",
139
- value: { type: "string_literal", value: "world" },
140
- },
141
- ],
142
- },
143
- {
144
- type: "object_literal",
145
- values: [
146
- {
147
- type: "property_assignment",
148
- identifier: "hello",
149
- value: {
150
- type: "call_expression",
151
- funcCall: "hello",
152
- args: [{ type: "string_literal", value: "world" }],
153
- },
154
- },
155
- ],
156
- },
157
- ],
158
- },
159
- ],
160
- },
161
- ],
162
- },
163
- {
164
- type: "call_expression",
165
- funcCall: {
166
- type: "member_expression",
167
- identifier: "hello",
168
- property: "world",
169
- },
170
- args: [
171
- { type: "string_literal", value: "hello" },
172
- { type: "string_literal", value: "world" },
173
- {
174
- type: "array_literal",
175
- values: [
176
- { type: "string_literal", value: "hello" },
177
- { type: "string_literal", value: "world" },
178
- ],
179
- },
180
- {
181
- type: "object_literal",
182
- values: [
183
- {
184
- type: "property_assignment",
185
- identifier: "hello",
186
- value: { type: "string_literal", value: "world" },
187
- },
188
- ],
189
- },
190
- ],
191
- },
192
- {
193
- type: "call_expression",
194
- funcCall: {
195
- type: "member_expression",
196
- identifier: "hello",
197
- property: "world",
198
- },
199
- args: [
200
- { type: "string_literal", value: "hello" },
201
- { type: "string_literal", value: "world" },
202
- {
203
- type: "array_literal",
204
- values: [
205
- { type: "string_literal", value: "hello" },
206
- { type: "string_literal", value: "world" },
207
- ],
208
- },
209
- ],
210
- },
211
- {
212
- type: "call_expression",
213
- funcCall: "a",
214
- args: [
215
- { type: "identifier", value: "b" },
216
- {
217
- type: "call_expression",
218
- funcCall: "c",
219
- args: [
220
- { type: "identifier", value: "d" },
221
- { type: "identifier", value: "e" },
222
- {
223
- type: "array_literal",
224
- values: [
225
- { type: "identifier", value: "f" },
226
- { type: "identifier", value: "g" },
227
- ],
228
- },
229
- {
230
- type: "object_literal",
231
- values: [
232
- {
233
- type: "property_assignment",
234
- identifier: "h",
235
- value: { type: "identifier", value: "i" },
236
- },
237
- ],
238
- },
239
- ],
240
- },
241
- ],
242
- },
243
- {
244
- type: "call_expression",
245
- funcCall: "and",
246
- args: [
247
- {
248
- type: "call_expression",
249
- funcCall: "in",
250
- args: [
251
- { type: "string_literal", value: "a" },
252
- {
253
- type: "array_literal",
254
- values: [
255
- { type: "string_literal", value: "a" },
256
- { type: "string_literal", value: "b" },
257
- { type: "string_literal", value: "c" },
258
- ],
259
- },
260
- ],
261
- },
262
- {
263
- type: "call_expression",
264
- funcCall: "eq",
265
- args: [
266
- { type: "string_literal", value: "a" },
267
- { type: "string_literal", value: "b" },
268
- ],
269
- },
270
- ],
271
- },
272
- {
273
- type: "call_expression",
274
- funcCall: "with",
275
- args: [
276
- {
277
- type: "call_expression",
278
- funcCall: "const",
279
- args: [
280
- { type: "string_literal", value: "a" },
281
- {
282
- type: "array_literal",
283
- values: [
284
- { type: "string_literal", value: "a" },
285
- { type: "string_literal", value: "b" },
286
- { type: "string_literal", value: "c" },
287
- ],
288
- },
289
- ],
290
- },
291
- {
292
- type: "call_expression",
293
- funcCall: "eq",
294
- args: [
295
- { type: "string_literal", value: "a" },
296
- { type: "string_literal", value: "b" },
297
- { type: "boolean_literal", value: true },
298
- ],
299
- },
300
- ],
301
- },
302
- ];
303
- test("ExpressionParser multiple expressions test", async () => {
304
- const parser = new ExpressionParser();
305
- await parser.ensureParser();
306
- const expressions = [
307
- `hello()`,
308
- `hello("world")`,
309
- `hello("world", "hello")`,
310
- `hello("world", "hello", ["hello", "world", 1, 2.1, 3])`,
311
- `hello("world", "hello", ["hello", "world", 1, 2.1, 3], { hello: "world" })`,
312
- `hello("world", "hello", ["hello", "world", 1, 2.1, 3], { hello: "world" }, 1, 2.1, 3)`,
313
- `hello("world", "hello", ["hello", "world", 1, 2.1, 3], { hello: "world" }, 1, 2.1, 3, world("hello", "world", [{hello: "world"}, {"hello": hello("world")}]))`,
314
- `hello.world("hello", "world", ["hello", "world"], {"hello": "world"})`,
315
- `hello["world"]("hello", "world", ["hello", "world"])`,
316
- `a(b, c(d, e, [f, g], {h: i}))`,
317
- `and(in("a", ["a", "b", "c"]), eq("a", "b"))`,
318
- `with(const("a", ["a", "b", "c"]), eq("a", "b", true))`,
319
- ];
320
- const badExpressions = [
321
- `hello(`,
322
- `hello("world", ["hello", "world", 1, 2, 3 { hello: "world" })`,
323
- `hello("world", ["hello, "world", { hello: "world" )`,
324
- `l:::"""(}))))++===/...`,
325
- ];
326
- const parsedPromise = expressions.map((expression) => parser.parse(expression));
327
- const badExpressionsPromise = badExpressions.map((expression) => parser.parse(expression).catch(() => "bad"));
328
- await Promise.allSettled(badExpressionsPromise).then((errors) => {
329
- errors.forEach((err) => {
330
- if (err.status === "fulfilled") {
331
- expect(err.value).toBe("bad");
332
- }
333
- });
334
- });
335
- const parsed = await Promise.all(parsedPromise);
336
- parsed.forEach((expression, index) => {
337
- expect(expression).toMatchObject(correctExps[index]);
338
- });
339
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import { FakeStreamingLLM } from "@langchain/core/utils/testing";
2
- import { HttpResponseOutputParser } from "../http_response.js";
3
- test("text/plain stream", async () => {
4
- const llm = new FakeStreamingLLM({});
5
- const stream = await llm
6
- .pipe(new HttpResponseOutputParser())
7
- .stream("Hi there!");
8
- const chunks = [];
9
- const decoder = new TextDecoder();
10
- for await (const chunk of stream) {
11
- chunks.push(decoder.decode(chunk));
12
- }
13
- expect(chunks.length).toEqual("Hi there!".length);
14
- expect(chunks.join("")).toEqual("Hi there!");
15
- });
16
- test("text/event-stream stream", async () => {
17
- const llm = new FakeStreamingLLM({});
18
- const stream = await llm
19
- .pipe(new HttpResponseOutputParser({ contentType: "text/event-stream" }))
20
- .stream("Hi there!");
21
- const chunks = [];
22
- const decoder = new TextDecoder();
23
- for await (const chunk of stream) {
24
- chunks.push(decoder.decode(chunk));
25
- }
26
- expect(chunks.length).toEqual("Hi there!".length + 1);
27
- expect(chunks).toEqual([
28
- `event: data\ndata: "H"\n\n`,
29
- `event: data\ndata: "i"\n\n`,
30
- `event: data\ndata: " "\n\n`,
31
- `event: data\ndata: "t"\n\n`,
32
- `event: data\ndata: "h"\n\n`,
33
- `event: data\ndata: "e"\n\n`,
34
- `event: data\ndata: "r"\n\n`,
35
- `event: data\ndata: "e"\n\n`,
36
- `event: data\ndata: "!"\n\n`,
37
- `event: end\n\n`,
38
- ]);
39
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { test, expect } from "@jest/globals";
2
- import { OutputParserException, CommaSeparatedListOutputParser, CustomListOutputParser, } from "@langchain/core/output_parsers";
3
- test("CommaSeparatedListOutputParser", async () => {
4
- const parser = new CommaSeparatedListOutputParser();
5
- expect(await parser.parse("hello, bye")).toEqual(["hello", "bye"]);
6
- expect(await parser.parse("hello,bye")).toEqual(["hello", "bye"]);
7
- expect(await parser.parse("hello")).toEqual(["hello"]);
8
- });
9
- test("CustomListOutputParser", async () => {
10
- const parser1 = new CustomListOutputParser({ length: 3, separator: ";" });
11
- expect(await parser1.parse("a; b;c")).toEqual(["a", "b", "c"]);
12
- await expect(() => parser1.parse("a; b c")).rejects.toThrow(OutputParserException);
13
- await expect(() => parser1.parse("a; b; c; d")).rejects.toThrow(OutputParserException);
14
- const parser2 = new CustomListOutputParser({ separator: "\n" });
15
- expect(await parser2.parse("a\nb\nc\nd")).toEqual(["a", "b", "c", "d"]);
16
- const parser3 = new CustomListOutputParser({ length: 8 });
17
- expect(await parser3.parse("a,b,c,d,e,f,g,h")).toEqual([
18
- "a",
19
- "b",
20
- "c",
21
- "d",
22
- "e",
23
- "f",
24
- "g",
25
- "h",
26
- ]);
27
- });
@@ -1,89 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { expect, test } from "@jest/globals";
3
- import { z } from "zod";
4
- import { zodToJsonSchema } from "zod-to-json-schema";
5
- import { applyPatch } from "@langchain/core/utils/json_patch";
6
- import { ChatOpenAI } from "@langchain/openai";
7
- import { ChatPromptTemplate } from "@langchain/core/prompts";
8
- import { JsonOutputFunctionsParser } from "../openai_functions.js";
9
- import { HttpResponseOutputParser } from "../http_response.js";
10
- const schema = z.object({
11
- setup: z.string().describe("The setup for the joke"),
12
- punchline: z.string().describe("The punchline to the joke"),
13
- });
14
- const modelParams = {
15
- functions: [
16
- {
17
- name: "joke",
18
- description: "A joke",
19
- parameters: zodToJsonSchema(schema),
20
- },
21
- ],
22
- function_call: { name: "joke" },
23
- };
24
- test("Streaming JSON patch", async () => {
25
- const prompt = ChatPromptTemplate.fromTemplate(`tell me a long joke about {foo}`);
26
- const model = new ChatOpenAI({
27
- temperature: 0,
28
- }).bind(modelParams);
29
- const parser = new JsonOutputFunctionsParser({ diff: true });
30
- const chain = prompt.pipe(model).pipe(parser);
31
- const stream = await chain.stream({
32
- foo: "bears",
33
- });
34
- const chunks = [];
35
- let aggregate = {};
36
- for await (const chunk of stream) {
37
- console.log(chunk);
38
- chunks.push(chunk);
39
- aggregate = applyPatch(aggregate, chunk).newDocument;
40
- }
41
- expect(chunks.length).toBeGreaterThan(1);
42
- console.log(aggregate);
43
- expect(aggregate.setup.length).toBeGreaterThan(1);
44
- expect(aggregate.punchline.length).toBeGreaterThan(1);
45
- });
46
- test("Streaming JSON patch with an event stream output parser", async () => {
47
- const prompt = ChatPromptTemplate.fromTemplate(`tell me a long joke about {foo}`);
48
- const model = new ChatOpenAI({
49
- temperature: 0,
50
- }).bind(modelParams);
51
- const jsonParser = new JsonOutputFunctionsParser({ diff: true });
52
- const parser = new HttpResponseOutputParser({
53
- outputParser: jsonParser,
54
- contentType: "text/event-stream",
55
- });
56
- const chain = prompt.pipe(model).pipe(parser);
57
- const stream = await chain.stream({
58
- foo: "bears",
59
- });
60
- const chunks = [];
61
- const decoder = new TextDecoder();
62
- for await (const chunk of stream) {
63
- console.log(decoder.decode(chunk));
64
- chunks.push(chunk);
65
- }
66
- expect(chunks.length).toBeGreaterThan(1);
67
- });
68
- test("Streaming aggregated JSON", async () => {
69
- const prompt = ChatPromptTemplate.fromTemplate(`tell me a long joke about {foo}`);
70
- const model = new ChatOpenAI({
71
- temperature: 0,
72
- }).bind(modelParams);
73
- const parser = new JsonOutputFunctionsParser();
74
- const chain = prompt.pipe(model).pipe(parser);
75
- const stream = await chain.stream({
76
- foo: "bears",
77
- });
78
- const chunks = [];
79
- let aggregate = {};
80
- for await (const chunk of stream) {
81
- console.log(chunk);
82
- chunks.push(chunk);
83
- aggregate = chunk;
84
- }
85
- expect(chunks.length).toBeGreaterThan(1);
86
- console.log(aggregate);
87
- expect(aggregate.setup.length).toBeGreaterThan(1);
88
- expect(aggregate.punchline.length).toBeGreaterThan(1);
89
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { expect, test } from "@jest/globals";
3
- import { z } from "zod";
4
- import { zodToJsonSchema } from "zod-to-json-schema";
5
- import { ChatOpenAI } from "@langchain/openai";
6
- import { ChatPromptTemplate } from "@langchain/core/prompts";
7
- import { JsonOutputToolsParser } from "../openai_tools.js";
8
- const schema = z.object({
9
- setup: z.string().describe("The setup for the joke"),
10
- punchline: z.string().describe("The punchline to the joke"),
11
- });
12
- test("Extraction", async () => {
13
- const prompt = ChatPromptTemplate.fromTemplate(`tell me two jokes about {foo}`);
14
- const model = new ChatOpenAI({
15
- modelName: "gpt-3.5-turbo-1106",
16
- temperature: 0,
17
- }).bind({
18
- tools: [
19
- {
20
- type: "function",
21
- function: {
22
- name: "joke",
23
- description: "A joke",
24
- parameters: zodToJsonSchema(schema),
25
- },
26
- },
27
- ],
28
- });
29
- const parser = new JsonOutputToolsParser();
30
- const chain = prompt.pipe(model).pipe(parser);
31
- const res = await chain.invoke({
32
- foo: "bears",
33
- });
34
- console.log(res);
35
- expect(res.length).toBe(2);
36
- });
@@ -1 +0,0 @@
1
- export {};