@langchain/classic 1.0.27 → 1.0.28

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 (298) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/agents/agent.cjs.map +1 -1
  3. package/dist/agents/agent.js.map +1 -1
  4. package/dist/agents/executor.cjs.map +1 -1
  5. package/dist/agents/executor.js.map +1 -1
  6. package/dist/agents/openai_functions/index.cjs.map +1 -1
  7. package/dist/agents/openai_functions/index.d.cts.map +1 -1
  8. package/dist/agents/openai_functions/index.d.ts.map +1 -1
  9. package/dist/agents/openai_functions/index.js.map +1 -1
  10. package/dist/agents/openai_tools/index.cjs.map +1 -1
  11. package/dist/agents/openai_tools/index.d.cts +2 -2
  12. package/dist/agents/openai_tools/index.d.cts.map +1 -1
  13. package/dist/agents/openai_tools/index.d.ts +2 -2
  14. package/dist/agents/openai_tools/index.d.ts.map +1 -1
  15. package/dist/agents/openai_tools/index.js.map +1 -1
  16. package/dist/agents/react/index.d.cts +2 -2
  17. package/dist/agents/react/index.d.cts.map +1 -1
  18. package/dist/agents/react/index.d.ts +2 -2
  19. package/dist/agents/react/index.d.ts.map +1 -1
  20. package/dist/agents/structured_chat/index.d.cts +2 -2
  21. package/dist/agents/structured_chat/index.d.cts.map +1 -1
  22. package/dist/agents/structured_chat/index.d.ts +2 -2
  23. package/dist/agents/structured_chat/index.d.ts.map +1 -1
  24. package/dist/agents/tool_calling/index.d.cts +2 -2
  25. package/dist/agents/tool_calling/index.d.cts.map +1 -1
  26. package/dist/agents/tool_calling/index.d.ts +2 -2
  27. package/dist/agents/tool_calling/index.d.ts.map +1 -1
  28. package/dist/agents/tool_calling/output_parser.cjs.map +1 -1
  29. package/dist/agents/tool_calling/output_parser.d.cts.map +1 -1
  30. package/dist/agents/tool_calling/output_parser.js.map +1 -1
  31. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts +2 -2
  32. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts.map +1 -1
  33. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts +2 -2
  34. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts.map +1 -1
  35. package/dist/agents/xml/index.d.cts.map +1 -1
  36. package/dist/agents/xml/index.d.ts.map +1 -1
  37. package/dist/cache/file_system.cjs.map +1 -1
  38. package/dist/cache/file_system.js.map +1 -1
  39. package/dist/chains/analyze_documents_chain.cjs.map +1 -1
  40. package/dist/chains/analyze_documents_chain.js.map +1 -1
  41. package/dist/chains/base.cjs.map +1 -1
  42. package/dist/chains/base.d.cts +2 -2
  43. package/dist/chains/base.d.cts.map +1 -1
  44. package/dist/chains/base.d.ts +2 -2
  45. package/dist/chains/base.d.ts.map +1 -1
  46. package/dist/chains/base.js.map +1 -1
  47. package/dist/chains/chat_vector_db_chain.cjs.map +1 -1
  48. package/dist/chains/chat_vector_db_chain.js.map +1 -1
  49. package/dist/chains/combine_docs_chain.d.cts +2 -2
  50. package/dist/chains/combine_docs_chain.d.cts.map +1 -1
  51. package/dist/chains/combine_docs_chain.d.ts +2 -2
  52. package/dist/chains/combine_docs_chain.d.ts.map +1 -1
  53. package/dist/chains/combine_documents/reduce.cjs.map +1 -1
  54. package/dist/chains/combine_documents/reduce.js.map +1 -1
  55. package/dist/chains/conversational_retrieval_chain.cjs.map +1 -1
  56. package/dist/chains/conversational_retrieval_chain.js.map +1 -1
  57. package/dist/chains/graph_qa/cypher.cjs.map +1 -1
  58. package/dist/chains/graph_qa/cypher.js.map +1 -1
  59. package/dist/chains/llm_chain.cjs.map +1 -1
  60. package/dist/chains/llm_chain.js.map +1 -1
  61. package/dist/chains/load.d.cts +1 -2
  62. package/dist/chains/load.d.cts.map +1 -1
  63. package/dist/chains/load.d.ts +1 -2
  64. package/dist/chains/load.d.ts.map +1 -1
  65. package/dist/chains/openai_functions/base.cjs.map +1 -1
  66. package/dist/chains/openai_functions/base.js.map +1 -1
  67. package/dist/chains/openai_functions/openapi.cjs.map +1 -1
  68. package/dist/chains/openai_functions/openapi.js.map +1 -1
  69. package/dist/chains/openai_moderation.cjs.map +1 -1
  70. package/dist/chains/openai_moderation.js.map +1 -1
  71. package/dist/chains/query_constructor/index.cjs.map +1 -1
  72. package/dist/chains/query_constructor/index.js.map +1 -1
  73. package/dist/chains/question_answering/load.d.cts +1 -2
  74. package/dist/chains/question_answering/load.d.cts.map +1 -1
  75. package/dist/chains/question_answering/load.d.ts +1 -2
  76. package/dist/chains/question_answering/load.d.ts.map +1 -1
  77. package/dist/chains/retrieval.cjs.map +1 -1
  78. package/dist/chains/retrieval.js.map +1 -1
  79. package/dist/chains/retrieval_qa.cjs.map +1 -1
  80. package/dist/chains/retrieval_qa.js.map +1 -1
  81. package/dist/chains/router/utils.cjs.map +1 -1
  82. package/dist/chains/router/utils.js.map +1 -1
  83. package/dist/chains/summarization/load.d.cts +1 -2
  84. package/dist/chains/summarization/load.d.cts.map +1 -1
  85. package/dist/chains/summarization/load.d.ts +1 -2
  86. package/dist/chains/summarization/load.d.ts.map +1 -1
  87. package/dist/chains/vector_db_qa.cjs.map +1 -1
  88. package/dist/chains/vector_db_qa.js.map +1 -1
  89. package/dist/chat_models/universal.cjs +8 -10
  90. package/dist/chat_models/universal.cjs.map +1 -1
  91. package/dist/chat_models/universal.d.cts +3 -5
  92. package/dist/chat_models/universal.d.cts.map +1 -1
  93. package/dist/chat_models/universal.d.ts +3 -5
  94. package/dist/chat_models/universal.d.ts.map +1 -1
  95. package/dist/chat_models/universal.js +8 -10
  96. package/dist/chat_models/universal.js.map +1 -1
  97. package/dist/document_loaders/fs/directory.d.cts.map +1 -1
  98. package/dist/document_loaders/fs/directory.d.ts.map +1 -1
  99. package/dist/document_loaders/fs/json.cjs.map +1 -1
  100. package/dist/document_loaders/fs/json.js.map +1 -1
  101. package/dist/document_transformers/openai_functions.d.cts.map +1 -1
  102. package/dist/evaluation/agents/index.d.cts +1 -0
  103. package/dist/evaluation/agents/trajectory.d.cts +2 -2
  104. package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
  105. package/dist/evaluation/agents/trajectory.d.ts +2 -2
  106. package/dist/evaluation/agents/trajectory.d.ts.map +1 -1
  107. package/dist/evaluation/base.cjs.map +1 -1
  108. package/dist/evaluation/base.d.cts.map +1 -1
  109. package/dist/evaluation/base.js.map +1 -1
  110. package/dist/evaluation/comparison/index.d.cts +1 -0
  111. package/dist/evaluation/comparison/pairwise.cjs.map +1 -1
  112. package/dist/evaluation/comparison/pairwise.d.cts +3 -3
  113. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  114. package/dist/evaluation/comparison/pairwise.d.ts +3 -3
  115. package/dist/evaluation/comparison/pairwise.d.ts.map +1 -1
  116. package/dist/evaluation/comparison/pairwise.js.map +1 -1
  117. package/dist/evaluation/criteria/criteria.cjs.map +1 -1
  118. package/dist/evaluation/criteria/criteria.d.cts +3 -3
  119. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  120. package/dist/evaluation/criteria/criteria.d.ts +3 -3
  121. package/dist/evaluation/criteria/criteria.d.ts.map +1 -1
  122. package/dist/evaluation/criteria/criteria.js.map +1 -1
  123. package/dist/evaluation/criteria/index.d.cts +1 -0
  124. package/dist/evaluation/embedding_distance/index.d.cts +1 -0
  125. package/dist/evaluation/loader.cjs.map +1 -1
  126. package/dist/evaluation/loader.d.cts.map +1 -1
  127. package/dist/evaluation/loader.js.map +1 -1
  128. package/dist/evaluation/qa/index.d.cts +1 -0
  129. package/dist/experimental/autogpt/prompt.d.cts +2 -2
  130. package/dist/experimental/autogpt/prompt.d.cts.map +1 -1
  131. package/dist/experimental/autogpt/prompt.d.ts +2 -2
  132. package/dist/experimental/autogpt/prompt.d.ts.map +1 -1
  133. package/dist/experimental/autogpt/prompt_generator.cjs.map +1 -1
  134. package/dist/experimental/autogpt/prompt_generator.js.map +1 -1
  135. package/dist/experimental/autogpt/schema.cjs.map +1 -1
  136. package/dist/experimental/autogpt/schema.js.map +1 -1
  137. package/dist/experimental/generative_agents/generative_agent_memory.cjs.map +1 -1
  138. package/dist/experimental/generative_agents/generative_agent_memory.js.map +1 -1
  139. package/dist/experimental/masking/parser.cjs.map +1 -1
  140. package/dist/experimental/masking/parser.js.map +1 -1
  141. package/dist/experimental/masking/regex_masking_transformer.cjs.map +1 -1
  142. package/dist/experimental/masking/regex_masking_transformer.js.map +1 -1
  143. package/dist/experimental/openai_assistant/index.cjs.map +1 -1
  144. package/dist/experimental/openai_assistant/index.d.cts +3 -3
  145. package/dist/experimental/openai_assistant/index.d.ts +3 -3
  146. package/dist/experimental/openai_assistant/index.js.map +1 -1
  147. package/dist/experimental/openai_files/index.d.cts +4 -4
  148. package/dist/experimental/openai_files/index.d.ts +4 -4
  149. package/dist/experimental/plan_and_execute/agent_executor.cjs.map +1 -1
  150. package/dist/experimental/plan_and_execute/agent_executor.js.map +1 -1
  151. package/dist/experimental/prompts/custom_format.cjs.map +1 -1
  152. package/dist/experimental/prompts/custom_format.js.map +1 -1
  153. package/dist/experimental/prompts/handlebars.cjs.map +1 -1
  154. package/dist/experimental/prompts/handlebars.d.cts +2 -2
  155. package/dist/experimental/prompts/handlebars.d.cts.map +1 -1
  156. package/dist/experimental/prompts/handlebars.d.ts +2 -2
  157. package/dist/experimental/prompts/handlebars.d.ts.map +1 -1
  158. package/dist/experimental/prompts/handlebars.js.map +1 -1
  159. package/dist/hub/base.cjs.map +1 -1
  160. package/dist/hub/base.d.cts +0 -1
  161. package/dist/hub/base.d.cts.map +1 -1
  162. package/dist/hub/base.d.ts +0 -1
  163. package/dist/hub/base.d.ts.map +1 -1
  164. package/dist/hub/base.js.map +1 -1
  165. package/dist/hub/index.cjs.map +1 -1
  166. package/dist/hub/index.js.map +1 -1
  167. package/dist/load/index.cjs.map +1 -1
  168. package/dist/load/index.js.map +1 -1
  169. package/dist/output_parsers/combining.cjs.map +1 -1
  170. package/dist/output_parsers/combining.js.map +1 -1
  171. package/dist/output_parsers/expression_type_handlers/base.cjs.map +1 -1
  172. package/dist/output_parsers/expression_type_handlers/base.d.cts.map +1 -1
  173. package/dist/output_parsers/expression_type_handlers/base.d.ts.map +1 -1
  174. package/dist/output_parsers/expression_type_handlers/base.js.map +1 -1
  175. package/dist/output_parsers/fix.cjs.map +1 -1
  176. package/dist/output_parsers/fix.js.map +1 -1
  177. package/dist/output_parsers/openai_functions.d.cts.map +1 -1
  178. package/dist/output_parsers/openai_functions.d.ts.map +1 -1
  179. package/dist/output_parsers/openai_tools.cjs.map +1 -1
  180. package/dist/output_parsers/openai_tools.js.map +1 -1
  181. package/dist/output_parsers/regex.cjs.map +1 -1
  182. package/dist/output_parsers/regex.js.map +1 -1
  183. package/dist/output_parsers/structured.d.cts +2 -2
  184. package/dist/output_parsers/structured.d.cts.map +1 -1
  185. package/dist/output_parsers/structured.d.ts +2 -2
  186. package/dist/output_parsers/structured.d.ts.map +1 -1
  187. package/dist/retrievers/document_compressors/index.cjs.map +1 -1
  188. package/dist/retrievers/document_compressors/index.js.map +1 -1
  189. package/dist/retrievers/matryoshka_retriever.cjs.map +1 -1
  190. package/dist/retrievers/matryoshka_retriever.d.cts +1 -1
  191. package/dist/retrievers/matryoshka_retriever.d.cts.map +1 -1
  192. package/dist/retrievers/matryoshka_retriever.d.ts +1 -1
  193. package/dist/retrievers/matryoshka_retriever.d.ts.map +1 -1
  194. package/dist/retrievers/matryoshka_retriever.js.map +1 -1
  195. package/dist/retrievers/multi_query.cjs.map +1 -1
  196. package/dist/retrievers/multi_query.js.map +1 -1
  197. package/dist/retrievers/parent_document.cjs.map +1 -1
  198. package/dist/retrievers/parent_document.js.map +1 -1
  199. package/dist/schema/prompt_template.d.cts +1 -2
  200. package/dist/schema/prompt_template.d.cts.map +1 -1
  201. package/dist/schema/prompt_template.d.ts +1 -2
  202. package/dist/schema/prompt_template.d.ts.map +1 -1
  203. package/dist/smith/config.cjs.map +1 -1
  204. package/dist/smith/config.d.cts +1 -1
  205. package/dist/smith/config.d.ts +1 -1
  206. package/dist/smith/config.d.ts.map +1 -1
  207. package/dist/smith/config.js.map +1 -1
  208. package/dist/smith/runner_utils.cjs.map +1 -1
  209. package/dist/smith/runner_utils.d.cts +1 -1
  210. package/dist/smith/runner_utils.d.cts.map +1 -1
  211. package/dist/smith/runner_utils.d.ts +1 -1
  212. package/dist/smith/runner_utils.d.ts.map +1 -1
  213. package/dist/smith/runner_utils.js.map +1 -1
  214. package/dist/sql_db.d.cts +2 -2
  215. package/dist/sql_db.d.cts.map +1 -1
  216. package/dist/sql_db.d.ts +2 -2
  217. package/dist/sql_db.d.ts.map +1 -1
  218. package/dist/storage/encoder_backed.cjs.map +1 -1
  219. package/dist/storage/encoder_backed.js.map +1 -1
  220. package/dist/storage/file_system.cjs.map +1 -1
  221. package/dist/storage/file_system.js.map +1 -1
  222. package/dist/stores/doc/in_memory.cjs.map +1 -1
  223. package/dist/stores/doc/in_memory.js.map +1 -1
  224. package/dist/tools/json.cjs.map +1 -1
  225. package/dist/tools/json.js.map +1 -1
  226. package/dist/tools/webbrowser.cjs.map +1 -1
  227. package/dist/tools/webbrowser.d.cts.map +1 -1
  228. package/dist/tools/webbrowser.d.ts.map +1 -1
  229. package/dist/tools/webbrowser.js.map +1 -1
  230. package/dist/util/document.d.cts +1 -1
  231. package/dist/util/document.d.cts.map +1 -1
  232. package/dist/util/document.d.ts +1 -1
  233. package/dist/util/document.d.ts.map +1 -1
  234. package/dist/util/is-network-error/index.cjs.map +1 -1
  235. package/dist/util/is-network-error/index.js.map +1 -1
  236. package/dist/util/load.cjs.map +1 -1
  237. package/dist/util/load.js.map +1 -1
  238. package/dist/util/openapi.cjs.map +1 -1
  239. package/dist/util/openapi.d.cts +32 -32
  240. package/dist/util/openapi.d.cts.map +1 -1
  241. package/dist/util/openapi.d.ts +32 -32
  242. package/dist/util/openapi.d.ts.map +1 -1
  243. package/dist/util/openapi.js.map +1 -1
  244. package/dist/util/p-retry/index.cjs.map +1 -1
  245. package/dist/util/p-retry/index.js.map +1 -1
  246. package/dist/vectorstores/memory.cjs.map +1 -1
  247. package/dist/vectorstores/memory.js.map +1 -1
  248. package/package.json +25 -48
  249. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.cts +0 -1494
  250. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.cts.map +0 -1
  251. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.ts +0 -1494
  252. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.ts.map +0 -1
  253. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.cts +0 -1
  254. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.ts +0 -1
  255. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.cts +0 -1
  256. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +0 -1
  257. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.cts +0 -66
  258. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.cts.map +0 -1
  259. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.ts +0 -66
  260. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.ts.map +0 -1
  261. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.cts +0 -1
  262. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.ts +0 -1
  263. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.cts +0 -1
  264. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.ts +0 -1
  265. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/index.d.cts +0 -4
  266. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/index.d.ts +0 -4
  267. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.cts +0 -145
  268. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.cts.map +0 -1
  269. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.ts +0 -145
  270. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.ts.map +0 -1
  271. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.cts +0 -437
  272. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.cts.map +0 -1
  273. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.ts +0 -437
  274. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.ts.map +0 -1
  275. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts +0 -7
  276. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts.map +0 -1
  277. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts +0 -7
  278. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts.map +0 -1
  279. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.cts +0 -38
  280. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.cts.map +0 -1
  281. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.ts +0 -38
  282. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.ts.map +0 -1
  283. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts +0 -25
  284. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts.map +0 -1
  285. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts +0 -25
  286. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts.map +0 -1
  287. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.cts +0 -1
  288. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.ts +0 -1
  289. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.cts +0 -129
  290. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.cts.map +0 -1
  291. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.ts +0 -129
  292. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.ts.map +0 -1
  293. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.cts +0 -1
  294. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.ts +0 -1
  295. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/singletons/traceable.d.cts +0 -2
  296. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/singletons/traceable.d.ts +0 -2
  297. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.cts +0 -1
  298. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.ts +0 -1
@@ -1,1494 +0,0 @@
1
- import { AnnotationQueue, AnnotationQueueRubricItem, AnnotationQueueWithDetails, Attachments, ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, DatasetVersion, Example, ExampleCreate, ExampleSearch, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackConfigSchema, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, RunWithAnnotationQueueInfo, ScoreType, TimeDelta, TracerSession, TracerSessionResult, UpdateExamplesResponse, UploadExamplesResponse, ValueType } from "./schemas.js";
2
- import { AsyncCallerParams } from "./utils/async_caller.js";
3
- import { EvaluationResult, EvaluationResults } from "./evaluation/evaluator.js";
4
- import { PromptCache } from "./utils/prompt_cache/index.js";
5
-
6
- //#region ../../node_modules/.pnpm/langsmith@0.5.9_@opentelemetry+api@1.9.0_openai@6.22.0_ws@8.20.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.ts
7
- interface ClientConfig {
8
- apiUrl?: string;
9
- apiKey?: string;
10
- callerOptions?: AsyncCallerParams;
11
- timeout_ms?: number;
12
- webUrl?: string;
13
- anonymizer?: (values: KVMap) => KVMap | Promise<KVMap>;
14
- hideInputs?: boolean | ((inputs: KVMap) => KVMap | Promise<KVMap>);
15
- hideOutputs?: boolean | ((outputs: KVMap) => KVMap | Promise<KVMap>);
16
- /**
17
- * Whether to omit runtime information from traced runs.
18
- * If true, runtime information (SDK version, platform, etc.) and
19
- * LangChain environment variable metadata will not be stored in runs.
20
- * Defaults to false.
21
- */
22
- omitTracedRuntimeInfo?: boolean;
23
- autoBatchTracing?: boolean;
24
- /** Maximum size of a batch of runs in bytes. */
25
- batchSizeBytesLimit?: number;
26
- /** Maximum number of operations to batch in a single request. */
27
- batchSizeLimit?: number;
28
- /**
29
- * Maximum total memory (in bytes) for both the AutoBatchQueue and batchIngestCaller queue.
30
- * When exceeded, runs/batches are dropped. Defaults to 1GB.
31
- */
32
- maxIngestMemoryBytes?: number;
33
- blockOnRootRunFinalization?: boolean;
34
- traceBatchConcurrency?: number;
35
- fetchOptions?: RequestInit;
36
- /**
37
- * Whether to require manual .flush() calls before sending traces.
38
- * Useful if encountering network rate limits at trace high volumes.
39
- */
40
- manualFlushMode?: boolean;
41
- tracingSamplingRate?: number;
42
- /**
43
- * Enable debug mode for the client. If set, all sent HTTP requests will be logged.
44
- */
45
- debug?: boolean;
46
- /**
47
- * The workspace ID. Required for org-scoped API keys.
48
- */
49
- workspaceId?: string;
50
- /**
51
- * Custom fetch implementation. Useful for testing.
52
- */
53
- fetchImplementation?: typeof fetch;
54
- /**
55
- * Disable prompt caching for this client.
56
- * By default, prompt caching is enabled globally.
57
- */
58
- disablePromptCache?: boolean;
59
- /**
60
- * @deprecated Use `configureGlobalPromptCache()` to configure caching, or
61
- * `disablePromptCache: true` to disable it. This parameter is deprecated.
62
- *
63
- * Configuration for caching. Can be:
64
- * - `true`: Enable caching with default settings (uses global singleton)
65
- * - `Cache`/`PromptCache` instance: Use custom cache configuration
66
- * - `false`: Disable caching (equivalent to `disablePromptCache: true`)
67
- *
68
- * @example
69
- * ```typescript
70
- * import { Client, Cache, configureGlobalPromptCache } from "langsmith";
71
- *
72
- * // Enable with defaults
73
- * const client1 = new Client({});
74
- *
75
- * // Or use custom configuration
76
- * import { configureGlobalPromptCache } from "langsmith";
77
- * configureGlobalPromptCache({
78
- * maxSize: 100,
79
- * ttlSeconds: 3600, // 1 hour, or null for infinite TTL
80
- * });
81
- * const client2 = new Client({});
82
- *
83
- * // Or disable for a specific client
84
- * const client3 = new Client({ disablePromptCache: true });
85
- * ```
86
- */
87
- cache?: boolean | PromptCache;
88
- }
89
- /**
90
- * Represents the parameters for listing runs (spans) from the Langsmith server.
91
- */
92
- interface ListRunsParams {
93
- /**
94
- * The ID or IDs of the project(s) to filter by.
95
- */
96
- projectId?: string | string[];
97
- /**
98
- * The name or names of the project(s) to filter by.
99
- */
100
- projectName?: string | string[];
101
- /**
102
- * The ID of the trace to filter by.
103
- */
104
- traceId?: string;
105
- /**
106
- * isRoot - Whether to only include root runs.
107
- * */
108
- isRoot?: boolean;
109
- /**
110
- * The execution order to filter by.
111
- */
112
- executionOrder?: number;
113
- /**
114
- * The ID of the parent run to filter by.
115
- */
116
- parentRunId?: string;
117
- /**
118
- * The order by run start date
119
- */
120
- order?: "asc" | "desc";
121
- /**
122
- * The ID of the reference example to filter by.
123
- */
124
- referenceExampleId?: string;
125
- /**
126
- * The start time to filter by.
127
- */
128
- startTime?: Date;
129
- /**
130
- * The run type to filter by.
131
- */
132
- runType?: string;
133
- /**
134
- * Indicates whether to filter by error runs.
135
- */
136
- error?: boolean;
137
- /**
138
- * The ID or IDs of the runs to filter by.
139
- */
140
- id?: string[];
141
- /**
142
- * The maximum number of runs to retrieve.
143
- */
144
- limit?: number;
145
- /**
146
- * The query string to filter by.
147
- */
148
- query?: string;
149
- /**
150
- * The filter string to apply.
151
- *
152
- * Run Filtering:
153
- * Listing runs with query params is useful for simple queries, but doesn't support many common needs, such as filtering by metadata, tags, or other fields.
154
- * LangSmith supports a filter query language to permit more complex filtering operations when fetching runs. This guide will provide a high level overview of the grammar as well as a few examples of when it can be useful.
155
- * If you'd prefer a more visual guide, you can get a taste of the language by viewing the table of runs on any of your projects' pages. We provide some recommended filters to get you started that you can copy and use the SDK.
156
- *
157
- * Grammar:
158
- * The filtering grammar is based on common comparators on fields in the run object. Supported comparators include:
159
- * - gte (greater than or equal to)
160
- * - gt (greater than)
161
- * - lte (less than or equal to)
162
- * - lt (less than)
163
- * - eq (equal to)
164
- * - neq (not equal to)
165
- * - has (check if run contains a tag or metadata json blob)
166
- * - search (search for a substring in a string field)
167
- */
168
- filter?: string;
169
- /**
170
- * Filter to apply to the ROOT run in the trace tree. This is meant to be used in conjunction with the regular
171
- * `filter` parameter to let you filter runs by attributes of the root run within a trace. Example is filtering by
172
- * feedback assigned to the trace.
173
- */
174
- traceFilter?: string;
175
- /**
176
- * Filter to apply to OTHER runs in the trace tree, including sibling and child runs. This is meant to be used in
177
- * conjunction with the regular `filter` parameter to let you filter runs by attributes of any run within a trace.
178
- */
179
- treeFilter?: string;
180
- /**
181
- * The values to include in the response.
182
- *
183
- * Note: The 'child_run_ids' value is deprecated and will be removed in a future version.
184
- * This field is no longer populated by the API.
185
- */
186
- select?: string[];
187
- }
188
- interface GroupRunsParams {
189
- /**
190
- * The ID or IDs of the project(s) to filter by.
191
- */
192
- projectId?: string;
193
- /**
194
- * The ID or IDs of the project(s) to filter by.
195
- */
196
- projectName?: string;
197
- /**
198
- * @example "conversation"
199
- */
200
- groupBy: string;
201
- /**
202
- * The filter string to apply.
203
- *
204
- * Run Filtering:
205
- * Listing runs with query params is useful for simple queries, but doesn't support many common needs, such as filtering by metadata, tags, or other fields.
206
- * LangSmith supports a filter query language to permit more complex filtering operations when fetching runs. This guide will provide a high level overview of the grammar as well as a few examples of when it can be useful.
207
- * If you'd prefer a more visual guide, you can get a taste of the language by viewing the table of runs on any of your projects' pages. We provide some recommended filters to get you started that you can copy and use the SDK.
208
- *
209
- * Grammar:
210
- * The filtering grammar is based on common comparators on fields in the run object. Supported comparators include:
211
- * - gte (greater than or equal to)
212
- * - gt (greater than)
213
- * - lte (less than or equal to)
214
- * - lt (less than)
215
- * - eq (equal to)
216
- * - neq (not equal to)
217
- * - has (check if run contains a tag or metadata json blob)
218
- * - search (search for a substring in a string field)
219
- */
220
- filter?: string;
221
- /**
222
- * The start time to filter by.
223
- */
224
- startTime?: Date;
225
- /**
226
- * The end time to filter by.
227
- */
228
- endTime?: Date;
229
- /**
230
- * The maximum number of runs to retrieve.
231
- */
232
- limit?: number;
233
- /**
234
- * The maximum number of runs to retrieve.
235
- */
236
- offset?: number;
237
- }
238
- interface ReadThreadParams {
239
- threadId: string;
240
- projectId?: string;
241
- projectName?: string;
242
- isRoot?: boolean;
243
- limit?: number;
244
- filter?: string;
245
- order?: "asc" | "desc";
246
- }
247
- interface ListThreadsParams {
248
- projectId?: string;
249
- projectName?: string;
250
- limit?: number;
251
- offset?: number;
252
- filter?: string;
253
- startTime?: Date;
254
- isRoot?: boolean;
255
- }
256
- interface UploadCSVParams {
257
- csvFile: Blob;
258
- fileName: string;
259
- inputKeys: string[];
260
- outputKeys: string[];
261
- description?: string;
262
- dataType?: DataType;
263
- name?: string;
264
- }
265
- interface CreateRunParams {
266
- name: string;
267
- inputs: KVMap;
268
- run_type: string;
269
- id?: string;
270
- start_time?: number | string;
271
- end_time?: number | string;
272
- extra?: KVMap;
273
- error?: string;
274
- serialized?: object;
275
- outputs?: KVMap;
276
- reference_example_id?: string;
277
- child_runs?: RunCreate[];
278
- parent_run_id?: string;
279
- project_name?: string;
280
- revision_id?: string;
281
- trace_id?: string;
282
- dotted_order?: string;
283
- attachments?: Attachments;
284
- }
285
- interface ProjectOptions {
286
- projectName?: string;
287
- projectId?: string;
288
- }
289
- type RecordStringAny = Record<string, any>;
290
- type FeedbackSourceType = "model" | "api" | "app";
291
- type CreateExampleOptions = {
292
- /** The ID of the dataset to create the example in. */datasetId?: string; /** The name of the dataset to create the example in (if dataset ID is not provided). */
293
- datasetName?: string; /** The creation date of the example. */
294
- createdAt?: Date; /** A unique identifier for the example. */
295
- exampleId?: string; /** Additional metadata associated with the example. */
296
- metadata?: KVMap; /** The split(s) to assign the example to. */
297
- split?: string | string[]; /** The ID of the source run associated with this example. */
298
- sourceRunId?: string; /** Whether to use the inputs and outputs from the source run. */
299
- useSourceRunIO?: boolean; /** Which attachments from the source run to use. */
300
- useSourceRunAttachments?: string[]; /** Attachments for the example */
301
- attachments?: Attachments;
302
- };
303
- type CreateProjectParams = {
304
- projectName: string;
305
- description?: string | null;
306
- metadata?: RecordStringAny | null;
307
- upsert?: boolean;
308
- projectExtra?: RecordStringAny | null;
309
- referenceDatasetId?: string | null;
310
- };
311
- type Thread = {
312
- filter: string;
313
- count: number;
314
- total_tokens: number;
315
- total_cost: number | null;
316
- min_start_time: string;
317
- max_start_time: string;
318
- latency_p50: number;
319
- latency_p99: number;
320
- feedback_stats: any | null;
321
- thread_id: string;
322
- first_inputs: string;
323
- last_outputs: string;
324
- last_error: string | null;
325
- };
326
- /** Item returned by {@link Client.listThreads}. */
327
- interface ListThreadsItem extends Thread {
328
- runs: Run[];
329
- }
330
- declare class Client implements LangSmithTracingClientInterface {
331
- private apiKey?;
332
- private apiUrl;
333
- private webUrl?;
334
- private workspaceId?;
335
- private caller;
336
- private batchIngestCaller;
337
- private timeout_ms;
338
- private _tenantId;
339
- private hideInputs?;
340
- private hideOutputs?;
341
- private omitTracedRuntimeInfo?;
342
- private tracingSampleRate?;
343
- private filteredPostUuids;
344
- private autoBatchTracing;
345
- private autoBatchQueue;
346
- private autoBatchTimeout;
347
- private autoBatchAggregationDelayMs;
348
- private batchSizeBytesLimit?;
349
- private batchSizeLimit?;
350
- private fetchOptions;
351
- private settings;
352
- private blockOnRootRunFinalization;
353
- private traceBatchConcurrency;
354
- private _serverInfo;
355
- private _getServerInfoPromise?;
356
- private manualFlushMode;
357
- private langSmithToOTELTranslator?;
358
- private fetchImplementation?;
359
- private cachedLSEnvVarsForMetadata?;
360
- private _promptCache?;
361
- private get _fetch();
362
- private multipartStreamingDisabled;
363
- private _multipartDisabled;
364
- private _runCompressionDisabled;
365
- private failedTracesDir;
366
- private failedTracesMaxBytes;
367
- private static _fallbackDirsCreated;
368
- debug: boolean;
369
- constructor(config?: ClientConfig);
370
- static getDefaultClientConfig(): {
371
- apiUrl: string;
372
- apiKey?: string;
373
- webUrl?: string;
374
- hideInputs?: boolean;
375
- hideOutputs?: boolean;
376
- };
377
- getHostUrl(): string;
378
- private get headers();
379
- private _getPlatformEndpointPath;
380
- private processInputs;
381
- private processOutputs;
382
- private prepareRunCreateOrUpdateInputs;
383
- private _getResponse;
384
- private _get;
385
- private _getPaginated;
386
- private _getCursorPaginatedList;
387
- private _shouldSample;
388
- private _filterForSampling;
389
- private _getBatchSizeLimitBytes;
390
- /**
391
- * Get the maximum number of operations to batch in a single request.
392
- */
393
- private _getBatchSizeLimit;
394
- private _getDatasetExamplesMultiPartSupport;
395
- private drainAutoBatchQueue;
396
- /**
397
- * Persist a failed trace payload to a local fallback directory.
398
- *
399
- * Saves a self-contained JSON file containing the endpoint path, the HTTP
400
- * headers required for replay, and the base64-encoded request body.
401
- * Can be replayed later with a simple POST:
402
- *
403
- * POST /<endpoint>
404
- * Content-Type: <value from saved headers>
405
- * [Content-Encoding: <value from saved headers>]
406
- * <decoded body>
407
- */
408
- private static _writeTraceToFallbackDir;
409
- private _processBatch;
410
- private _sendBatchToOTELTranslator;
411
- private processRunOperation;
412
- protected _getServerInfo(): Promise<any>;
413
- protected _ensureServerInfo(): Promise<Record<string, any>>;
414
- protected _getSettings(): Promise<LangSmithSettings>;
415
- /**
416
- * Flushes current queued traces.
417
- */
418
- flush(): Promise<void>;
419
- private _cloneCurrentOTELContext;
420
- createRun(run: CreateRunParams, options?: {
421
- apiKey?: string;
422
- apiUrl?: string;
423
- workspaceId?: string;
424
- }): Promise<void>;
425
- /**
426
- * Batch ingest/upsert multiple runs in the Langsmith system.
427
- * @param runs
428
- */
429
- batchIngestRuns({
430
- runCreates,
431
- runUpdates
432
- }: {
433
- runCreates?: RunCreate[];
434
- runUpdates?: RunUpdate[];
435
- }, options?: {
436
- apiKey?: string;
437
- apiUrl?: string;
438
- sizeBytes?: number;
439
- }): Promise<void>;
440
- private _postBatchIngestRuns;
441
- /**
442
- * Batch ingest/upsert multiple runs in the Langsmith system.
443
- * @param runs
444
- */
445
- multipartIngestRuns({
446
- runCreates,
447
- runUpdates
448
- }: {
449
- runCreates?: RunCreate[];
450
- runUpdates?: RunUpdate[];
451
- }, options?: {
452
- apiKey?: string;
453
- apiUrl?: string;
454
- useGzip?: boolean;
455
- sizeBytes?: number;
456
- }): Promise<void>;
457
- private _createNodeFetchBody;
458
- private _createMultipartStream;
459
- private _sendMultipartRequest;
460
- updateRun(runId: string, run: RunUpdate, options?: {
461
- apiKey?: string;
462
- apiUrl?: string;
463
- workspaceId?: string;
464
- }): Promise<void>;
465
- readRun(runId: string, {
466
- loadChildRuns
467
- }?: {
468
- loadChildRuns: boolean;
469
- }): Promise<Run>;
470
- getRunUrl({
471
- runId,
472
- run,
473
- projectOpts
474
- }: {
475
- runId?: string;
476
- run?: Run;
477
- projectOpts?: ProjectOptions;
478
- }): Promise<string>;
479
- private _loadChildRuns;
480
- /**
481
- * List runs from the LangSmith server.
482
- * @param projectId - The ID of the project to filter by.
483
- * @param projectName - The name of the project to filter by.
484
- * @param parentRunId - The ID of the parent run to filter by.
485
- * @param traceId - The ID of the trace to filter by.
486
- * @param referenceExampleId - The ID of the reference example to filter by.
487
- * @param startTime - The start time to filter by.
488
- * @param isRoot - Indicates whether to only return root runs.
489
- * @param runType - The run type to filter by.
490
- * @param error - Indicates whether to filter by error runs.
491
- * @param id - The ID of the run to filter by.
492
- * @param query - The query string to filter by.
493
- * @param filter - The filter string to apply to the run spans.
494
- * @param traceFilter - The filter string to apply on the root run of the trace.
495
- * @param treeFilter - The filter string to apply on other runs in the trace.
496
- * @param limit - The maximum number of runs to retrieve.
497
- * @returns {AsyncIterable<Run>} - The runs.
498
- *
499
- * @example
500
- * // List all runs in a project
501
- * const projectRuns = client.listRuns({ projectName: "<your_project>" });
502
- *
503
- * @example
504
- * // List LLM and Chat runs in the last 24 hours
505
- * const todaysLLMRuns = client.listRuns({
506
- * projectName: "<your_project>",
507
- * start_time: new Date(Date.now() - 24 * 60 * 60 * 1000),
508
- * run_type: "llm",
509
- * });
510
- *
511
- * @example
512
- * // List traces in a project
513
- * const rootRuns = client.listRuns({
514
- * projectName: "<your_project>",
515
- * execution_order: 1,
516
- * });
517
- *
518
- * @example
519
- * // List runs without errors
520
- * const correctRuns = client.listRuns({
521
- * projectName: "<your_project>",
522
- * error: false,
523
- * });
524
- *
525
- * @example
526
- * // List runs by run ID
527
- * const runIds = [
528
- * "a36092d2-4ad5-4fb4-9c0d-0dba9a2ed836",
529
- * "9398e6be-964f-4aa4-8ae9-ad78cd4b7074",
530
- * ];
531
- * const selectedRuns = client.listRuns({ run_ids: runIds });
532
- *
533
- * @example
534
- * // List all "chain" type runs that took more than 10 seconds and had `total_tokens` greater than 5000
535
- * const chainRuns = client.listRuns({
536
- * projectName: "<your_project>",
537
- * filter: 'and(eq(run_type, "chain"), gt(latency, 10), gt(total_tokens, 5000))',
538
- * });
539
- *
540
- * @example
541
- * // List all runs called "extractor" whose root of the trace was assigned feedback "user_score" score of 1
542
- * const goodExtractorRuns = client.listRuns({
543
- * projectName: "<your_project>",
544
- * filter: 'eq(name, "extractor")',
545
- * traceFilter: 'and(eq(feedback_key, "user_score"), eq(feedback_score, 1))',
546
- * });
547
- *
548
- * @example
549
- * // List all runs that started after a specific timestamp and either have "error" not equal to null or a "Correctness" feedback score equal to 0
550
- * const complexRuns = client.listRuns({
551
- * projectName: "<your_project>",
552
- * filter: 'and(gt(start_time, "2023-07-15T12:34:56Z"), or(neq(error, null), and(eq(feedback_key, "Correctness"), eq(feedback_score, 0.0))))',
553
- * });
554
- *
555
- * @example
556
- * // List all runs where `tags` include "experimental" or "beta" and `latency` is greater than 2 seconds
557
- * const taggedRuns = client.listRuns({
558
- * projectName: "<your_project>",
559
- * filter: 'and(or(has(tags, "experimental"), has(tags, "beta")), gt(latency, 2))',
560
- * });
561
- */
562
- listRuns(props: ListRunsParams): AsyncIterable<Run>;
563
- listGroupRuns(props: GroupRunsParams): AsyncIterable<Thread>;
564
- readThread(props: ReadThreadParams): AsyncIterable<Run>;
565
- listThreads(props: ListThreadsParams): Promise<ListThreadsItem[]>;
566
- getRunStats({
567
- id,
568
- trace,
569
- parentRun,
570
- runType,
571
- projectNames,
572
- projectIds,
573
- referenceExampleIds,
574
- startTime,
575
- endTime,
576
- error,
577
- query,
578
- filter,
579
- traceFilter,
580
- treeFilter,
581
- isRoot,
582
- dataSourceType
583
- }: {
584
- id?: string[];
585
- trace?: string;
586
- parentRun?: string;
587
- runType?: string;
588
- projectNames?: string[];
589
- projectIds?: string[];
590
- referenceExampleIds?: string[];
591
- startTime?: string;
592
- endTime?: string;
593
- error?: boolean;
594
- query?: string;
595
- filter?: string;
596
- traceFilter?: string;
597
- treeFilter?: string;
598
- isRoot?: boolean;
599
- dataSourceType?: string;
600
- }): Promise<any>;
601
- shareRun(runId: string, {
602
- shareId
603
- }?: {
604
- shareId?: string;
605
- }): Promise<string>;
606
- unshareRun(runId: string): Promise<void>;
607
- readRunSharedLink(runId: string): Promise<string | undefined>;
608
- listSharedRuns(shareToken: string, {
609
- runIds
610
- }?: {
611
- runIds?: string[];
612
- }): Promise<Run[]>;
613
- readDatasetSharedSchema(datasetId?: string, datasetName?: string): Promise<DatasetShareSchema>;
614
- shareDataset(datasetId?: string, datasetName?: string): Promise<DatasetShareSchema>;
615
- unshareDataset(datasetId: string): Promise<void>;
616
- readSharedDataset(shareToken: string): Promise<Dataset>;
617
- /**
618
- * Get shared examples.
619
- *
620
- * @param {string} shareToken The share token to get examples for. A share token is the UUID (or LangSmith URL, including UUID) generated when explicitly marking an example as public.
621
- * @param {Object} [options] Additional options for listing the examples.
622
- * @param {string[] | undefined} [options.exampleIds] A list of example IDs to filter by.
623
- * @returns {Promise<Example[]>} The shared examples.
624
- */
625
- listSharedExamples(shareToken: string, options?: {
626
- exampleIds?: string[];
627
- }): Promise<Example[]>;
628
- createProject({
629
- projectName,
630
- description,
631
- metadata,
632
- upsert,
633
- projectExtra,
634
- referenceDatasetId
635
- }: CreateProjectParams): Promise<TracerSession>;
636
- updateProject(projectId: string, {
637
- name,
638
- description,
639
- metadata,
640
- projectExtra,
641
- endTime
642
- }: {
643
- name?: string | null;
644
- description?: string | null;
645
- metadata?: RecordStringAny | null;
646
- projectExtra?: RecordStringAny | null;
647
- endTime?: string | null;
648
- }): Promise<TracerSession>;
649
- hasProject({
650
- projectId,
651
- projectName
652
- }: {
653
- projectId?: string;
654
- projectName?: string;
655
- }): Promise<boolean>;
656
- readProject({
657
- projectId,
658
- projectName,
659
- includeStats
660
- }: {
661
- projectId?: string;
662
- projectName?: string;
663
- includeStats?: boolean;
664
- }): Promise<TracerSessionResult>;
665
- getProjectUrl({
666
- projectId,
667
- projectName
668
- }: {
669
- projectId?: string;
670
- projectName?: string;
671
- }): Promise<string>;
672
- getDatasetUrl({
673
- datasetId,
674
- datasetName
675
- }: {
676
- datasetId?: string;
677
- datasetName?: string;
678
- }): Promise<string>;
679
- private _getTenantId;
680
- listProjects({
681
- projectIds,
682
- name,
683
- nameContains,
684
- referenceDatasetId,
685
- referenceDatasetName,
686
- includeStats,
687
- datasetVersion,
688
- referenceFree,
689
- metadata
690
- }?: {
691
- projectIds?: string[];
692
- name?: string;
693
- nameContains?: string;
694
- referenceDatasetId?: string;
695
- referenceDatasetName?: string;
696
- includeStats?: boolean;
697
- datasetVersion?: string;
698
- referenceFree?: boolean;
699
- metadata?: RecordStringAny;
700
- }): AsyncIterable<TracerSessionResult>;
701
- deleteProject({
702
- projectId,
703
- projectName
704
- }: {
705
- projectId?: string;
706
- projectName?: string;
707
- }): Promise<void>;
708
- uploadCsv({
709
- csvFile,
710
- fileName,
711
- inputKeys,
712
- outputKeys,
713
- description,
714
- dataType,
715
- name
716
- }: UploadCSVParams): Promise<Dataset>;
717
- createDataset(name: string, {
718
- description,
719
- dataType,
720
- inputsSchema,
721
- outputsSchema,
722
- metadata
723
- }?: {
724
- description?: string;
725
- dataType?: DataType;
726
- inputsSchema?: KVMap;
727
- outputsSchema?: KVMap;
728
- metadata?: RecordStringAny;
729
- }): Promise<Dataset>;
730
- readDataset({
731
- datasetId,
732
- datasetName
733
- }: {
734
- datasetId?: string;
735
- datasetName?: string;
736
- }): Promise<Dataset>;
737
- hasDataset({
738
- datasetId,
739
- datasetName
740
- }: {
741
- datasetId?: string;
742
- datasetName?: string;
743
- }): Promise<boolean>;
744
- diffDatasetVersions({
745
- datasetId,
746
- datasetName,
747
- fromVersion,
748
- toVersion
749
- }: {
750
- datasetId?: string;
751
- datasetName?: string;
752
- fromVersion: string | Date;
753
- toVersion: string | Date;
754
- }): Promise<DatasetDiffInfo>;
755
- readDatasetOpenaiFinetuning({
756
- datasetId,
757
- datasetName
758
- }: {
759
- datasetId?: string;
760
- datasetName?: string;
761
- }): Promise<any[]>;
762
- listDatasets({
763
- limit,
764
- offset,
765
- datasetIds,
766
- datasetName,
767
- datasetNameContains,
768
- metadata
769
- }?: {
770
- limit?: number;
771
- offset?: number;
772
- datasetIds?: string[];
773
- datasetName?: string;
774
- datasetNameContains?: string;
775
- metadata?: RecordStringAny;
776
- }): AsyncIterable<Dataset>;
777
- /**
778
- * Update a dataset
779
- * @param props The dataset details to update
780
- * @returns The updated dataset
781
- */
782
- updateDataset(props: {
783
- datasetId?: string;
784
- datasetName?: string;
785
- name?: string;
786
- description?: string;
787
- }): Promise<Dataset>;
788
- /**
789
- * Updates a tag on a dataset.
790
- *
791
- * If the tag is already assigned to a different version of this dataset,
792
- * the tag will be moved to the new version. The as_of parameter is used to
793
- * determine which version of the dataset to apply the new tags to.
794
- *
795
- * It must be an exact version of the dataset to succeed. You can
796
- * use the "readDatasetVersion" method to find the exact version
797
- * to apply the tags to.
798
- * @param params.datasetId The ID of the dataset to update. Must be provided if "datasetName" is not provided.
799
- * @param params.datasetName The name of the dataset to update. Must be provided if "datasetId" is not provided.
800
- * @param params.asOf The timestamp of the dataset to apply the new tags to.
801
- * @param params.tag The new tag to apply to the dataset.
802
- */
803
- updateDatasetTag(props: {
804
- datasetId?: string;
805
- datasetName?: string;
806
- asOf: string | Date;
807
- tag: string;
808
- }): Promise<void>;
809
- deleteDataset({
810
- datasetId,
811
- datasetName
812
- }: {
813
- datasetId?: string;
814
- datasetName?: string;
815
- }): Promise<void>;
816
- indexDataset({
817
- datasetId,
818
- datasetName,
819
- tag
820
- }: {
821
- datasetId?: string;
822
- datasetName?: string;
823
- tag?: string;
824
- }): Promise<void>;
825
- /**
826
- * Lets you run a similarity search query on a dataset.
827
- *
828
- * Requires the dataset to be indexed. Please see the `indexDataset` method to set up indexing.
829
- *
830
- * @param inputs The input on which to run the similarity search. Must have the
831
- * same schema as the dataset.
832
- *
833
- * @param datasetId The dataset to search for similar examples.
834
- *
835
- * @param limit The maximum number of examples to return. Will return the top `limit` most
836
- * similar examples in order of most similar to least similar. If no similar
837
- * examples are found, random examples will be returned.
838
- *
839
- * @param filter A filter string to apply to the search. Only examples will be returned that
840
- * match the filter string. Some examples of filters
841
- *
842
- * - eq(metadata.mykey, "value")
843
- * - and(neq(metadata.my.nested.key, "value"), neq(metadata.mykey, "value"))
844
- * - or(eq(metadata.mykey, "value"), eq(metadata.mykey, "othervalue"))
845
- *
846
- * @returns A list of similar examples.
847
- *
848
- *
849
- * @example
850
- * dataset_id = "123e4567-e89b-12d3-a456-426614174000"
851
- * inputs = {"text": "How many people live in Berlin?"}
852
- * limit = 5
853
- * examples = await client.similarExamples(inputs, dataset_id, limit)
854
- */
855
- similarExamples(inputs: KVMap, datasetId: string, limit: number, {
856
- filter
857
- }?: {
858
- filter?: string;
859
- }): Promise<ExampleSearch[]>;
860
- createExample(update: ExampleCreate): Promise<Example>;
861
- /**
862
- * @deprecated This signature is deprecated, use createExample(update: ExampleCreate) instead
863
- */
864
- createExample(inputs: KVMap, outputs: KVMap, options: CreateExampleOptions): Promise<Example>;
865
- createExamples(uploads: ExampleCreate[]): Promise<Example[]>;
866
- /** @deprecated Use the uploads-only overload instead */
867
- createExamples(props: {
868
- inputs?: Array<KVMap>;
869
- outputs?: Array<KVMap>;
870
- metadata?: Array<KVMap>;
871
- splits?: Array<string | Array<string>>;
872
- sourceRunIds?: Array<string>;
873
- useSourceRunIOs?: Array<boolean>;
874
- useSourceRunAttachments?: Array<string[]>;
875
- attachments?: Array<Attachments>;
876
- exampleIds?: Array<string>;
877
- datasetId?: string;
878
- datasetName?: string;
879
- }): Promise<Example[]>;
880
- createLLMExample(input: string, generation: string | undefined, options: CreateExampleOptions): Promise<Example>;
881
- createChatExample(input: KVMap[] | LangChainBaseMessage[], generations: KVMap | LangChainBaseMessage | undefined, options: CreateExampleOptions): Promise<Example>;
882
- readExample(exampleId: string): Promise<Example>;
883
- listExamples({
884
- datasetId,
885
- datasetName,
886
- exampleIds,
887
- asOf,
888
- splits,
889
- inlineS3Urls,
890
- metadata,
891
- limit,
892
- offset,
893
- filter,
894
- includeAttachments
895
- }?: {
896
- datasetId?: string;
897
- datasetName?: string;
898
- exampleIds?: string[];
899
- asOf?: string | Date;
900
- splits?: string[];
901
- inlineS3Urls?: boolean;
902
- metadata?: KVMap;
903
- limit?: number;
904
- offset?: number;
905
- filter?: string;
906
- includeAttachments?: boolean;
907
- }): AsyncIterable<Example>;
908
- deleteExample(exampleId: string): Promise<void>;
909
- /**
910
- * Delete multiple examples by ID.
911
- * @param exampleIds - The IDs of the examples to delete
912
- * @param options - Optional settings for deletion
913
- * @param options.hardDelete - If true, permanently delete examples. If false (default), soft delete them.
914
- */
915
- deleteExamples(exampleIds: string[], options?: {
916
- hardDelete?: boolean;
917
- }): Promise<void>;
918
- /**
919
- * @deprecated This signature is deprecated, use updateExample(update: ExampleUpdate) instead
920
- */
921
- updateExample(exampleId: string, update: ExampleUpdateWithoutId): Promise<object>;
922
- updateExample(update: ExampleUpdate): Promise<object>;
923
- updateExamples(update: ExampleUpdate[]): Promise<object>;
924
- /**
925
- * Get dataset version by closest date or exact tag.
926
- *
927
- * Use this to resolve the nearest version to a given timestamp or for a given tag.
928
- *
929
- * @param options The options for getting the dataset version
930
- * @param options.datasetId The ID of the dataset
931
- * @param options.datasetName The name of the dataset
932
- * @param options.asOf The timestamp of the dataset to retrieve
933
- * @param options.tag The tag of the dataset to retrieve
934
- * @returns The dataset version
935
- */
936
- readDatasetVersion({
937
- datasetId,
938
- datasetName,
939
- asOf,
940
- tag
941
- }: {
942
- datasetId?: string;
943
- datasetName?: string;
944
- asOf?: string | Date;
945
- tag?: string;
946
- }): Promise<DatasetVersion>;
947
- listDatasetSplits({
948
- datasetId,
949
- datasetName,
950
- asOf
951
- }: {
952
- datasetId?: string;
953
- datasetName?: string;
954
- asOf?: string | Date;
955
- }): Promise<string[]>;
956
- updateDatasetSplits({
957
- datasetId,
958
- datasetName,
959
- splitName,
960
- exampleIds,
961
- remove
962
- }: {
963
- datasetId?: string;
964
- datasetName?: string;
965
- splitName: string;
966
- exampleIds: string[];
967
- remove?: boolean;
968
- }): Promise<void>;
969
- createFeedback(runId: string | null, key: string, {
970
- score,
971
- value,
972
- correction,
973
- comment,
974
- sourceInfo,
975
- feedbackSourceType,
976
- sourceRunId,
977
- feedbackId,
978
- feedbackConfig,
979
- projectId,
980
- comparativeExperimentId,
981
- sessionId,
982
- startTime
983
- }: {
984
- score?: ScoreType;
985
- value?: ValueType;
986
- correction?: object;
987
- comment?: string;
988
- sourceInfo?: object;
989
- feedbackSourceType?: FeedbackSourceType;
990
- feedbackConfig?: FeedbackConfig;
991
- sourceRunId?: string;
992
- feedbackId?: string;
993
- eager?: boolean;
994
- projectId?: string;
995
- comparativeExperimentId?: string; /** The session (project) ID of the run this feedback is for. */
996
- sessionId?: string; /** The start time of the run this feedback is for. Accepts ISO string or epoch ms. */
997
- startTime?: number | string;
998
- }): Promise<Feedback>;
999
- updateFeedback(feedbackId: string, {
1000
- score,
1001
- value,
1002
- correction,
1003
- comment
1004
- }: {
1005
- score?: number | boolean | null;
1006
- value?: number | boolean | string | object | null;
1007
- correction?: object | null;
1008
- comment?: string | null;
1009
- }): Promise<void>;
1010
- readFeedback(feedbackId: string): Promise<Feedback>;
1011
- deleteFeedback(feedbackId: string): Promise<void>;
1012
- listFeedback({
1013
- runIds,
1014
- feedbackKeys,
1015
- feedbackSourceTypes
1016
- }?: {
1017
- runIds?: string[];
1018
- feedbackKeys?: string[];
1019
- feedbackSourceTypes?: FeedbackSourceType[];
1020
- }): AsyncIterable<Feedback>;
1021
- /**
1022
- * Creates a presigned feedback token and URL.
1023
- *
1024
- * The token can be used to authorize feedback metrics without
1025
- * needing an API key. This is useful for giving browser-based
1026
- * applications the ability to submit feedback without needing
1027
- * to expose an API key.
1028
- *
1029
- * @param runId The ID of the run.
1030
- * @param feedbackKey The feedback key.
1031
- * @param options Additional options for the token.
1032
- * @param options.expiration The expiration time for the token.
1033
- *
1034
- * @returns A promise that resolves to a FeedbackIngestToken.
1035
- */
1036
- createPresignedFeedbackToken(runId: string, feedbackKey: string, {
1037
- expiration,
1038
- feedbackConfig
1039
- }?: {
1040
- expiration?: string | TimeDelta;
1041
- feedbackConfig?: FeedbackConfig;
1042
- }): Promise<FeedbackIngestToken>;
1043
- createComparativeExperiment({
1044
- name,
1045
- experimentIds,
1046
- referenceDatasetId,
1047
- createdAt,
1048
- description,
1049
- metadata,
1050
- id
1051
- }: {
1052
- name: string;
1053
- experimentIds: Array<string>;
1054
- referenceDatasetId?: string;
1055
- createdAt?: Date;
1056
- description?: string;
1057
- metadata?: Record<string, unknown>;
1058
- id?: string;
1059
- }): Promise<ComparativeExperiment>;
1060
- /**
1061
- * Retrieves a list of presigned feedback tokens for a given run ID.
1062
- * @param runId The ID of the run.
1063
- * @returns An async iterable of FeedbackIngestToken objects.
1064
- */
1065
- listPresignedFeedbackTokens(runId: string): AsyncIterable<FeedbackIngestToken>;
1066
- _selectEvalResults(results: EvaluationResult | EvaluationResult[] | EvaluationResults): Array<EvaluationResult>;
1067
- _logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResult[] | EvaluationResults, run?: Run, sourceInfo?: {
1068
- [key: string]: any;
1069
- }): Promise<[results: EvaluationResult[], feedbacks: Feedback[]]>;
1070
- logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResult[] | EvaluationResults, run?: Run, sourceInfo?: {
1071
- [key: string]: any;
1072
- }): Promise<EvaluationResult[]>;
1073
- /**
1074
- * API for managing feedback configs
1075
- */
1076
- /**
1077
- * Create a feedback configuration on the LangSmith API.
1078
- *
1079
- * This upserts: if an identical config already exists, it returns it.
1080
- * If a conflicting config exists for the same key, a 400 error is raised.
1081
- *
1082
- * @param options - The options for creating a feedback config
1083
- * @param options.feedbackKey - The unique key for this feedback config
1084
- * @param options.feedbackConfig - The config specifying type, bounds, and categories
1085
- * @param options.isLowerScoreBetter - Whether a lower score is better
1086
- * @returns The created FeedbackConfigSchema object
1087
- */
1088
- createFeedbackConfig(options: {
1089
- feedbackKey: string;
1090
- feedbackConfig: FeedbackConfig;
1091
- isLowerScoreBetter?: boolean;
1092
- }): Promise<FeedbackConfigSchema>;
1093
- /**
1094
- * List feedback configurations on the LangSmith API.
1095
- * @param options - The options for listing feedback configs
1096
- * @param options.feedbackKeys - Filter by specific feedback keys
1097
- * @param options.nameContains - Filter by name substring
1098
- * @param options.limit - The maximum number of configs to return
1099
- * @returns An async iterator of FeedbackConfigSchema objects
1100
- */
1101
- listFeedbackConfigs(options?: {
1102
- feedbackKeys?: string[];
1103
- nameContains?: string;
1104
- limit?: number;
1105
- }): AsyncIterableIterator<FeedbackConfigSchema>;
1106
- /**
1107
- * Update a feedback configuration on the LangSmith API.
1108
- * @param feedbackKey - The key of the feedback config to update
1109
- * @param options - The options for updating the feedback config
1110
- * @param options.feedbackConfig - The new feedback config
1111
- * @param options.isLowerScoreBetter - Whether a lower score is better
1112
- * @returns The updated FeedbackConfigSchema object
1113
- */
1114
- updateFeedbackConfig(feedbackKey: string, options?: {
1115
- feedbackConfig?: FeedbackConfig;
1116
- isLowerScoreBetter?: boolean;
1117
- }): Promise<FeedbackConfigSchema>;
1118
- /**
1119
- * Delete a feedback configuration on the LangSmith API.
1120
- * @param feedbackKey - The key of the feedback config to delete
1121
- */
1122
- deleteFeedbackConfig(feedbackKey: string): Promise<void>;
1123
- /**
1124
- * API for managing annotation queues
1125
- */
1126
- /**
1127
- * List the annotation queues on the LangSmith API.
1128
- * @param options - The options for listing annotation queues
1129
- * @param options.queueIds - The IDs of the queues to filter by
1130
- * @param options.name - The name of the queue to filter by
1131
- * @param options.nameContains - The substring that the queue name should contain
1132
- * @param options.limit - The maximum number of queues to return
1133
- * @returns An iterator of AnnotationQueue objects
1134
- */
1135
- listAnnotationQueues(options?: {
1136
- queueIds?: string[];
1137
- name?: string;
1138
- nameContains?: string;
1139
- limit?: number;
1140
- }): AsyncIterableIterator<AnnotationQueue>;
1141
- /**
1142
- * Create an annotation queue on the LangSmith API.
1143
- * @param options - The options for creating an annotation queue
1144
- * @param options.name - The name of the annotation queue
1145
- * @param options.description - The description of the annotation queue
1146
- * @param options.queueId - The ID of the annotation queue
1147
- * @returns The created AnnotationQueue object
1148
- */
1149
- createAnnotationQueue(options: {
1150
- name: string;
1151
- description?: string;
1152
- queueId?: string;
1153
- rubricInstructions?: string;
1154
- rubricItems?: AnnotationQueueRubricItem[];
1155
- }): Promise<AnnotationQueueWithDetails>;
1156
- /**
1157
- * Read an annotation queue with the specified queue ID.
1158
- * @param queueId - The ID of the annotation queue to read
1159
- * @returns The AnnotationQueueWithDetails object
1160
- */
1161
- readAnnotationQueue(queueId: string): Promise<AnnotationQueueWithDetails>;
1162
- /**
1163
- * Update an annotation queue with the specified queue ID.
1164
- * @param queueId - The ID of the annotation queue to update
1165
- * @param options - The options for updating the annotation queue
1166
- * @param options.name - The new name for the annotation queue
1167
- * @param options.description - The new description for the annotation queue
1168
- */
1169
- updateAnnotationQueue(queueId: string, options: {
1170
- name?: string;
1171
- description?: string;
1172
- rubricInstructions?: string;
1173
- rubricItems?: AnnotationQueueRubricItem[];
1174
- }): Promise<void>;
1175
- /**
1176
- * Delete an annotation queue with the specified queue ID.
1177
- * @param queueId - The ID of the annotation queue to delete
1178
- */
1179
- deleteAnnotationQueue(queueId: string): Promise<void>;
1180
- /**
1181
- * Add runs to an annotation queue with the specified queue ID.
1182
- * @param queueId - The ID of the annotation queue
1183
- * @param runIds - The IDs of the runs to be added to the annotation queue
1184
- */
1185
- addRunsToAnnotationQueue(queueId: string, runIds: string[]): Promise<void>;
1186
- /**
1187
- * Get a run from an annotation queue at the specified index.
1188
- * @param queueId - The ID of the annotation queue
1189
- * @param index - The index of the run to retrieve
1190
- * @returns A Promise that resolves to a RunWithAnnotationQueueInfo object
1191
- * @throws {Error} If the run is not found at the given index or for other API-related errors
1192
- */
1193
- getRunFromAnnotationQueue(queueId: string, index: number): Promise<RunWithAnnotationQueueInfo>;
1194
- /**
1195
- * Delete a run from an an annotation queue.
1196
- * @param queueId - The ID of the annotation queue to delete the run from
1197
- * @param queueRunId - The ID of the run to delete from the annotation queue
1198
- */
1199
- deleteRunFromAnnotationQueue(queueId: string, queueRunId: string): Promise<void>;
1200
- /**
1201
- * Get the size of an annotation queue.
1202
- * @param queueId - The ID of the annotation queue
1203
- */
1204
- getSizeFromAnnotationQueue(queueId: string): Promise<{
1205
- size: number;
1206
- }>;
1207
- protected _currentTenantIsOwner(owner: string): Promise<boolean>;
1208
- protected _ownerConflictError(action: string, owner: string): Promise<Error>;
1209
- protected _getLatestCommitHash(promptOwnerAndName: string): Promise<string | undefined>;
1210
- protected _likeOrUnlikePrompt(promptIdentifier: string, like: boolean): Promise<LikePromptResponse>;
1211
- protected _getPromptUrl(promptIdentifier: string): Promise<string>;
1212
- /**
1213
- * Check if a prompt exists.
1214
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1215
- * - "promptName" (for private prompts, owner defaults to "-")
1216
- * - "owner/promptName" (for prompts with explicit owner)
1217
- * @returns A Promise that resolves to true if the prompt exists, false otherwise
1218
- * @example
1219
- * ```typescript
1220
- * // Check if a prompt exists before creating a commit
1221
- * if (await client.promptExists("my-prompt")) {
1222
- * await client.createCommit("my-prompt", template);
1223
- * } else {
1224
- * await client.createPrompt("my-prompt");
1225
- * }
1226
- * ```
1227
- */
1228
- promptExists(promptIdentifier: string): Promise<boolean>;
1229
- /**
1230
- * Like a prompt.
1231
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1232
- * - "promptName" (for private prompts, owner defaults to "-")
1233
- * - "owner/promptName" (for prompts with explicit owner)
1234
- * @returns A Promise that resolves to the like response containing the updated like count
1235
- * @example
1236
- * ```typescript
1237
- * // Like a prompt
1238
- * const response = await client.likePrompt("owner/useful-prompt");
1239
- * console.log(`Prompt now has ${response.likes} likes`);
1240
- * ```
1241
- */
1242
- likePrompt(promptIdentifier: string): Promise<LikePromptResponse>;
1243
- /**
1244
- * Unlike a prompt (remove a previously added like).
1245
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1246
- * - "promptName" (for private prompts, owner defaults to "-")
1247
- * - "owner/promptName" (for prompts with explicit owner)
1248
- * @returns A Promise that resolves to the like response containing the updated like count
1249
- * @example
1250
- * ```typescript
1251
- * // Unlike a prompt
1252
- * const response = await client.unlikePrompt("owner/useful-prompt");
1253
- * console.log(`Prompt now has ${response.likes} likes`);
1254
- * ```
1255
- */
1256
- unlikePrompt(promptIdentifier: string): Promise<LikePromptResponse>;
1257
- /**
1258
- * List all commits for a prompt.
1259
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1260
- * - "promptName" (for private prompts, owner defaults to "-")
1261
- * - "owner/promptName" (for prompts with explicit owner)
1262
- * - "promptName:commitHash" (commit hash is ignored, all commits are returned)
1263
- * @returns An async iterable iterator of PromptCommit objects
1264
- * @example
1265
- * ```typescript
1266
- * // List commits for a private prompt
1267
- * for await (const commit of client.listCommits("my-prompt")) {
1268
- * console.log(commit);
1269
- * }
1270
- *
1271
- * // List commits for a prompt with explicit owner
1272
- * for await (const commit of client.listCommits("owner/my-prompt")) {
1273
- * console.log(commit);
1274
- * }
1275
- * ```
1276
- */
1277
- listCommits(promptIdentifier: string): AsyncIterableIterator<PromptCommit>;
1278
- /**
1279
- * List prompts by filter.
1280
- * @param options - Optional filters for listing prompts
1281
- * @param options.isPublic - Filter by public/private prompts. If undefined, returns all prompts.
1282
- * @param options.isArchived - Filter by archived status. Defaults to false (non-archived prompts only).
1283
- * @param options.sortField - Field to sort by. Defaults to "updated_at".
1284
- * @param options.query - Search query to filter prompts by name or description.
1285
- * @returns An async iterable iterator of Prompt objects
1286
- * @example
1287
- * ```typescript
1288
- * // List all prompts
1289
- * for await (const prompt of client.listPrompts()) {
1290
- * console.log(prompt);
1291
- * }
1292
- *
1293
- * // List only public prompts
1294
- * for await (const prompt of client.listPrompts({ isPublic: true })) {
1295
- * console.log(prompt);
1296
- * }
1297
- *
1298
- * // Search for prompts
1299
- * for await (const prompt of client.listPrompts({ query: "translation" })) {
1300
- * console.log(prompt);
1301
- * }
1302
- * ```
1303
- */
1304
- listPrompts(options?: {
1305
- isPublic?: boolean;
1306
- isArchived?: boolean;
1307
- sortField?: PromptSortField;
1308
- query?: string;
1309
- }): AsyncIterableIterator<Prompt>;
1310
- /**
1311
- * Get a prompt by its identifier.
1312
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1313
- * - "promptName" (for private prompts, owner defaults to "-")
1314
- * - "owner/promptName" (for prompts with explicit owner)
1315
- * - "promptName:commitHash" (commit hash is ignored, latest version is returned)
1316
- * @returns A Promise that resolves to the Prompt object, or null if not found
1317
- * @example
1318
- * ```typescript
1319
- * // Get a private prompt
1320
- * const prompt = await client.getPrompt("my-prompt");
1321
- *
1322
- * // Get a public prompt
1323
- * const publicPrompt = await client.getPrompt("owner/public-prompt");
1324
- * ```
1325
- */
1326
- getPrompt(promptIdentifier: string): Promise<Prompt | null>;
1327
- /**
1328
- * Create a new prompt.
1329
- * @param promptIdentifier - The identifier for the new prompt. Can be in the format:
1330
- * - "promptName" (creates a private prompt)
1331
- * - "owner/promptName" (creates a prompt under a specific owner, must match your tenant)
1332
- * @param options - Optional configuration for the prompt
1333
- * @param options.description - A description of the prompt
1334
- * @param options.readme - Markdown content for the prompt's README
1335
- * @param options.tags - Array of tags to categorize the prompt
1336
- * @param options.isPublic - Whether the prompt should be public. Requires a LangChain Hub handle.
1337
- * @returns A Promise that resolves to the created Prompt object
1338
- * @throws {Error} If creating a public prompt without a LangChain Hub handle, or if owner doesn't match current tenant
1339
- * @example
1340
- * ```typescript
1341
- * // Create a private prompt
1342
- * const prompt = await client.createPrompt("my-new-prompt", {
1343
- * description: "A prompt for translations",
1344
- * tags: ["translation", "language"]
1345
- * });
1346
- *
1347
- * // Create a public prompt
1348
- * const publicPrompt = await client.createPrompt("my-public-prompt", {
1349
- * description: "A public translation prompt",
1350
- * isPublic: true
1351
- * });
1352
- * ```
1353
- */
1354
- createPrompt(promptIdentifier: string, options?: {
1355
- description?: string;
1356
- readme?: string;
1357
- tags?: string[];
1358
- isPublic?: boolean;
1359
- }): Promise<Prompt>;
1360
- /**
1361
- * Create a new commit for an existing prompt.
1362
- * @param promptIdentifier - The identifier of the prompt. Can be in the format:
1363
- * - "promptName" (for private prompts, owner defaults to "-")
1364
- * - "owner/promptName" (for prompts with explicit owner)
1365
- * @param object - The prompt object/manifest to commit (e.g., ChatPromptTemplate, messages array, etc.)
1366
- * @param options - Optional configuration for the commit
1367
- * @param options.parentCommitHash - The parent commit hash. Defaults to "latest" (the most recent commit).
1368
- * @returns A Promise that resolves to the URL of the newly created commit
1369
- * @throws {Error} If the prompt does not exist
1370
- * @example
1371
- * ```typescript
1372
- * import { ChatPromptTemplate } from "@langchain/core/prompts";
1373
- *
1374
- * // Create a commit with a new version of the prompt
1375
- * const template = ChatPromptTemplate.fromMessages([
1376
- * ["system", "You are a helpful assistant."],
1377
- * ["human", "{input}"]
1378
- * ]);
1379
- *
1380
- * const commitUrl = await client.createCommit("my-prompt", template);
1381
- * console.log(`Commit created: ${commitUrl}`);
1382
- *
1383
- * // Create a commit based on a specific parent commit
1384
- * const commitUrl2 = await client.createCommit("my-prompt", template, {
1385
- * parentCommitHash: "abc123def456"
1386
- * });
1387
- * ```
1388
- */
1389
- createCommit(promptIdentifier: string, object: any, options?: {
1390
- parentCommitHash?: string;
1391
- }): Promise<string>;
1392
- /**
1393
- * Update examples with attachments using multipart form data.
1394
- * @param updates List of ExampleUpdateWithAttachments objects to upsert
1395
- * @returns Promise with the update response
1396
- */
1397
- updateExamplesMultipart(datasetId: string, updates?: ExampleUpdate[]): Promise<UpdateExamplesResponse>;
1398
- private _updateExamplesMultipart;
1399
- /**
1400
- * Upload examples with attachments using multipart form data.
1401
- * @param uploads List of ExampleUploadWithAttachments objects to upload
1402
- * @returns Promise with the upload response
1403
- * @deprecated This method is deprecated and will be removed in future LangSmith versions, please use `createExamples` instead
1404
- */
1405
- uploadExamplesMultipart(datasetId: string, uploads?: ExampleCreate[]): Promise<UploadExamplesResponse>;
1406
- private _uploadExamplesMultipart;
1407
- updatePrompt(promptIdentifier: string, options?: {
1408
- description?: string;
1409
- readme?: string;
1410
- tags?: string[];
1411
- isPublic?: boolean;
1412
- isArchived?: boolean;
1413
- }): Promise<Record<string, any>>;
1414
- deletePrompt(promptIdentifier: string): Promise<void>;
1415
- /**
1416
- * Generate a cache key for a prompt.
1417
- * Format: "{identifier}" or "{identifier}:with_model"
1418
- */
1419
- private _getPromptCacheKey;
1420
- /**
1421
- * Fetch a prompt commit directly from the API (bypassing cache).
1422
- */
1423
- private _fetchPromptFromApi;
1424
- pullPromptCommit(promptIdentifier: string, options?: {
1425
- includeModel?: boolean;
1426
- skipCache?: boolean;
1427
- }): Promise<PromptCommit>;
1428
- /**
1429
- * This method should not be used directly, use `import { pull } from "langchain/hub"` instead.
1430
- * Using this method directly returns the JSON string of the prompt rather than a LangChain object.
1431
- * @private
1432
- */
1433
- _pullPrompt(promptIdentifier: string, options?: {
1434
- includeModel?: boolean;
1435
- skipCache?: boolean;
1436
- }): Promise<any>;
1437
- pushPrompt(promptIdentifier: string, options?: {
1438
- object?: any;
1439
- parentCommitHash?: string;
1440
- isPublic?: boolean;
1441
- description?: string;
1442
- readme?: string;
1443
- tags?: string[];
1444
- }): Promise<string>;
1445
- /**
1446
- * Clone a public dataset to your own langsmith tenant.
1447
- * This operation is idempotent. If you already have a dataset with the given name,
1448
- * this function will do nothing.
1449
- * @param {string} tokenOrUrl The token of the public dataset to clone.
1450
- * @param {Object} [options] Additional options for cloning the dataset.
1451
- * @param {string} [options.sourceApiUrl] The URL of the langsmith server where the data is hosted. Defaults to the API URL of your current client.
1452
- * @param {string} [options.datasetName] The name of the dataset to create in your tenant. Defaults to the name of the public dataset.
1453
- * @returns {Promise<void>}
1454
- */
1455
- clonePublicDataset(tokenOrUrl: string, options?: {
1456
- sourceApiUrl?: string;
1457
- datasetName?: string;
1458
- }): Promise<void>;
1459
- private parseTokenOrUrl;
1460
- /**
1461
- * Cleanup resources held by the client.
1462
- * Stops the cache's background refresh timer.
1463
- */
1464
- cleanup(): void;
1465
- /**
1466
- * Awaits all pending trace batches. Useful for environments where
1467
- * you need to be sure that all tracing requests finish before execution ends,
1468
- * such as serverless environments.
1469
- *
1470
- * @example
1471
- * ```
1472
- * import { Client } from "langsmith";
1473
- *
1474
- * const client = new Client();
1475
- *
1476
- * try {
1477
- * // Tracing happens here
1478
- * ...
1479
- * } finally {
1480
- * await client.awaitPendingTraceBatches();
1481
- * }
1482
- * ```
1483
- *
1484
- * @returns A promise that resolves once all currently pending traces have sent.
1485
- */
1486
- awaitPendingTraceBatches(): Promise<void>;
1487
- }
1488
- interface LangSmithTracingClientInterface {
1489
- createRun: (run: CreateRunParams) => Promise<void>;
1490
- updateRun: (runId: string, run: RunUpdate) => Promise<void>;
1491
- }
1492
- //#endregion
1493
- export { Client, ClientConfig, LangSmithTracingClientInterface };
1494
- //# sourceMappingURL=client.d.ts.map