langchain 0.0.129 → 0.0.131

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 (315) hide show
  1. package/dist/agents/chat/index.cjs +3 -0
  2. package/dist/agents/chat/index.d.ts +1 -0
  3. package/dist/agents/chat/index.js +3 -0
  4. package/dist/agents/chat_convo/index.cjs +3 -0
  5. package/dist/agents/chat_convo/index.d.ts +1 -0
  6. package/dist/agents/chat_convo/index.js +3 -0
  7. package/dist/agents/executor.cjs +3 -0
  8. package/dist/agents/executor.d.ts +1 -0
  9. package/dist/agents/executor.js +3 -0
  10. package/dist/agents/mrkl/index.cjs +3 -0
  11. package/dist/agents/mrkl/index.d.ts +1 -0
  12. package/dist/agents/mrkl/index.js +3 -0
  13. package/dist/agents/openai/index.cjs +3 -0
  14. package/dist/agents/openai/index.d.ts +1 -0
  15. package/dist/agents/openai/index.js +3 -0
  16. package/dist/agents/structured_chat/index.cjs +3 -0
  17. package/dist/agents/structured_chat/index.d.ts +1 -0
  18. package/dist/agents/structured_chat/index.js +3 -0
  19. package/dist/callbacks/base.cjs +18 -0
  20. package/dist/callbacks/base.d.ts +15 -0
  21. package/dist/callbacks/base.js +19 -1
  22. package/dist/callbacks/manager.cjs +1 -1
  23. package/dist/callbacks/manager.js +1 -1
  24. package/dist/chains/analyze_documents_chain.cjs +3 -0
  25. package/dist/chains/analyze_documents_chain.d.ts +1 -0
  26. package/dist/chains/analyze_documents_chain.js +3 -0
  27. package/dist/chains/combine_docs_chain.cjs +9 -0
  28. package/dist/chains/combine_docs_chain.d.ts +3 -0
  29. package/dist/chains/combine_docs_chain.js +9 -0
  30. package/dist/chains/constitutional_ai/constitutional_chain.cjs +3 -0
  31. package/dist/chains/constitutional_ai/constitutional_chain.d.ts +1 -0
  32. package/dist/chains/constitutional_ai/constitutional_chain.js +3 -0
  33. package/dist/chains/conversation.cjs +3 -0
  34. package/dist/chains/conversation.d.ts +1 -0
  35. package/dist/chains/conversation.js +3 -0
  36. package/dist/chains/conversational_retrieval_chain.cjs +3 -0
  37. package/dist/chains/conversational_retrieval_chain.d.ts +1 -0
  38. package/dist/chains/conversational_retrieval_chain.js +3 -0
  39. package/dist/chains/llm_chain.cjs +3 -0
  40. package/dist/chains/llm_chain.d.ts +1 -0
  41. package/dist/chains/llm_chain.js +3 -0
  42. package/dist/chains/openai_functions/openapi.cjs +3 -0
  43. package/dist/chains/openai_functions/openapi.js +3 -0
  44. package/dist/chains/openai_moderation.cjs +3 -0
  45. package/dist/chains/openai_moderation.d.ts +1 -0
  46. package/dist/chains/openai_moderation.js +3 -0
  47. package/dist/chains/retrieval_qa.cjs +3 -0
  48. package/dist/chains/retrieval_qa.d.ts +1 -0
  49. package/dist/chains/retrieval_qa.js +3 -0
  50. package/dist/chains/router/multi_route.cjs +3 -0
  51. package/dist/chains/router/multi_route.d.ts +1 -0
  52. package/dist/chains/router/multi_route.js +3 -0
  53. package/dist/chains/sequential_chain.cjs +6 -0
  54. package/dist/chains/sequential_chain.d.ts +2 -0
  55. package/dist/chains/sequential_chain.js +6 -0
  56. package/dist/chains/sql_db/sql_db_chain.cjs +3 -0
  57. package/dist/chains/sql_db/sql_db_chain.d.ts +1 -0
  58. package/dist/chains/sql_db/sql_db_chain.js +3 -0
  59. package/dist/chains/transform.cjs +3 -0
  60. package/dist/chains/transform.d.ts +1 -0
  61. package/dist/chains/transform.js +3 -0
  62. package/dist/chains/vector_db_qa.cjs +3 -0
  63. package/dist/chains/vector_db_qa.d.ts +1 -0
  64. package/dist/chains/vector_db_qa.js +3 -0
  65. package/dist/chat_models/anthropic.cjs +3 -0
  66. package/dist/chat_models/anthropic.d.ts +1 -0
  67. package/dist/chat_models/anthropic.js +3 -0
  68. package/dist/chat_models/baiduwenxin.cjs +3 -13
  69. package/dist/chat_models/baiduwenxin.d.ts +1 -3
  70. package/dist/chat_models/baiduwenxin.js +3 -13
  71. package/dist/chat_models/googlepalm.cjs +9 -0
  72. package/dist/chat_models/googlepalm.d.ts +2 -0
  73. package/dist/chat_models/googlepalm.js +9 -0
  74. package/dist/chat_models/googlevertexai.cjs +9 -0
  75. package/dist/chat_models/googlevertexai.d.ts +2 -0
  76. package/dist/chat_models/googlevertexai.js +9 -0
  77. package/dist/chat_models/ollama.cjs +3 -0
  78. package/dist/chat_models/ollama.d.ts +1 -0
  79. package/dist/chat_models/ollama.js +3 -0
  80. package/dist/chat_models/openai.cjs +19 -5
  81. package/dist/chat_models/openai.d.ts +7 -5
  82. package/dist/chat_models/openai.js +19 -5
  83. package/dist/document_loaders/web/youtube.cjs +77 -0
  84. package/dist/document_loaders/web/youtube.d.ts +17 -0
  85. package/dist/document_loaders/web/youtube.js +73 -0
  86. package/dist/document_transformers/html_to_text.cjs +3 -0
  87. package/dist/document_transformers/html_to_text.d.ts +1 -0
  88. package/dist/document_transformers/html_to_text.js +3 -0
  89. package/dist/document_transformers/mozilla_readability.cjs +3 -0
  90. package/dist/document_transformers/mozilla_readability.d.ts +1 -0
  91. package/dist/document_transformers/mozilla_readability.js +3 -0
  92. package/dist/document_transformers/openai_functions.cjs +3 -0
  93. package/dist/document_transformers/openai_functions.d.ts +1 -0
  94. package/dist/document_transformers/openai_functions.js +3 -0
  95. package/dist/embeddings/cohere.cjs +16 -13
  96. package/dist/embeddings/cohere.js +16 -13
  97. package/dist/embeddings/googlevertexai.cjs +1 -1
  98. package/dist/embeddings/googlevertexai.js +1 -1
  99. package/dist/embeddings/openai.cjs +27 -21
  100. package/dist/embeddings/openai.js +27 -21
  101. package/dist/evaluation/qa/eval_chain.cjs +3 -0
  102. package/dist/evaluation/qa/eval_chain.d.ts +1 -0
  103. package/dist/evaluation/qa/eval_chain.js +3 -0
  104. package/dist/experimental/babyagi/agent.cjs +3 -0
  105. package/dist/experimental/babyagi/agent.d.ts +1 -0
  106. package/dist/experimental/babyagi/agent.js +3 -0
  107. package/dist/experimental/babyagi/task_creation.cjs +3 -0
  108. package/dist/experimental/babyagi/task_creation.d.ts +1 -0
  109. package/dist/experimental/babyagi/task_creation.js +3 -0
  110. package/dist/experimental/babyagi/task_execution.cjs +3 -0
  111. package/dist/experimental/babyagi/task_execution.d.ts +1 -0
  112. package/dist/experimental/babyagi/task_execution.js +3 -0
  113. package/dist/experimental/babyagi/task_prioritization.cjs +3 -0
  114. package/dist/experimental/babyagi/task_prioritization.d.ts +1 -0
  115. package/dist/experimental/babyagi/task_prioritization.js +3 -0
  116. package/dist/experimental/generative_agents/generative_agent.cjs +3 -0
  117. package/dist/experimental/generative_agents/generative_agent.d.ts +1 -0
  118. package/dist/experimental/generative_agents/generative_agent.js +3 -0
  119. package/dist/experimental/generative_agents/generative_agent_memory.cjs +3 -0
  120. package/dist/experimental/generative_agents/generative_agent_memory.d.ts +1 -0
  121. package/dist/experimental/generative_agents/generative_agent_memory.js +3 -0
  122. package/dist/experimental/plan_and_execute/agent_executor.cjs +3 -0
  123. package/dist/experimental/plan_and_execute/agent_executor.d.ts +1 -0
  124. package/dist/experimental/plan_and_execute/agent_executor.js +3 -0
  125. package/dist/llms/cohere.cjs +3 -0
  126. package/dist/llms/cohere.d.ts +1 -0
  127. package/dist/llms/cohere.js +3 -0
  128. package/dist/llms/ollama.cjs +3 -0
  129. package/dist/llms/ollama.d.ts +1 -0
  130. package/dist/llms/ollama.js +3 -0
  131. package/dist/llms/openai-chat.cjs +18 -4
  132. package/dist/llms/openai-chat.d.ts +6 -4
  133. package/dist/llms/openai-chat.js +18 -4
  134. package/dist/llms/openai.cjs +20 -6
  135. package/dist/llms/openai.d.ts +5 -3
  136. package/dist/llms/openai.js +20 -6
  137. package/dist/llms/replicate.cjs +3 -0
  138. package/dist/llms/replicate.d.ts +1 -0
  139. package/dist/llms/replicate.js +3 -0
  140. package/dist/load/import_constants.cjs +1 -0
  141. package/dist/load/import_constants.js +1 -0
  142. package/dist/load/index.cjs +7 -1
  143. package/dist/load/index.js +7 -1
  144. package/dist/load/serializable.cjs +42 -3
  145. package/dist/load/serializable.d.ts +16 -0
  146. package/dist/load/serializable.js +40 -2
  147. package/dist/output_parsers/combining.cjs +3 -0
  148. package/dist/output_parsers/combining.d.ts +1 -0
  149. package/dist/output_parsers/combining.js +3 -0
  150. package/dist/output_parsers/fix.cjs +3 -0
  151. package/dist/output_parsers/fix.d.ts +1 -0
  152. package/dist/output_parsers/fix.js +3 -0
  153. package/dist/output_parsers/list.cjs +3 -0
  154. package/dist/output_parsers/list.d.ts +1 -0
  155. package/dist/output_parsers/list.js +3 -0
  156. package/dist/output_parsers/noop.cjs +3 -0
  157. package/dist/output_parsers/noop.d.ts +1 -0
  158. package/dist/output_parsers/noop.js +3 -0
  159. package/dist/output_parsers/openai_functions.cjs +9 -0
  160. package/dist/output_parsers/openai_functions.d.ts +3 -0
  161. package/dist/output_parsers/openai_functions.js +9 -0
  162. package/dist/output_parsers/regex.cjs +3 -0
  163. package/dist/output_parsers/regex.d.ts +1 -0
  164. package/dist/output_parsers/regex.js +3 -0
  165. package/dist/output_parsers/structured.cjs +6 -0
  166. package/dist/output_parsers/structured.d.ts +2 -0
  167. package/dist/output_parsers/structured.js +6 -0
  168. package/dist/prompts/chat.cjs +21 -0
  169. package/dist/prompts/chat.d.ts +7 -0
  170. package/dist/prompts/chat.js +21 -0
  171. package/dist/prompts/pipeline.cjs +3 -0
  172. package/dist/prompts/pipeline.d.ts +1 -0
  173. package/dist/prompts/pipeline.js +3 -0
  174. package/dist/prompts/prompt.cjs +3 -0
  175. package/dist/prompts/prompt.d.ts +1 -0
  176. package/dist/prompts/prompt.js +3 -0
  177. package/dist/retrievers/amazon_kendra.cjs +3 -0
  178. package/dist/retrievers/amazon_kendra.d.ts +1 -0
  179. package/dist/retrievers/amazon_kendra.js +3 -0
  180. package/dist/retrievers/contextual_compression.cjs +3 -0
  181. package/dist/retrievers/contextual_compression.d.ts +1 -0
  182. package/dist/retrievers/contextual_compression.js +3 -0
  183. package/dist/retrievers/databerry.cjs +3 -0
  184. package/dist/retrievers/databerry.d.ts +1 -0
  185. package/dist/retrievers/databerry.js +3 -0
  186. package/dist/retrievers/hyde.cjs +3 -0
  187. package/dist/retrievers/hyde.d.ts +1 -0
  188. package/dist/retrievers/hyde.js +3 -0
  189. package/dist/retrievers/metal.cjs +3 -0
  190. package/dist/retrievers/metal.d.ts +1 -0
  191. package/dist/retrievers/metal.js +3 -0
  192. package/dist/retrievers/parent_document.cjs +3 -0
  193. package/dist/retrievers/parent_document.d.ts +1 -0
  194. package/dist/retrievers/parent_document.js +3 -0
  195. package/dist/retrievers/self_query/index.cjs +3 -0
  196. package/dist/retrievers/self_query/index.d.ts +1 -0
  197. package/dist/retrievers/self_query/index.js +3 -0
  198. package/dist/retrievers/self_query/supabase.cjs +28 -7
  199. package/dist/retrievers/self_query/supabase.d.ts +2 -2
  200. package/dist/retrievers/self_query/supabase.js +29 -8
  201. package/dist/retrievers/self_query/supabase_utils.cjs +177 -0
  202. package/dist/retrievers/self_query/supabase_utils.d.ts +24 -0
  203. package/dist/retrievers/self_query/supabase_utils.js +172 -0
  204. package/dist/retrievers/self_query/utils.cjs +19 -3
  205. package/dist/retrievers/self_query/utils.d.ts +3 -0
  206. package/dist/retrievers/self_query/utils.js +15 -2
  207. package/dist/retrievers/self_query/weaviate.cjs +3 -14
  208. package/dist/retrievers/self_query/weaviate.js +1 -12
  209. package/dist/retrievers/supabase.cjs +3 -0
  210. package/dist/retrievers/supabase.d.ts +1 -0
  211. package/dist/retrievers/supabase.js +3 -0
  212. package/dist/retrievers/time_weighted.cjs +3 -0
  213. package/dist/retrievers/time_weighted.d.ts +1 -0
  214. package/dist/retrievers/time_weighted.js +3 -0
  215. package/dist/retrievers/vespa.cjs +3 -0
  216. package/dist/retrievers/vespa.d.ts +1 -0
  217. package/dist/retrievers/vespa.js +3 -0
  218. package/dist/retrievers/zep.cjs +3 -0
  219. package/dist/retrievers/zep.d.ts +1 -0
  220. package/dist/retrievers/zep.js +3 -0
  221. package/dist/schema/index.cjs +32 -2
  222. package/dist/schema/index.d.ts +14 -0
  223. package/dist/schema/index.js +32 -2
  224. package/dist/schema/output_parser.cjs +6 -0
  225. package/dist/schema/output_parser.d.ts +2 -0
  226. package/dist/schema/output_parser.js +6 -0
  227. package/dist/schema/runnable.cjs +25 -7
  228. package/dist/schema/runnable.d.ts +6 -0
  229. package/dist/schema/runnable.js +25 -7
  230. package/dist/stores/message/utils.cjs +5 -0
  231. package/dist/stores/message/utils.js +6 -1
  232. package/dist/text_splitter.cjs +9 -0
  233. package/dist/text_splitter.d.ts +3 -0
  234. package/dist/text_splitter.js +9 -0
  235. package/dist/tools/IFTTTWebhook.cjs +3 -0
  236. package/dist/tools/IFTTTWebhook.d.ts +1 -0
  237. package/dist/tools/IFTTTWebhook.js +3 -0
  238. package/dist/tools/aiplugin.cjs +3 -0
  239. package/dist/tools/aiplugin.d.ts +1 -0
  240. package/dist/tools/aiplugin.js +3 -0
  241. package/dist/tools/aws_sfn.cjs +9 -0
  242. package/dist/tools/aws_sfn.d.ts +3 -0
  243. package/dist/tools/aws_sfn.js +9 -0
  244. package/dist/tools/bingserpapi.cjs +3 -0
  245. package/dist/tools/bingserpapi.d.ts +1 -0
  246. package/dist/tools/bingserpapi.js +3 -0
  247. package/dist/tools/brave_search.cjs +3 -0
  248. package/dist/tools/brave_search.d.ts +1 -0
  249. package/dist/tools/brave_search.js +3 -0
  250. package/dist/tools/calculator.cjs +3 -0
  251. package/dist/tools/calculator.d.ts +1 -0
  252. package/dist/tools/calculator.js +3 -0
  253. package/dist/tools/chain.cjs +3 -0
  254. package/dist/tools/chain.d.ts +1 -0
  255. package/dist/tools/chain.js +3 -0
  256. package/dist/tools/dadjokeapi.cjs +3 -0
  257. package/dist/tools/dadjokeapi.d.ts +1 -0
  258. package/dist/tools/dadjokeapi.js +3 -0
  259. package/dist/tools/dataforseo_api_search.cjs +3 -0
  260. package/dist/tools/dataforseo_api_search.d.ts +1 -0
  261. package/dist/tools/dataforseo_api_search.js +3 -0
  262. package/dist/tools/dynamic.cjs +6 -0
  263. package/dist/tools/dynamic.d.ts +2 -0
  264. package/dist/tools/dynamic.js +6 -0
  265. package/dist/tools/fs.cjs +6 -0
  266. package/dist/tools/fs.d.ts +2 -0
  267. package/dist/tools/fs.js +6 -0
  268. package/dist/tools/google_custom_search.cjs +3 -0
  269. package/dist/tools/google_custom_search.d.ts +1 -0
  270. package/dist/tools/google_custom_search.js +3 -0
  271. package/dist/tools/json.cjs +7 -1
  272. package/dist/tools/json.d.ts +2 -0
  273. package/dist/tools/json.js +7 -1
  274. package/dist/tools/requests.cjs +8 -2
  275. package/dist/tools/requests.d.ts +2 -0
  276. package/dist/tools/requests.js +8 -2
  277. package/dist/tools/searxng_search.cjs +3 -0
  278. package/dist/tools/searxng_search.d.ts +1 -0
  279. package/dist/tools/searxng_search.js +3 -0
  280. package/dist/tools/serpapi.cjs +3 -0
  281. package/dist/tools/serpapi.d.ts +1 -0
  282. package/dist/tools/serpapi.js +3 -0
  283. package/dist/tools/serper.cjs +3 -0
  284. package/dist/tools/serper.d.ts +1 -0
  285. package/dist/tools/serper.js +3 -0
  286. package/dist/tools/sql.cjs +12 -0
  287. package/dist/tools/sql.d.ts +4 -0
  288. package/dist/tools/sql.js +12 -0
  289. package/dist/tools/vectorstore.cjs +3 -0
  290. package/dist/tools/vectorstore.d.ts +1 -0
  291. package/dist/tools/vectorstore.js +3 -0
  292. package/dist/tools/webbrowser.cjs +3 -0
  293. package/dist/tools/webbrowser.d.ts +1 -0
  294. package/dist/tools/webbrowser.js +3 -0
  295. package/dist/tools/wikipedia_query_run.cjs +3 -0
  296. package/dist/tools/wikipedia_query_run.d.ts +1 -0
  297. package/dist/tools/wikipedia_query_run.js +3 -0
  298. package/dist/tools/zapier.cjs +3 -0
  299. package/dist/tools/zapier.d.ts +1 -0
  300. package/dist/tools/zapier.js +3 -0
  301. package/dist/vectorstores/base.cjs +3 -0
  302. package/dist/vectorstores/base.d.ts +1 -0
  303. package/dist/vectorstores/base.js +3 -0
  304. package/dist/vectorstores/elasticsearch.cjs +1 -0
  305. package/dist/vectorstores/elasticsearch.js +1 -0
  306. package/dist/vectorstores/hnswlib.cjs +19 -0
  307. package/dist/vectorstores/hnswlib.d.ts +3 -0
  308. package/dist/vectorstores/hnswlib.js +19 -0
  309. package/dist/vectorstores/myscale.cjs +1 -1
  310. package/dist/vectorstores/myscale.js +1 -1
  311. package/dist/vectorstores/supabase.d.ts +1 -2
  312. package/document_loaders/web/youtube.cjs +1 -0
  313. package/document_loaders/web/youtube.d.ts +1 -0
  314. package/document_loaders/web/youtube.js +1 -0
  315. package/package.json +27 -3
@@ -1,6 +1,9 @@
1
1
  import { SFNClient as Client, StartExecutionCommand as Invoker, DescribeExecutionCommand as Describer, SendTaskSuccessCommand as TaskSuccessSender, } from "@aws-sdk/client-sfn";
2
2
  import { Tool } from "./base.js";
3
3
  export class StartExecutionAWSSfnTool extends Tool {
4
+ static lc_name() {
5
+ return "StartExecutionAWSSfnTool";
6
+ }
4
7
  constructor({ name, description, ...rest }) {
5
8
  super();
6
9
  Object.defineProperty(this, "sfnConfig", {
@@ -56,6 +59,9 @@ export class StartExecutionAWSSfnTool extends Tool {
56
59
  }
57
60
  }
58
61
  export class DescribeExecutionAWSSfnTool extends Tool {
62
+ static lc_name() {
63
+ return "DescribeExecutionAWSSfnTool";
64
+ }
59
65
  constructor(config) {
60
66
  super(config);
61
67
  Object.defineProperty(this, "name", {
@@ -107,6 +113,9 @@ export class DescribeExecutionAWSSfnTool extends Tool {
107
113
  }
108
114
  }
109
115
  export class SendTaskSuccessAWSSfnTool extends Tool {
116
+ static lc_name() {
117
+ return "SendTaskSuccessAWSSfnTool";
118
+ }
110
119
  constructor(config) {
111
120
  super(config);
112
121
  Object.defineProperty(this, "name", {
@@ -4,6 +4,9 @@ exports.BingSerpAPI = void 0;
4
4
  const env_js_1 = require("../util/env.cjs");
5
5
  const base_js_1 = require("./base.cjs");
6
6
  class BingSerpAPI extends base_js_1.Tool {
7
+ static lc_name() {
8
+ return "BingSerpAPI";
9
+ }
7
10
  toJSON() {
8
11
  return this.toJSONNotImplemented();
9
12
  }
@@ -1,5 +1,6 @@
1
1
  import { Tool } from "./base.js";
2
2
  declare class BingSerpAPI extends Tool {
3
+ static lc_name(): string;
3
4
  toJSON(): import("../load/serializable.js").SerializedNotImplemented;
4
5
  name: string;
5
6
  description: string;
@@ -1,6 +1,9 @@
1
1
  import { getEnvironmentVariable } from "../util/env.js";
2
2
  import { Tool } from "./base.js";
3
3
  class BingSerpAPI extends Tool {
4
+ static lc_name() {
5
+ return "BingSerpAPI";
6
+ }
4
7
  toJSON() {
5
8
  return this.toJSONNotImplemented();
6
9
  }
@@ -4,6 +4,9 @@ exports.BraveSearch = void 0;
4
4
  const env_js_1 = require("../util/env.cjs");
5
5
  const base_js_1 = require("./base.cjs");
6
6
  class BraveSearch extends base_js_1.Tool {
7
+ static lc_name() {
8
+ return "BraveSearch";
9
+ }
7
10
  constructor(fields = {
8
11
  apiKey: (0, env_js_1.getEnvironmentVariable)("BRAVE_SEARCH_API_KEY"),
9
12
  }) {
@@ -3,6 +3,7 @@ export interface BraveSearchParams {
3
3
  apiKey?: string;
4
4
  }
5
5
  export declare class BraveSearch extends Tool {
6
+ static lc_name(): string;
6
7
  name: string;
7
8
  description: string;
8
9
  apiKey: string;
@@ -1,6 +1,9 @@
1
1
  import { getEnvironmentVariable } from "../util/env.js";
2
2
  import { Tool } from "./base.js";
3
3
  export class BraveSearch extends Tool {
4
+ static lc_name() {
5
+ return "BraveSearch";
6
+ }
4
7
  constructor(fields = {
5
8
  apiKey: getEnvironmentVariable("BRAVE_SEARCH_API_KEY"),
6
9
  }) {
@@ -19,6 +19,9 @@ class Calculator extends base_js_1.Tool {
19
19
  value: `Useful for getting the result of a math expression. The input to this tool should be a valid mathematical expression that could be executed by a simple calculator.`
20
20
  });
21
21
  }
22
+ static lc_name() {
23
+ return "Calculator";
24
+ }
22
25
  get lc_namespace() {
23
26
  return [...super.lc_namespace, "calculator"];
24
27
  }
@@ -1,5 +1,6 @@
1
1
  import { Tool } from "./base.js";
2
2
  export declare class Calculator extends Tool {
3
+ static lc_name(): string;
3
4
  get lc_namespace(): string[];
4
5
  name: string;
5
6
  /** @ignore */
@@ -16,6 +16,9 @@ export class Calculator extends Tool {
16
16
  value: `Useful for getting the result of a math expression. The input to this tool should be a valid mathematical expression that could be executed by a simple calculator.`
17
17
  });
18
18
  }
19
+ static lc_name() {
20
+ return "Calculator";
21
+ }
19
22
  get lc_namespace() {
20
23
  return [...super.lc_namespace, "calculator"];
21
24
  }
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChainTool = void 0;
4
4
  const dynamic_js_1 = require("./dynamic.cjs");
5
5
  class ChainTool extends dynamic_js_1.DynamicTool {
6
+ static lc_name() {
7
+ return "ChainTool";
8
+ }
6
9
  constructor({ chain, ...rest }) {
7
10
  super({
8
11
  ...rest,
@@ -4,6 +4,7 @@ export interface ChainToolInput extends Omit<DynamicToolInput, "func"> {
4
4
  chain: BaseChain;
5
5
  }
6
6
  export declare class ChainTool extends DynamicTool {
7
+ static lc_name(): string;
7
8
  chain: BaseChain;
8
9
  constructor({ chain, ...rest }: ChainToolInput);
9
10
  }
@@ -1,5 +1,8 @@
1
1
  import { DynamicTool } from "./dynamic.js";
2
2
  export class ChainTool extends DynamicTool {
3
+ static lc_name() {
4
+ return "ChainTool";
5
+ }
3
6
  constructor({ chain, ...rest }) {
4
7
  super({
5
8
  ...rest,
@@ -18,6 +18,9 @@ class DadJokeAPI extends base_js_1.Tool {
18
18
  value: "a dad joke generator. get a dad joke about a specific topic. input should be a search term."
19
19
  });
20
20
  }
21
+ static lc_name() {
22
+ return "DadJokeAPI";
23
+ }
21
24
  /** @ignore */
22
25
  async _call(input) {
23
26
  const headers = { Accept: "application/json" };
@@ -1,5 +1,6 @@
1
1
  import { Tool } from "./base.js";
2
2
  declare class DadJokeAPI extends Tool {
3
+ static lc_name(): string;
3
4
  name: string;
4
5
  description: string;
5
6
  /** @ignore */
@@ -15,6 +15,9 @@ class DadJokeAPI extends Tool {
15
15
  value: "a dad joke generator. get a dad joke about a specific topic. input should be a search term."
16
16
  });
17
17
  }
18
+ static lc_name() {
19
+ return "DadJokeAPI";
20
+ }
18
21
  /** @ignore */
19
22
  async _call(input) {
20
23
  const headers = { Accept: "application/json" };
@@ -9,6 +9,9 @@ const base_js_1 = require("./base.cjs");
9
9
  * @description Represents a wrapper class to work with DataForSEO SERP API.
10
10
  */
11
11
  class DataForSeoAPISearch extends base_js_1.Tool {
12
+ static lc_name() {
13
+ return "DataForSeoAPISearch";
14
+ }
12
15
  /**
13
16
  * @constructor
14
17
  * @param {DataForSeoApiConfig} config
@@ -75,6 +75,7 @@ type ApiResponse = {
75
75
  * @description Represents a wrapper class to work with DataForSEO SERP API.
76
76
  */
77
77
  export declare class DataForSeoAPISearch extends Tool {
78
+ static lc_name(): string;
78
79
  name: string;
79
80
  description: string;
80
81
  protected apiLogin: string;
@@ -6,6 +6,9 @@ import { Tool } from "./base.js";
6
6
  * @description Represents a wrapper class to work with DataForSEO SERP API.
7
7
  */
8
8
  export class DataForSeoAPISearch extends Tool {
9
+ static lc_name() {
10
+ return "DataForSeoAPISearch";
11
+ }
9
12
  /**
10
13
  * @constructor
11
14
  * @param {DataForSeoApiConfig} config
@@ -6,6 +6,9 @@ const base_js_1 = require("./base.cjs");
6
6
  * A tool that can be created dynamically from a function, name, and description.
7
7
  */
8
8
  class DynamicTool extends base_js_1.Tool {
9
+ static lc_name() {
10
+ return "DynamicTool";
11
+ }
9
12
  constructor(fields) {
10
13
  super(fields);
11
14
  Object.defineProperty(this, "name", {
@@ -38,6 +41,9 @@ class DynamicTool extends base_js_1.Tool {
38
41
  }
39
42
  exports.DynamicTool = DynamicTool;
40
43
  class DynamicStructuredTool extends base_js_1.StructuredTool {
44
+ static lc_name() {
45
+ return "DynamicStructuredTool";
46
+ }
41
47
  constructor(fields) {
42
48
  super(fields);
43
49
  Object.defineProperty(this, "name", {
@@ -17,6 +17,7 @@ export interface DynamicStructuredToolInput<T extends z.ZodObject<any, any, any,
17
17
  * A tool that can be created dynamically from a function, name, and description.
18
18
  */
19
19
  export declare class DynamicTool extends Tool {
20
+ static lc_name(): string;
20
21
  name: string;
21
22
  description: string;
22
23
  func: DynamicToolInput["func"];
@@ -25,6 +26,7 @@ export declare class DynamicTool extends Tool {
25
26
  _call(input: string, runManager?: CallbackManagerForToolRun): Promise<string>;
26
27
  }
27
28
  export declare class DynamicStructuredTool<T extends z.ZodObject<any, any, any, any> = z.ZodObject<any, any, any, any>> extends StructuredTool {
29
+ static lc_name(): string;
28
30
  name: string;
29
31
  description: string;
30
32
  func: DynamicStructuredToolInput["func"];
@@ -3,6 +3,9 @@ import { StructuredTool, Tool } from "./base.js";
3
3
  * A tool that can be created dynamically from a function, name, and description.
4
4
  */
5
5
  export class DynamicTool extends Tool {
6
+ static lc_name() {
7
+ return "DynamicTool";
8
+ }
6
9
  constructor(fields) {
7
10
  super(fields);
8
11
  Object.defineProperty(this, "name", {
@@ -34,6 +37,9 @@ export class DynamicTool extends Tool {
34
37
  }
35
38
  }
36
39
  export class DynamicStructuredTool extends StructuredTool {
40
+ static lc_name() {
41
+ return "DynamicStructuredTool";
42
+ }
37
43
  constructor(fields) {
38
44
  super(fields);
39
45
  Object.defineProperty(this, "name", {
package/dist/tools/fs.cjs CHANGED
@@ -4,6 +4,9 @@ exports.WriteFileTool = exports.ReadFileTool = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const base_js_1 = require("./base.cjs");
6
6
  class ReadFileTool extends base_js_1.StructuredTool {
7
+ static lc_name() {
8
+ return "ReadFileTool";
9
+ }
7
10
  constructor({ store }) {
8
11
  super(...arguments);
9
12
  Object.defineProperty(this, "schema", {
@@ -40,6 +43,9 @@ class ReadFileTool extends base_js_1.StructuredTool {
40
43
  }
41
44
  exports.ReadFileTool = ReadFileTool;
42
45
  class WriteFileTool extends base_js_1.StructuredTool {
46
+ static lc_name() {
47
+ return "WriteFileTool";
48
+ }
43
49
  constructor({ store, ...rest }) {
44
50
  super(rest);
45
51
  Object.defineProperty(this, "schema", {
@@ -5,6 +5,7 @@ interface ReadFileParams extends ToolParams {
5
5
  store: BaseFileStore;
6
6
  }
7
7
  export declare class ReadFileTool extends StructuredTool {
8
+ static lc_name(): string;
8
9
  schema: z.ZodObject<{
9
10
  file_path: z.ZodString;
10
11
  }, "strip", z.ZodTypeAny, {
@@ -22,6 +23,7 @@ interface WriteFileParams extends ToolParams {
22
23
  store: BaseFileStore;
23
24
  }
24
25
  export declare class WriteFileTool extends StructuredTool {
26
+ static lc_name(): string;
25
27
  schema: z.ZodObject<{
26
28
  file_path: z.ZodString;
27
29
  text: z.ZodString;
package/dist/tools/fs.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { StructuredTool } from "./base.js";
3
3
  export class ReadFileTool extends StructuredTool {
4
+ static lc_name() {
5
+ return "ReadFileTool";
6
+ }
4
7
  constructor({ store }) {
5
8
  super(...arguments);
6
9
  Object.defineProperty(this, "schema", {
@@ -36,6 +39,9 @@ export class ReadFileTool extends StructuredTool {
36
39
  }
37
40
  }
38
41
  export class WriteFileTool extends StructuredTool {
42
+ static lc_name() {
43
+ return "WriteFileTool";
44
+ }
39
45
  constructor({ store, ...rest }) {
40
46
  super(rest);
41
47
  Object.defineProperty(this, "schema", {
@@ -4,6 +4,9 @@ exports.GoogleCustomSearch = void 0;
4
4
  const env_js_1 = require("../util/env.cjs");
5
5
  const base_js_1 = require("./base.cjs");
6
6
  class GoogleCustomSearch extends base_js_1.Tool {
7
+ static lc_name() {
8
+ return "GoogleCustomSearch";
9
+ }
7
10
  get lc_secrets() {
8
11
  return {
9
12
  apiKey: "GOOGLE_API_KEY",
@@ -4,6 +4,7 @@ export interface GoogleCustomSearchParams {
4
4
  googleCSEId?: string;
5
5
  }
6
6
  export declare class GoogleCustomSearch extends Tool {
7
+ static lc_name(): string;
7
8
  get lc_secrets(): {
8
9
  [key: string]: string;
9
10
  } | undefined;
@@ -1,6 +1,9 @@
1
1
  import { getEnvironmentVariable } from "../util/env.js";
2
2
  import { Tool } from "./base.js";
3
3
  export class GoogleCustomSearch extends Tool {
4
+ static lc_name() {
5
+ return "GoogleCustomSearch";
6
+ }
4
7
  get lc_secrets() {
5
8
  return {
6
9
  apiKey: "GOOGLE_API_KEY",
@@ -61,6 +61,9 @@ class JsonSpec extends serializable_js_1.Serializable {
61
61
  }
62
62
  exports.JsonSpec = JsonSpec;
63
63
  class JsonListKeysTool extends base_js_1.Tool {
64
+ static lc_name() {
65
+ return "JsonListKeysTool";
66
+ }
64
67
  constructor(fields) {
65
68
  if (!("jsonSpec" in fields)) {
66
69
  // eslint-disable-next-line no-param-reassign
@@ -83,7 +86,7 @@ class JsonListKeysTool extends base_js_1.Tool {
83
86
  enumerable: true,
84
87
  configurable: true,
85
88
  writable: true,
86
- value: `Can be used to list all keys at a given path.
89
+ value: `Can be used to list all keys at a given path.
87
90
  Before calling this you should be SURE that the path to this exists.
88
91
  The input is a text representation of the path to the json as json pointer syntax (e.g. /key1/0/key2).`
89
92
  });
@@ -101,6 +104,9 @@ class JsonListKeysTool extends base_js_1.Tool {
101
104
  }
102
105
  exports.JsonListKeysTool = JsonListKeysTool;
103
106
  class JsonGetValueTool extends base_js_1.Tool {
107
+ static lc_name() {
108
+ return "JsonGetValueTool";
109
+ }
104
110
  constructor(jsonSpec) {
105
111
  super();
106
112
  Object.defineProperty(this, "jsonSpec", {
@@ -18,6 +18,7 @@ export interface JsonToolFields extends ToolParams {
18
18
  jsonSpec: JsonSpec;
19
19
  }
20
20
  export declare class JsonListKeysTool extends Tool {
21
+ static lc_name(): string;
21
22
  name: string;
22
23
  jsonSpec: JsonSpec;
23
24
  constructor(jsonSpec: JsonSpec);
@@ -28,6 +29,7 @@ export declare class JsonListKeysTool extends Tool {
28
29
  }
29
30
  export declare class JsonGetValueTool extends Tool {
30
31
  jsonSpec: JsonSpec;
32
+ static lc_name(): string;
31
33
  name: string;
32
34
  constructor(jsonSpec: JsonSpec);
33
35
  /** @ignore */
@@ -54,6 +54,9 @@ export class JsonSpec extends Serializable {
54
54
  }
55
55
  }
56
56
  export class JsonListKeysTool extends Tool {
57
+ static lc_name() {
58
+ return "JsonListKeysTool";
59
+ }
57
60
  constructor(fields) {
58
61
  if (!("jsonSpec" in fields)) {
59
62
  // eslint-disable-next-line no-param-reassign
@@ -76,7 +79,7 @@ export class JsonListKeysTool extends Tool {
76
79
  enumerable: true,
77
80
  configurable: true,
78
81
  writable: true,
79
- value: `Can be used to list all keys at a given path.
82
+ value: `Can be used to list all keys at a given path.
80
83
  Before calling this you should be SURE that the path to this exists.
81
84
  The input is a text representation of the path to the json as json pointer syntax (e.g. /key1/0/key2).`
82
85
  });
@@ -93,6 +96,9 @@ export class JsonListKeysTool extends Tool {
93
96
  }
94
97
  }
95
98
  export class JsonGetValueTool extends Tool {
99
+ static lc_name() {
100
+ return "JsonGetValueTool";
101
+ }
96
102
  constructor(jsonSpec) {
97
103
  super();
98
104
  Object.defineProperty(this, "jsonSpec", {
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RequestsPostTool = exports.RequestsGetTool = void 0;
4
4
  const base_js_1 = require("./base.cjs");
5
5
  class RequestsGetTool extends base_js_1.Tool {
6
+ static lc_name() {
7
+ return "RequestsGetTool";
8
+ }
6
9
  constructor(headers = {}, { maxOutputLength } = {}) {
7
10
  super(...arguments);
8
11
  Object.defineProperty(this, "headers", {
@@ -27,7 +30,7 @@ class RequestsGetTool extends base_js_1.Tool {
27
30
  enumerable: true,
28
31
  configurable: true,
29
32
  writable: true,
30
- value: `A portal to the internet. Use this when you need to get specific content from a website.
33
+ value: `A portal to the internet. Use this when you need to get specific content from a website.
31
34
  Input should be a url string (i.e. "https://www.google.com"). The output will be the text response of the GET request.`
32
35
  });
33
36
  this.maxOutputLength = maxOutputLength ?? this.maxOutputLength;
@@ -43,6 +46,9 @@ class RequestsGetTool extends base_js_1.Tool {
43
46
  }
44
47
  exports.RequestsGetTool = RequestsGetTool;
45
48
  class RequestsPostTool extends base_js_1.Tool {
49
+ static lc_name() {
50
+ return "RequestsPostTool";
51
+ }
46
52
  constructor(headers = {}, { maxOutputLength } = {}) {
47
53
  super(...arguments);
48
54
  Object.defineProperty(this, "headers", {
@@ -69,7 +75,7 @@ class RequestsPostTool extends base_js_1.Tool {
69
75
  writable: true,
70
76
  value: `Use this when you want to POST to a website.
71
77
  Input should be a json string with two keys: "url" and "data".
72
- The value of "url" should be a string, and the value of "data" should be a dictionary of
78
+ The value of "url" should be a string, and the value of "data" should be a dictionary of
73
79
  key-value pairs you want to POST to the url as a JSON body.
74
80
  Be careful to always use double quotes for strings in the json string
75
81
  The output will be the text response of the POST request.`
@@ -8,6 +8,7 @@ export interface RequestTool {
8
8
  }
9
9
  export declare class RequestsGetTool extends Tool implements RequestTool {
10
10
  headers: Headers;
11
+ static lc_name(): string;
11
12
  name: string;
12
13
  maxOutputLength: number;
13
14
  constructor(headers?: Headers, { maxOutputLength }?: {
@@ -19,6 +20,7 @@ export declare class RequestsGetTool extends Tool implements RequestTool {
19
20
  }
20
21
  export declare class RequestsPostTool extends Tool implements RequestTool {
21
22
  headers: Headers;
23
+ static lc_name(): string;
22
24
  name: string;
23
25
  maxOutputLength: number;
24
26
  constructor(headers?: Headers, { maxOutputLength }?: {
@@ -1,5 +1,8 @@
1
1
  import { Tool } from "./base.js";
2
2
  export class RequestsGetTool extends Tool {
3
+ static lc_name() {
4
+ return "RequestsGetTool";
5
+ }
3
6
  constructor(headers = {}, { maxOutputLength } = {}) {
4
7
  super(...arguments);
5
8
  Object.defineProperty(this, "headers", {
@@ -24,7 +27,7 @@ export class RequestsGetTool extends Tool {
24
27
  enumerable: true,
25
28
  configurable: true,
26
29
  writable: true,
27
- value: `A portal to the internet. Use this when you need to get specific content from a website.
30
+ value: `A portal to the internet. Use this when you need to get specific content from a website.
28
31
  Input should be a url string (i.e. "https://www.google.com"). The output will be the text response of the GET request.`
29
32
  });
30
33
  this.maxOutputLength = maxOutputLength ?? this.maxOutputLength;
@@ -39,6 +42,9 @@ export class RequestsGetTool extends Tool {
39
42
  }
40
43
  }
41
44
  export class RequestsPostTool extends Tool {
45
+ static lc_name() {
46
+ return "RequestsPostTool";
47
+ }
42
48
  constructor(headers = {}, { maxOutputLength } = {}) {
43
49
  super(...arguments);
44
50
  Object.defineProperty(this, "headers", {
@@ -65,7 +71,7 @@ export class RequestsPostTool extends Tool {
65
71
  writable: true,
66
72
  value: `Use this when you want to POST to a website.
67
73
  Input should be a json string with two keys: "url" and "data".
68
- The value of "url" should be a string, and the value of "data" should be a dictionary of
74
+ The value of "url" should be a string, and the value of "data" should be a dictionary of
69
75
  key-value pairs you want to POST to the url as a JSON body.
70
76
  Be careful to always use double quotes for strings in the json string
71
77
  The output will be the text response of the POST request.`
@@ -11,6 +11,9 @@ const base_js_1 = require("./base.cjs");
11
11
  * note: works best with *agentType*: `structured-chat-zero-shot-react-description`
12
12
  * https://github.com/searxng/searxng */
13
13
  class SearxngSearch extends base_js_1.Tool {
14
+ static lc_name() {
15
+ return "SearxngSearch";
16
+ }
14
17
  get lc_secrets() {
15
18
  return {
16
19
  apiBase: "SEARXNG_API_BASE",
@@ -49,6 +49,7 @@ interface SearxngSearchParams {
49
49
  * note: works best with *agentType*: `structured-chat-zero-shot-react-description`
50
50
  * https://github.com/searxng/searxng */
51
51
  export declare class SearxngSearch extends Tool {
52
+ static lc_name(): string;
52
53
  name: string;
53
54
  description: string;
54
55
  protected apiBase?: string;
@@ -8,6 +8,9 @@ import { Tool } from "./base.js";
8
8
  * note: works best with *agentType*: `structured-chat-zero-shot-react-description`
9
9
  * https://github.com/searxng/searxng */
10
10
  export class SearxngSearch extends Tool {
11
+ static lc_name() {
12
+ return "SearxngSearch";
13
+ }
11
14
  get lc_secrets() {
12
15
  return {
13
16
  apiBase: "SEARXNG_API_BASE",
@@ -9,6 +9,9 @@ const base_js_1 = require("./base.cjs");
9
9
  * To use, you should have the `serpapi` package installed and the SERPAPI_API_KEY environment variable set.
10
10
  */
11
11
  class SerpAPI extends base_js_1.Tool {
12
+ static lc_name() {
13
+ return "SerpAPI";
14
+ }
12
15
  toJSON() {
13
16
  return this.toJSONNotImplemented();
14
17
  }
@@ -280,6 +280,7 @@ type UrlParameters = Record<string, string | number | boolean | undefined | null
280
280
  * To use, you should have the `serpapi` package installed and the SERPAPI_API_KEY environment variable set.
281
281
  */
282
282
  export declare class SerpAPI extends Tool {
283
+ static lc_name(): string;
283
284
  toJSON(): import("../load/serializable.js").SerializedNotImplemented;
284
285
  protected key: string;
285
286
  protected params: Partial<SerpAPIParameters>;
@@ -6,6 +6,9 @@ import { Tool } from "./base.js";
6
6
  * To use, you should have the `serpapi` package installed and the SERPAPI_API_KEY environment variable set.
7
7
  */
8
8
  export class SerpAPI extends Tool {
9
+ static lc_name() {
10
+ return "SerpAPI";
11
+ }
9
12
  toJSON() {
10
13
  return this.toJSONNotImplemented();
11
14
  }
@@ -11,6 +11,9 @@ const base_js_1 = require("./base.cjs");
11
11
  * To use, you should have the SERPER_API_KEY environment variable set.
12
12
  */
13
13
  class Serper extends base_js_1.Tool {
14
+ static lc_name() {
15
+ return "Serper";
16
+ }
14
17
  toJSON() {
15
18
  return this.toJSONNotImplemented();
16
19
  }
@@ -11,6 +11,7 @@ export type SerperParameters = {
11
11
  * To use, you should have the SERPER_API_KEY environment variable set.
12
12
  */
13
13
  export declare class Serper extends Tool {
14
+ static lc_name(): string;
14
15
  toJSON(): import("../load/serializable.js").SerializedNotImplemented;
15
16
  protected key: string;
16
17
  protected params: Partial<SerperParameters>;
@@ -8,6 +8,9 @@ import { Tool } from "./base.js";
8
8
  * To use, you should have the SERPER_API_KEY environment variable set.
9
9
  */
10
10
  export class Serper extends Tool {
11
+ static lc_name() {
12
+ return "Serper";
13
+ }
11
14
  toJSON() {
12
15
  return this.toJSONNotImplemented();
13
16
  }