@langchain/classic 1.0.0-alpha.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +6 -6
  3. package/README.md +174 -66
  4. package/dist/agents/initialize.d.ts +2 -2
  5. package/dist/agents/initialize.d.ts.map +1 -1
  6. package/dist/agents/mrkl/outputParser.d.cts +1 -1
  7. package/dist/agents/mrkl/outputParser.d.cts.map +1 -1
  8. package/dist/agents/openai_tools/index.d.cts.map +1 -1
  9. package/dist/agents/openai_tools/index.d.ts.map +1 -1
  10. package/dist/agents/react/index.d.ts +2 -2
  11. package/dist/agents/react/index.d.ts.map +1 -1
  12. package/dist/agents/structured_chat/index.d.ts +2 -2
  13. package/dist/agents/structured_chat/index.d.ts.map +1 -1
  14. package/dist/agents/tool_calling/index.d.cts.map +1 -1
  15. package/dist/agents/tool_calling/index.d.ts.map +1 -1
  16. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts +2 -2
  17. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts.map +1 -1
  18. package/dist/agents/toolkits/conversational_retrieval/tool.d.cts +8 -2
  19. package/dist/agents/toolkits/conversational_retrieval/tool.d.cts.map +1 -1
  20. package/dist/agents/toolkits/conversational_retrieval/tool.d.ts +8 -2
  21. package/dist/agents/toolkits/conversational_retrieval/tool.d.ts.map +1 -1
  22. package/dist/chains/index.cjs +3 -0
  23. package/dist/chains/index.cjs.map +1 -1
  24. package/dist/chains/index.d.cts +2 -1
  25. package/dist/chains/index.d.ts +2 -1
  26. package/dist/chains/index.js +3 -1
  27. package/dist/chains/index.js.map +1 -1
  28. package/dist/chains/openai_moderation.cjs +107 -0
  29. package/dist/chains/openai_moderation.cjs.map +1 -0
  30. package/dist/chains/openai_moderation.d.cts +74 -0
  31. package/dist/chains/openai_moderation.d.cts.map +1 -0
  32. package/dist/chains/openai_moderation.d.ts +74 -0
  33. package/dist/chains/openai_moderation.d.ts.map +1 -0
  34. package/dist/chains/openai_moderation.js +106 -0
  35. package/dist/chains/openai_moderation.js.map +1 -0
  36. package/dist/chains/question_answering/load.d.cts +2 -2
  37. package/dist/chains/question_answering/load.d.cts.map +1 -1
  38. package/dist/chains/question_answering/load.d.ts +2 -2
  39. package/dist/chains/question_answering/load.d.ts.map +1 -1
  40. package/dist/chains/summarization/load.d.cts +2 -2
  41. package/dist/chains/summarization/load.d.cts.map +1 -1
  42. package/dist/chains/summarization/load.d.ts +2 -2
  43. package/dist/chains/summarization/load.d.ts.map +1 -1
  44. package/dist/embeddings/cache_backed.d.cts +1 -1
  45. package/dist/embeddings/cache_backed.d.ts +1 -1
  46. package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
  47. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  48. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  49. package/dist/experimental/autogpt/prompt.d.cts +2 -2
  50. package/dist/experimental/autogpt/prompt.d.cts.map +1 -1
  51. package/dist/hub/base.cjs +1 -1
  52. package/dist/hub/base.js +1 -1
  53. package/dist/langchain-core/dist/messages/base.d.cts +2 -0
  54. package/dist/langchain-core/dist/messages/base.d.cts.map +1 -1
  55. package/dist/langchain-core/dist/messages/format.d.cts +8 -0
  56. package/dist/langchain-core/dist/messages/format.d.cts.map +1 -0
  57. package/dist/libs/langchain-core/dist/messages/base.d.ts +2 -0
  58. package/dist/libs/langchain-core/dist/messages/base.d.ts.map +1 -1
  59. package/dist/libs/langchain-core/dist/messages/format.d.ts +8 -0
  60. package/dist/libs/langchain-core/dist/messages/format.d.ts.map +1 -0
  61. package/dist/load/import_map.cjs +1 -1
  62. package/dist/load/import_map.js +1 -1
  63. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.cjs +74 -18
  64. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.cjs.map +1 -0
  65. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.js +75 -19
  66. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.js.map +1 -0
  67. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.cjs +1 -1
  68. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/env.cjs.map +1 -0
  69. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.js +1 -1
  70. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/env.js.map +1 -0
  71. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.cjs +1 -1
  72. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.cjs.map +1 -0
  73. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.js +1 -1
  74. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/experimental/otel/constants.cjs.map → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js.map} +1 -1
  75. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.cjs +1 -1
  76. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.cjs.map +1 -0
  77. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.js +1 -1
  78. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js.map +1 -0
  79. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.cjs +2 -2
  80. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.cjs.map +1 -0
  81. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.js +2 -2
  82. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js.map +1 -0
  83. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.cjs +7 -5
  84. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.cjs.map +1 -0
  85. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.js +7 -5
  86. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js.map +1 -0
  87. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.cjs +1 -1
  88. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/constants.cjs.map +1 -0
  89. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.js +1 -1
  90. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/constants.js.map +1 -0
  91. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.cjs +1 -1
  92. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/fetch.cjs.map +1 -0
  93. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.js +1 -1
  94. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/fetch.js.map +1 -0
  95. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.cjs +1 -1
  96. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/otel.cjs.map +1 -0
  97. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.js +1 -1
  98. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/singletons/otel.js.map +1 -0
  99. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.cjs +1 -1
  100. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/_uuid.cjs.map +1 -0
  101. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.js +1 -1
  102. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/_uuid.cjs.map → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/_uuid.js.map} +1 -1
  103. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.cjs +1 -1
  104. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/async_caller.cjs.map +1 -0
  105. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.js +1 -1
  106. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/async_caller.cjs.map → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/async_caller.js.map} +1 -1
  107. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.cjs +19 -23
  108. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.cjs.map +1 -0
  109. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.js +19 -23
  110. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.js.map +1 -0
  111. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.cjs +16 -3
  112. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.cjs.map +1 -0
  113. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.js +16 -3
  114. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.js.map +1 -0
  115. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +1 -1
  116. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.map +1 -0
  117. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +1 -1
  118. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js.map +1 -0
  119. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.cjs +1 -1
  120. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/messages.cjs.map +1 -0
  121. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.js +1 -1
  122. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/messages.cjs.map → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/messages.js.map} +1 -1
  123. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.cjs +1 -1
  124. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/project.cjs.map +1 -0
  125. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.js +1 -1
  126. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/project.js.map +1 -0
  127. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.cjs +1 -1
  128. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/prompts.cjs.map +1 -0
  129. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.js +1 -1
  130. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/prompts.cjs.map → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/prompts.js.map} +1 -1
  131. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.cjs +1 -1
  132. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/warn.cjs.map +1 -0
  133. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.js +1 -1
  134. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/warn.js.map +1 -0
  135. package/dist/output_parsers/structured.d.cts +7 -1
  136. package/dist/output_parsers/structured.d.cts.map +1 -1
  137. package/dist/output_parsers/structured.d.ts +7 -1
  138. package/dist/output_parsers/structured.d.ts.map +1 -1
  139. package/dist/smith/runner_utils.cjs +3 -3
  140. package/dist/smith/runner_utils.js +3 -3
  141. package/dist/tools/retriever.d.cts +12 -1
  142. package/dist/tools/retriever.d.cts.map +1 -1
  143. package/dist/tools/retriever.d.ts +12 -1
  144. package/dist/tools/retriever.d.ts.map +1 -1
  145. package/package.json +225 -225
  146. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/client.cjs.map +0 -1
  147. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/client.js.map +0 -1
  148. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/env.cjs.map +0 -1
  149. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/env.js.map +0 -1
  150. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/experimental/otel/constants.js.map +0 -1
  151. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/experimental/otel/translator.cjs.map +0 -1
  152. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/experimental/otel/translator.js.map +0 -1
  153. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/index.cjs.map +0 -1
  154. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/index.js.map +0 -1
  155. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/run_trees.cjs.map +0 -1
  156. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/run_trees.js.map +0 -1
  157. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/constants.cjs.map +0 -1
  158. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/constants.js.map +0 -1
  159. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/fetch.cjs.map +0 -1
  160. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/fetch.js.map +0 -1
  161. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/otel.cjs.map +0 -1
  162. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/singletons/otel.js.map +0 -1
  163. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/_uuid.js.map +0 -1
  164. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/async_caller.js.map +0 -1
  165. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/env.cjs.map +0 -1
  166. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/env.js.map +0 -1
  167. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/error.cjs.map +0 -1
  168. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/error.js.map +0 -1
  169. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.map +0 -1
  170. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js.map +0 -1
  171. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/messages.js.map +0 -1
  172. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/project.cjs.map +0 -1
  173. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/project.js.map +0 -1
  174. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/prompts.js.map +0 -1
  175. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/warn.cjs.map +0 -1
  176. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_/node_modules/langsmith/dist/utils/warn.js.map +0 -1
  177. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.cjs +0 -0
  178. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@4.1.11_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.js +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @langchain/classic
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dda9ea4: reinstate `OpenAIModerationChain`
8
+ - @langchain/textsplitters@1.0.0
9
+ - @langchain/openai@1.0.0
10
+
11
+ ## 1.0.0
12
+
13
+ This release updates the package for compatibility with LangChain v1.0. See the v1.0 [release notes](https://docs.langchain.com/oss/javascript/releases/langchain-v1) for details on what's new.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License
1
+ MIT License
2
2
 
3
- Copyright (c) Harrison Chase
3
+ Copyright (c) LangChain, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,109 +1,217 @@
1
- # 🦜️🔗 LangChain.js
1
+ # @langchain/classic
2
2
 
3
- Building applications with LLMs through composability
3
+ This package contains functionality from LangChain v0.x that has been moved out of the main `langchain` package as part of the v1.0 release. It exists to provide backward compatibility for existing applications while the core `langchain` package focuses on the essential building blocks for modern agent development.
4
4
 
5
- [![CI](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dm/langchain) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai) [![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/langchain-ai/langchainjs)
6
- [<img src="https://github.com/codespaces/badge.svg" title="Open in Github Codespace" width="150" height="20">](https://codespaces.new/langchain-ai/langchainjs)
5
+ ## When to use this package
7
6
 
8
- Looking for the Python version? Check out [LangChain](https://github.com/langchain-ai/langchain).
7
+ Use `@langchain/classic` if you:
9
8
 
10
- To help you ship LangChain apps to production faster, check out [LangSmith](https://smith.langchain.com).
11
- [LangSmith](https://smith.langchain.com) is a unified developer platform for building, testing, and monitoring LLM applications.
9
+ - Have existing code that uses legacy chains (e.g., `LLMChain`, `ConversationalRetrievalQAChain`, `RetrievalQAChain`)
10
+ - Use the indexing API
11
+ - Depend on functionality from `@langchain/community` that was previously re-exported from `langchain`
12
+ - Are maintaining an existing application and not yet ready to migrate to the new `createAgent` API
12
13
 
13
- ## ⚡️ Quick Install
14
+ ## When NOT to use this package
14
15
 
15
- You can use npm, yarn, or pnpm to install LangChain.js
16
+ **For new projects, use `langchain` v1.0 instead.** The new APIs provide:
16
17
 
17
- `npm install -S langchain` or `yarn add langchain` or `pnpm add langchain`
18
+ - **`createAgent`**: A cleaner, more powerful way to build agents with middleware support
19
+ - **Better performance**: Optimized for modern agent workflows
20
+ - **Focused API surface**: Less complexity, easier to learn
21
+ - **Active development**: New features and improvements will focus on v1.0 APIs
18
22
 
19
- ## 🌐 Supported Environments
23
+ See the [LangChain v1.0 release notes](https://docs.langchain.com/oss/javascript/releases/langchain-v1) for more information.
20
24
 
21
- LangChain is written in TypeScript and can be used in:
25
+ ## Installation
22
26
 
23
- - Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x, 22.x
24
- - Cloudflare Workers
25
- - Vercel / Next.js (Browser, Serverless and Edge functions)
26
- - Supabase Edge Functions
27
- - Browser
28
- - Deno
27
+ ```bash npm2yarn
28
+ npm install @langchain/classic
29
+ ```
29
30
 
30
- ## 🤔 What is LangChain?
31
+ This package requires `@langchain/core` as a peer dependency:
31
32
 
32
- **LangChain** is a framework for developing applications powered by language models. It enables applications that:
33
+ ```bash npm2yarn
34
+ npm install @langchain/core
35
+ ```
33
36
 
34
- - **Are context-aware**: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)
35
- - **Reason**: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)
37
+ ## What's included
36
38
 
37
- This framework consists of several parts.
39
+ ### Legacy Chains
38
40
 
39
- - **Open-source libraries**: Build your applications using LangChain's open-source [building blocks](https://js.langchain.com/docs/concepts/lcel), [components](https://js.langchain.com/docs/concepts), and [third-party integrations](https://js.langchain.com/docs/integrations/platforms/).
40
- Use [LangGraph.js](https://js.langchain.com/docs/concepts/#langgraphjs) to build stateful agents with first-class streaming and human-in-the-loop support.
41
- - **Productionization**: Use [LangSmith](https://docs.smith.langchain.com/) to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence.
42
- - **Deployment**: Turn your LangGraph applications into production-ready APIs and Assistants with [LangGraph Cloud](https://langchain-ai.github.io/langgraph/cloud/).
41
+ All chain implementations from v0.x, including:
43
42
 
44
- The LangChain libraries themselves are made up of several different packages.
43
+ - `LLMChain` - Basic chain for calling an LLM with a prompt template
44
+ - `ConversationalRetrievalQAChain` - Chain for conversational question-answering over documents
45
+ - `RetrievalQAChain` - Chain for question-answering over documents without conversation memory
46
+ - `StuffDocumentsChain` - Chain for stuffing documents into a prompt
47
+ - `MapReduceDocumentsChain` - Chain for map-reduce operations over documents
48
+ - `RefineDocumentsChain` - Chain for iterative refinement over documents
49
+ - And many more...
45
50
 
46
- - **[`@langchain/core`](https://github.com/langchain-ai/langchainjs/blob/main/langchain-core)**: Base abstractions and LangChain Expression Language.
47
- - **[`@langchain/community`](https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-community)**: Third party integrations.
48
- - **[`langchain`](https://github.com/langchain-ai/langchainjs/blob/main/langchain)**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.
49
- - **[LangGraph.js](https://langchain-ai.github.io/langgraphjs/)**: LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more. Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. Integrates smoothly with LangChain, but can be used without it.
51
+ ### Indexing API
50
52
 
51
- Integrations may also be split into their own compatible packages.
53
+ The `RecordManager` and related indexing functionality for managing document updates in vector stores.
52
54
 
53
- ![LangChain Stack](https://github.com/langchain-ai/langchainjs/blob/main/docs/core_docs/static/svg/langchain_stack_062024.svg)
55
+ ### Community Integrations
54
56
 
55
- This library aims to assist in the development of those types of applications. Common examples of these applications include:
57
+ Re-exports from `@langchain/community` that were previously available in the main `langchain` package.
56
58
 
57
- **❓Question Answering over specific documents**
59
+ ### Other Deprecated Functionality
58
60
 
59
- - [Documentation](https://js.langchain.com/docs/tutorials/rag/)
60
- - End-to-end Example: [Doc-Chatbot](https://github.com/dissorial/doc-chatbot)
61
+ Various utilities and abstractions that have been replaced by better alternatives in v1.0.
61
62
 
62
- **💬 Chatbots**
63
+ ## Migration
63
64
 
64
- - [Documentation](https://js.langchain.com/docs/tutorials/chatbot)
65
- - End-to-end Example: [Chat-LangChain](https://github.com/langchain-ai/chat-langchain)
65
+ ### From `langchain` v0.x to `@langchain/classic`
66
66
 
67
- ## 🚀 How does LangChain help?
67
+ If you're upgrading to `langchain` v1.0 but want to keep using legacy functionality:
68
68
 
69
- The main value props of the LangChain libraries are:
69
+ 1. Install `@langchain/classic`:
70
70
 
71
- 1. **Components**: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
72
- 2. **Off-the-shelf chains**: built-in assemblages of components for accomplishing higher-level tasks
71
+ ```bash npm2yarn
72
+ npm install @langchain/classic
73
+ ```
73
74
 
74
- Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.
75
+ 2. Update your imports:
75
76
 
76
- Components fall into the following **modules**:
77
+ ```typescript
78
+ // Before (v0.x)
79
+ import { LLMChain } from "langchain/chains";
80
+ import { ConversationalRetrievalQAChain } from "langchain/chains";
77
81
 
78
- **📃 Model I/O:**
82
+ // After (v1.0)
83
+ import { LLMChain } from "@langchain/classic/chains";
84
+ import { ConversationalRetrievalQAChain } from "@langchain/classic/chains";
85
+ ```
79
86
 
80
- This includes prompt management, prompt optimization, a generic interface for all LLMs, and common utilities for working with LLMs.
87
+ Or if you imported from the root:
81
88
 
82
- **📚 Retrieval:**
89
+ ```typescript
90
+ // Before (v0.x)
91
+ import { LLMChain } from "langchain";
83
92
 
84
- Data Augmented Generation involves specific types of chains that first interact with an external data source to fetch data for use in the generation step. Examples include summarization of long pieces of text and question/answering over specific data sources.
93
+ // After (v1.0)
94
+ import { LLMChain } from "@langchain/classic";
95
+ ```
85
96
 
86
- **🤖 Agents:**
97
+ ### From `@langchain/classic` to `langchain` v1.0
87
98
 
88
- Agents allow an LLM autonomy over how a task is accomplished. Agents make decisions about which Actions to take, then take that Action, observe the result, and repeat until the task is complete. LangChain provides a [standard interface for agents](https://js.langchain.com/docs/concepts/#agents), along with [LangGraph.js](https://github.com/langchain-ai/langgraphjs/) for building custom agents.
99
+ **For new development, we recommend using `createAgent` instead of legacy chains.**
89
100
 
90
- ## 📖 Additional Resources
101
+ Example migration from `LLMChain`:
91
102
 
92
- - [Getting started](https://js.langchain.com/docs/introduction): installation, setting up the environment, simple examples
93
- - Overview of the [interfaces](https://js.langchain.com/docs/how_to/lcel_cheatsheet/), [modules](https://js.langchain.com/docs/concepts) and [integrations](https://js.langchain.com/docs/integrations/platforms/)
94
- - [Full Documentation](https://js.langchain.com)
95
- - [Tutorial](https://js.langchain.com/docs/tutorials/) walkthroughs
96
- - [Langhain Forum](https://forum.langchain.com)
97
- - [API Reference](https://api.js.langchain.com)
103
+ ```typescript
104
+ // Before (using LLMChain)
105
+ import { LLMChain } from "@langchain/classic/chains";
106
+ import { ChatOpenAI } from "@langchain/openai";
107
+ import { PromptTemplate } from "@langchain/core/prompts";
98
108
 
99
- ## 💁 Contributing
109
+ const model = new ChatOpenAI({ model: "gpt-4" });
110
+ const prompt = PromptTemplate.fromTemplate(
111
+ "What is a good name for a company that makes {product}?"
112
+ );
113
+ const chain = new LLMChain({ llm: model, prompt });
114
+ const result = await chain.call({ product: "colorful socks" });
100
115
 
101
- As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
116
+ // After (using createAgent)
117
+ import { createAgent } from "langchain";
102
118
 
103
- For detailed information on how to contribute, see [here](https://github.com/langchain-ai/langchainjs/blob/main/CONTRIBUTING.md).
119
+ const agent = createAgent({
120
+ model: "openai:gpt-4",
121
+ systemPrompt: "You are a creative assistant that helps name companies.",
122
+ });
104
123
 
105
- Please report any security issues or concerns following our [security guidelines](https://github.com/langchain-ai/langchainjs/blob/main/SECURITY.md).
124
+ const result = await agent.invoke({
125
+ messages: [
126
+ {
127
+ role: "user",
128
+ content: "What is a good name for a company that makes colorful socks?",
129
+ },
130
+ ],
131
+ });
132
+ ```
106
133
 
107
- ## 🖇️ Relationship with Python LangChain
134
+ For more complex migrations, see the [migration guide](https://docs.langchain.com/oss/javascript/migrate/langchain-v1).
108
135
 
109
- This is built to integrate as seamlessly as possible with the [LangChain Python package](https://github.com/langchain-ai/langchain). Specifically, this means all objects (prompts, LLMs, chains, etc) are designed in a way where they can be serialized and shared between languages.
136
+ ## Support and Maintenance
137
+
138
+ `@langchain/classic` will receive:
139
+
140
+ - **Bug fixes**: Critical bugs will be fixed
141
+ - **Security updates**: Security vulnerabilities will be patched
142
+ - **No new features**: New functionality will focus on `langchain` v1.0 APIs
143
+
144
+ This package is in **maintenance mode**. For new features and active development, use `langchain` v1.0.
145
+
146
+ ## Examples
147
+
148
+ ### Using a legacy chain
149
+
150
+ ```typescript
151
+ import { LLMChain } from "@langchain/classic/chains";
152
+ import { ChatOpenAI } from "@langchain/openai";
153
+ import { PromptTemplate } from "@langchain/core/prompts";
154
+
155
+ const model = new ChatOpenAI({ model: "gpt-4" });
156
+
157
+ const prompt = PromptTemplate.fromTemplate(
158
+ "Tell me a {adjective} joke about {content}."
159
+ );
160
+
161
+ const chain = new LLMChain({ llm: model, prompt });
162
+
163
+ const result = await chain.call({
164
+ adjective: "funny",
165
+ content: "chickens",
166
+ });
167
+
168
+ console.log(result.text);
169
+ ```
170
+
171
+ ### Using ConversationalRetrievalQAChain
172
+
173
+ ```typescript
174
+ import { ConversationalRetrievalQAChain } from "@langchain/classic/chains";
175
+ import { ChatOpenAI } from "@langchain/openai";
176
+ import { OpenAIEmbeddings } from "@langchain/openai";
177
+ import { MemoryVectorStore } from "langchain/vectorstores/memory";
178
+
179
+ // Create vector store with documents
180
+ const vectorStore = await MemoryVectorStore.fromTexts(
181
+ ["Document 1 text...", "Document 2 text..."],
182
+ [{ id: 1 }, { id: 2 }],
183
+ new OpenAIEmbeddings()
184
+ );
185
+
186
+ // Create chain
187
+ const model = new ChatOpenAI({ model: "gpt-4" });
188
+ const chain = ConversationalRetrievalQAChain.fromLLM(
189
+ model,
190
+ vectorStore.asRetriever()
191
+ );
192
+
193
+ // Use chain
194
+ const result = await chain.call({
195
+ question: "What is in the documents?",
196
+ chat_history: [],
197
+ });
198
+
199
+ console.log(result.text);
200
+ ```
201
+
202
+ ## Resources
203
+
204
+ - [LangChain v1.0 Release Notes](https://docs.langchain.com/oss/javascript/releases/langchain-v1)
205
+ - [Migration Guide](https://docs.langchain.com/oss/javascript/migrate/langchain-v1)
206
+ - [LangChain v1.0 Documentation](https://docs.langchain.com/oss/javascript/langchain/agents)
207
+ - [GitHub Repository](https://github.com/langchain-ai/langchainjs)
208
+
209
+ ## Support
210
+
211
+ For bug reports and issues, please open an issue on [GitHub](https://github.com/langchain-ai/langchainjs/issues).
212
+
213
+ For questions and discussions, join our [Discord community](https://discord.gg/langchain).
214
+
215
+ ## License
216
+
217
+ This package is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.
@@ -7,7 +7,7 @@ import { StructuredChatAgent } from "./structured_chat/index.js";
7
7
  import { OpenAIAgent } from "./openai_functions/index.js";
8
8
  import { XMLAgent } from "./xml/index.js";
9
9
  import { StructuredToolInterface, ToolInterface } from "@langchain/core/tools";
10
- import * as _langchain_core_language_models_base2 from "@langchain/core/language_models/base";
10
+ import * as _langchain_core_language_models_base0 from "@langchain/core/language_models/base";
11
11
  import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
12
12
  import { CallbackManager } from "@langchain/core/callbacks/manager";
13
13
 
@@ -19,7 +19,7 @@ import { CallbackManager } from "@langchain/core/callbacks/manager";
19
19
  * "chat-conversational-react-description".
20
20
  */
21
21
  type AgentType = "zero-shot-react-description" | "chat-zero-shot-react-description" | "chat-conversational-react-description";
22
- declare const initializeAgentExecutor: (tools: ToolInterface<StringInputToolSchema, any, any>[], llm: BaseLanguageModelInterface<any, _langchain_core_language_models_base2.BaseLanguageModelCallOptions>, _agentType?: AgentType | undefined, _verbose?: boolean | undefined, _callbackManager?: CallbackManager | undefined) => Promise<AgentExecutor>;
22
+ declare const initializeAgentExecutor: (tools: ToolInterface<StringInputToolSchema, any, any>[], llm: BaseLanguageModelInterface<any, _langchain_core_language_models_base0.BaseLanguageModelCallOptions>, _agentType?: AgentType | undefined, _verbose?: boolean | undefined, _callbackManager?: CallbackManager | undefined) => Promise<AgentExecutor>;
23
23
  /**
24
24
  * @interface
25
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.d.ts","names":["_langchain_core_language_models_base2","BaseLanguageModelInterface","StructuredToolInterface","ToolInterface","CallbackManager","ChatAgent","ChatConversationalAgent","StructuredChatAgent","AgentExecutor","AgentExecutorInput","ZeroShotAgent","OpenAIAgent","XMLAgent","AgentType","initializeAgentExecutor","_________langchain_core_dist_tools_types_js0","StringInputToolSchema","BaseLanguageModelCallOptions","Promise","InitializeAgentExecutorOptions","fromLLMAndTools","Parameters","Omit","InitializeAgentExecutorOptionsStructured","initializeAgentExecutorWithOptions"],"sources":["../../src/agents/initialize.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport type { StructuredToolInterface, ToolInterface } from \"@langchain/core/tools\";\nimport { CallbackManager } from \"@langchain/core/callbacks/manager\";\nimport { ChatAgent } from \"./chat/index.js\";\nimport { ChatConversationalAgent } from \"./chat_convo/index.js\";\nimport { StructuredChatAgent } from \"./structured_chat/index.js\";\nimport { AgentExecutor, AgentExecutorInput } from \"./executor.js\";\nimport { ZeroShotAgent } from \"./mrkl/index.js\";\nimport { OpenAIAgent } from \"./openai_functions/index.js\";\nimport { XMLAgent } from \"./xml/index.js\";\n/**\n * Represents the type of an agent in LangChain. It can be\n * \"zero-shot-react-description\", \"chat-zero-shot-react-description\", or\n * \"chat-conversational-react-description\".\n */\ntype AgentType = \"zero-shot-react-description\" | \"chat-zero-shot-react-description\" | \"chat-conversational-react-description\";\nexport declare const initializeAgentExecutor: (tools: ToolInterface<import(\"../../../langchain-core/dist/tools/types.js\").StringInputToolSchema, any, any>[], llm: BaseLanguageModelInterface<any, import(\"@langchain/core/language_models/base\").BaseLanguageModelCallOptions>, _agentType?: AgentType | undefined, _verbose?: boolean | undefined, _callbackManager?: CallbackManager | undefined) => Promise<AgentExecutor>;\n/**\n * @interface\n */\nexport type InitializeAgentExecutorOptions = ({\n agentType: \"zero-shot-react-description\";\n agentArgs?: Parameters<typeof ZeroShotAgent.fromLLMAndTools>[2];\n memory?: never;\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"chat-zero-shot-react-description\";\n agentArgs?: Parameters<typeof ChatAgent.fromLLMAndTools>[2];\n memory?: never;\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"chat-conversational-react-description\";\n agentArgs?: Parameters<typeof ChatConversationalAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"xml\";\n agentArgs?: Parameters<typeof XMLAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">);\n/**\n * @interface\n */\nexport type InitializeAgentExecutorOptionsStructured = ({\n agentType: \"structured-chat-zero-shot-react-description\";\n agentArgs?: Parameters<typeof StructuredChatAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"openai-functions\";\n agentArgs?: Parameters<typeof OpenAIAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">);\n/**\n * Initialize an agent executor with options.\n * @param tools Array of tools to use in the agent\n * @param llm LLM or ChatModel to use in the agent\n * @param options Options for the agent, including agentType, agentArgs, and other options for AgentExecutor.fromAgentAndTools\n * @returns AgentExecutor\n */\nexport declare function initializeAgentExecutorWithOptions(tools: StructuredToolInterface[], llm: BaseLanguageModelInterface, options: InitializeAgentExecutorOptionsStructured): Promise<AgentExecutor>;\nexport declare function initializeAgentExecutorWithOptions(tools: ToolInterface[], llm: BaseLanguageModelInterface, options?: InitializeAgentExecutorOptions): Promise<AgentExecutor>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAS0C;AAO1C,KADKa,SAAAA,GACgBC,6BAAyY,GAAA,kCAAA,GAAA,uCAAA;AAAA,cAAzYA,uBAAyY,EAAA,CAAA,KAAA,EAAxWX,aAAwW,CAAA,qBAAA,EAAA,GAAA,EAAA,GAAA,CAAA,EAAA,EAAA,GAAA,EAA3PF,0BAA2P,CAAA,GAAA,EAA3VD,qCAAAA,CAA+KiB,4BAAAA,CAA4K,EAAA,UAAA,CAAA,EAAhIJ,SAAgI,GAAA,SAAA,EAAA,QAAA,CAAA,EAAA,OAAA,GAAA,SAAA,EAAA,gBAAA,CAAA,EAAtDT,eAAsD,GAAA,SAAA,EAAA,GAAtBc,OAAsB,CAAdV,aAAc,CAAA;;;;AAA3PP,KAIvJkB,8BAAAA,GAJuJlB,CAAAA;EAA0B,SAAiGY,EAAAA,6BAAAA;EAAS,SAAiET,CAAAA,EAMxViB,UANwVjB,CAAAA,OAMtUM,aAAAA,CAAcU,eANwThB,CAAAA,CAAAA,CAAAA,CAAAA;EAAe,MAAyBI,CAAAA,EAAAA,KAAAA;CAAa,GAQzZc,IARoYJ,CAQ/XT,kBAR+XS,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAO,SAAA,EAAA,kCAAA;EAInYC,SAAAA,CAAAA,EAMIE,UANJF,CAAAA,OAMsBd,SAAAA,CAAUe,eANF,CAAA,CAAA,CAAA,CAAA;EAAA,MAAA,CAAA,EAAA,KAAA;CAAA,GAQtCE,IAN8BZ,CAMzBD,kBANuCW,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAe,SAA/CC,EAAAA,uCAAAA;EAAU,SAEjBZ,CAAAA,EAMOY,UANPZ,CAAAA,OAMyBH,uBAAAA,CAAwBc,eANjDX,CAAAA,CAAAA,CAAAA,CAAAA;CAAkB,GAOvBa,IAPAA,CAOKb,kBAPLa,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAI,SAE0BjB,EAAAA,KAAUe;EAAe,SAA3CC,CAAAA,EAOAA,UAPAA,CAAAA,OAOkBT,QAAAA,CAASQ,eAP3BC,CAAAA,CAAAA,CAAAA,CAAAA;CAAU,GAQtBC,IANKb,CAMAA,kBANAA,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA;;;;AAGAA,KAOGc,wCAAAA,GAPHd,CAAAA;EAAkB,SAAvBa,EAAAA,6CAAAA;EAAI,SAE0BV,CAAAA,EAOlBS,UAP2BD,CAAAA,OAOTb,mBAAAA,CAAoBa,eAPXA,CAAAA,CAAAA,CAAAA,CAAAA;CAAe,GAQtDE,IARYD,CAQPZ,kBAROY,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAU,SACjBZ,EAAAA,kBAAAA;EAAkB,SAAvBa,CAAAA,EASYD,UATZC,CAAAA,OAS8BX,WAAAA,CAAYS,eAT1CE,CAAAA,CAAAA,CAAAA,CAAAA;AAAI,CAAA,GAUJA,IAVI,CAUCb,kBAVD,EAAA,OAAA,GAAA,OAAA,CAAA,CAAA;AAIR;;;;;;;AAKgBY,iBASQG,kCAAAA,CATRH,KAAAA,EASkDnB,uBATlDmB,EAAAA,EAAAA,GAAAA,EASkFpB,0BATlFoB,EAAAA,OAAAA,EASuHE,wCATvHF,CAAAA,EASkKH,OATlKG,CAS0Kb,aAT1Ka,CAAAA;AACPZ,iBASee,kCAAAA,CATff,KAAAA,EASyDN,aATzDM,EAAAA,EAAAA,GAAAA,EAS+ER,0BAT/EQ,EAAAA,OAAAA,CAAAA,EASqHU,8BATrHV,CAAAA,EASsJS,OATtJT,CAS8JD,aAT9JC,CAAAA"}
1
+ {"version":3,"file":"initialize.d.ts","names":["_langchain_core_language_models_base0","BaseLanguageModelInterface","StructuredToolInterface","ToolInterface","CallbackManager","ChatAgent","ChatConversationalAgent","StructuredChatAgent","AgentExecutor","AgentExecutorInput","ZeroShotAgent","OpenAIAgent","XMLAgent","AgentType","initializeAgentExecutor","_________langchain_core_dist_tools_types_js0","StringInputToolSchema","BaseLanguageModelCallOptions","Promise","InitializeAgentExecutorOptions","fromLLMAndTools","Parameters","Omit","InitializeAgentExecutorOptionsStructured","initializeAgentExecutorWithOptions"],"sources":["../../src/agents/initialize.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport type { StructuredToolInterface, ToolInterface } from \"@langchain/core/tools\";\nimport { CallbackManager } from \"@langchain/core/callbacks/manager\";\nimport { ChatAgent } from \"./chat/index.js\";\nimport { ChatConversationalAgent } from \"./chat_convo/index.js\";\nimport { StructuredChatAgent } from \"./structured_chat/index.js\";\nimport { AgentExecutor, AgentExecutorInput } from \"./executor.js\";\nimport { ZeroShotAgent } from \"./mrkl/index.js\";\nimport { OpenAIAgent } from \"./openai_functions/index.js\";\nimport { XMLAgent } from \"./xml/index.js\";\n/**\n * Represents the type of an agent in LangChain. It can be\n * \"zero-shot-react-description\", \"chat-zero-shot-react-description\", or\n * \"chat-conversational-react-description\".\n */\ntype AgentType = \"zero-shot-react-description\" | \"chat-zero-shot-react-description\" | \"chat-conversational-react-description\";\nexport declare const initializeAgentExecutor: (tools: ToolInterface<import(\"../../../langchain-core/dist/tools/types.js\").StringInputToolSchema, any, any>[], llm: BaseLanguageModelInterface<any, import(\"@langchain/core/language_models/base\").BaseLanguageModelCallOptions>, _agentType?: AgentType | undefined, _verbose?: boolean | undefined, _callbackManager?: CallbackManager | undefined) => Promise<AgentExecutor>;\n/**\n * @interface\n */\nexport type InitializeAgentExecutorOptions = ({\n agentType: \"zero-shot-react-description\";\n agentArgs?: Parameters<typeof ZeroShotAgent.fromLLMAndTools>[2];\n memory?: never;\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"chat-zero-shot-react-description\";\n agentArgs?: Parameters<typeof ChatAgent.fromLLMAndTools>[2];\n memory?: never;\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"chat-conversational-react-description\";\n agentArgs?: Parameters<typeof ChatConversationalAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"xml\";\n agentArgs?: Parameters<typeof XMLAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">);\n/**\n * @interface\n */\nexport type InitializeAgentExecutorOptionsStructured = ({\n agentType: \"structured-chat-zero-shot-react-description\";\n agentArgs?: Parameters<typeof StructuredChatAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">) | ({\n agentType: \"openai-functions\";\n agentArgs?: Parameters<typeof OpenAIAgent.fromLLMAndTools>[2];\n} & Omit<AgentExecutorInput, \"agent\" | \"tools\">);\n/**\n * Initialize an agent executor with options.\n * @param tools Array of tools to use in the agent\n * @param llm LLM or ChatModel to use in the agent\n * @param options Options for the agent, including agentType, agentArgs, and other options for AgentExecutor.fromAgentAndTools\n * @returns AgentExecutor\n */\nexport declare function initializeAgentExecutorWithOptions(tools: StructuredToolInterface[], llm: BaseLanguageModelInterface, options: InitializeAgentExecutorOptionsStructured): Promise<AgentExecutor>;\nexport declare function initializeAgentExecutorWithOptions(tools: ToolInterface[], llm: BaseLanguageModelInterface, options?: InitializeAgentExecutorOptions): Promise<AgentExecutor>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAS0C;AAO1C,KADKa,SAAAA,GACgBC,6BAAyY,GAAA,kCAAA,GAAA,uCAAA;AAAA,cAAzYA,uBAAyY,EAAA,CAAA,KAAA,EAAxWX,aAAwW,CAAA,qBAAA,EAAA,GAAA,EAAA,GAAA,CAAA,EAAA,EAAA,GAAA,EAA3PF,0BAA2P,CAAA,GAAA,EAA3VD,qCAAAA,CAA+KiB,4BAAAA,CAA4K,EAAA,UAAA,CAAA,EAAhIJ,SAAgI,GAAA,SAAA,EAAA,QAAA,CAAA,EAAA,OAAA,GAAA,SAAA,EAAA,gBAAA,CAAA,EAAtDT,eAAsD,GAAA,SAAA,EAAA,GAAtBc,OAAsB,CAAdV,aAAc,CAAA;;;;AAA3PP,KAIvJkB,8BAAAA,GAJuJlB,CAAAA;EAA0B,SAAiGY,EAAAA,6BAAAA;EAAS,SAAiET,CAAAA,EAMxViB,UANwVjB,CAAAA,OAMtUM,aAAAA,CAAcU,eANwThB,CAAAA,CAAAA,CAAAA,CAAAA;EAAe,MAAyBI,CAAAA,EAAAA,KAAAA;CAAa,GAQzZc,IARoYJ,CAQ/XT,kBAR+XS,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAO,SAAA,EAAA,kCAAA;EAInYC,SAAAA,CAAAA,EAMIE,UANJF,CAAAA,OAMsBd,SAAAA,CAAUe,eANF,CAAA,CAAA,CAAA,CAAA;EAAA,MAAA,CAAA,EAAA,KAAA;CAAA,GAQtCE,IAN8BZ,CAMzBD,kBANuCW,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAe,SAA/CC,EAAAA,uCAAAA;EAAU,SAEjBZ,CAAAA,EAMOY,UANPZ,CAAAA,OAMyBH,uBAAAA,CAAwBc,eANjDX,CAAAA,CAAAA,CAAAA,CAAAA;CAAkB,GAOvBa,IAPAA,CAOKb,kBAPLa,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAI,SAE0BjB,EAAAA,KAAUe;EAAe,SAA3CC,CAAAA,EAOAA,UAPAA,CAAAA,OAOkBT,QAAAA,CAASQ,eAP3BC,CAAAA,CAAAA,CAAAA,CAAAA;CAAU,GAQtBC,IANKb,CAMAA,kBANAA,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA;;;;AAGAA,KAOGc,wCAAAA,GAPHd,CAAAA;EAAkB,SAAvBa,EAAAA,6CAAAA;EAAI,SAE0BV,CAAAA,EAOlBS,UAP2BD,CAAAA,OAOTb,mBAAAA,CAAoBa,eAPXA,CAAAA,CAAAA,CAAAA,CAAAA;CAAe,GAQtDE,IARYD,CAQPZ,kBAROY,EAAAA,OAAAA,GAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA;EAAU,SACjBZ,EAAAA,kBAAAA;EAAkB,SAAvBa,CAAAA,EASYD,UATZC,CAAAA,OAS8BX,WAAAA,CAAYS,eAT1CE,CAAAA,CAAAA,CAAAA,CAAAA;AAAI,CAAA,GAUJA,IAVI,CAUCb,kBAVD,EAAA,OAAA,GAAA,OAAA,CAAA,CAAA;AAIR;;;;;;;AAKgBY,iBASQG,kCAAAA,CATRH,KAAAA,EASkDnB,uBATlDmB,EAAAA,EAAAA,GAAAA,EASkFpB,0BATlFoB,EAAAA,OAAAA,EASuHE,wCATvHF,CAAAA,EASkKH,OATlKG,CAS0Kb,aAT1Ka,CAAAA;AACPZ,iBASee,kCAAAA,CATff,KAAAA,EASyDN,aATzDM,EAAAA,EAAAA,GAAAA,EAS+ER,0BAT/EQ,EAAAA,OAAAA,CAAAA,EASqHU,8BATrHV,CAAAA,EASsJS,OATtJT,CAS8JD,aAT9JC,CAAAA"}
@@ -25,10 +25,10 @@ declare class ZeroShotAgentOutputParser extends AgentActionOutputParser {
25
25
  tool?: undefined;
26
26
  toolInput?: undefined;
27
27
  } | {
28
+ returnValues?: undefined;
28
29
  tool: string;
29
30
  toolInput: string;
30
31
  log: string;
31
- returnValues?: undefined;
32
32
  }>;
33
33
  /**
34
34
  * Returns the format instructions for parsing the output of an agent
@@ -1 +1 @@
1
- {"version":3,"file":"outputParser.d.cts","names":["OutputParserArgs","AgentActionOutputParser","FINAL_ANSWER_ACTION","ZeroShotAgentOutputParser","Promise"],"sources":["../../../src/agents/mrkl/outputParser.d.ts"],"sourcesContent":["import { OutputParserArgs } from \"../agent.js\";\nimport { AgentActionOutputParser } from \"../types.js\";\nexport declare const FINAL_ANSWER_ACTION = \"Final Answer:\";\n/**\n * A class that extends `AgentActionOutputParser` to provide a custom\n * implementation for parsing the output of a ZeroShotAgent action.\n */\nexport declare class ZeroShotAgentOutputParser extends AgentActionOutputParser {\n lc_namespace: string[];\n finishToolName: string;\n constructor(fields?: OutputParserArgs);\n /**\n * Parses the text output of an agent action, extracting the tool, tool\n * input, and output.\n * @param text The text output of an agent action.\n * @returns An object containing the tool, tool input, and output extracted from the text, along with the original text as a log.\n */\n parse(text: string): Promise<{\n returnValues: {\n output: string;\n };\n log: string;\n tool?: undefined;\n toolInput?: undefined;\n } | {\n tool: string;\n toolInput: string;\n log: string;\n returnValues?: undefined;\n }>;\n /**\n * Returns the format instructions for parsing the output of an agent\n * action in the style of the ZeroShotAgent.\n * @returns The format instructions for parsing the output.\n */\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;AAOA;;;AAUyBI,cAVJD,yBAAAA,SAAkCF,uBAAAA,CAU9BG;EAAO,YAVuBH,EAAAA,MAAAA,EAAAA;EAAuB,cAAA,EAAA,MAAA;uBAGrDD;;;;;;;uBAOAI"}
1
+ {"version":3,"file":"outputParser.d.cts","names":["OutputParserArgs","AgentActionOutputParser","FINAL_ANSWER_ACTION","ZeroShotAgentOutputParser","Promise"],"sources":["../../../src/agents/mrkl/outputParser.d.ts"],"sourcesContent":["import { OutputParserArgs } from \"../agent.js\";\nimport { AgentActionOutputParser } from \"../types.js\";\nexport declare const FINAL_ANSWER_ACTION = \"Final Answer:\";\n/**\n * A class that extends `AgentActionOutputParser` to provide a custom\n * implementation for parsing the output of a ZeroShotAgent action.\n */\nexport declare class ZeroShotAgentOutputParser extends AgentActionOutputParser {\n lc_namespace: string[];\n finishToolName: string;\n constructor(fields?: OutputParserArgs);\n /**\n * Parses the text output of an agent action, extracting the tool, tool\n * input, and output.\n * @param text The text output of an agent action.\n * @returns An object containing the tool, tool input, and output extracted from the text, along with the original text as a log.\n */\n parse(text: string): Promise<{\n returnValues: {\n output: string;\n };\n log: string;\n tool?: undefined;\n toolInput?: undefined;\n } | {\n returnValues?: undefined;\n tool: string;\n toolInput: string;\n log: string;\n }>;\n /**\n * Returns the format instructions for parsing the output of an agent\n * action in the style of the ZeroShotAgent.\n * @returns The format instructions for parsing the output.\n */\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;AAOA;;;AAUyBI,cAVJD,yBAAAA,SAAkCF,uBAAAA,CAU9BG;EAAO,YAVuBH,EAAAA,MAAAA,EAAAA;EAAuB,cAAA,EAAA,MAAA;uBAGrDD;;;;;;;uBAOAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","___index_js0","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>>;\n"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAMlB,GAMXT,EANFC,aAMED,CANYE,wBAMZF,GAAAA;IAA4BK,KAAAA,CAAAA,EALvBL,uBAKuBK,EAAAA,GALKD,YAAAA,CAAaM,kBAKlBL;IAE3BF;IAAAA,EAAkB,GAAA,EAAA;EA+DNQ,CAAAA,CAAAA;EAAsB;EAAA,KAAGC,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAG;EAAO,MAAEE,EA/DjDX,kBA+DiDW;EAAM;;;;EAE/B,cAAA,CAAA,EAAA,OAAA;CAAoC;;AAFqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGH,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAc,WAAA,GACW,WAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","___index_js1","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>>;\n"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAMlB,GAMXT,EANFC,aAMED,CANYE,wBAMZF,GAAAA;IAA4BK,KAAAA,CAAAA,EALvBL,uBAKuBK,EAAAA,GALKD,YAAAA,CAAaM,kBAKlBL;IAE3BF;IAAAA,EAAkB,GAAA,EAAA;EA+DNQ,CAAAA,CAAAA;EAAsB;EAAA,KAAGC,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAG;EAAO,MAAEE,EA/DjDX,kBA+DiDW;EAAM;;;;EAE/B,cAAA,CAAA,EAAA,OAAA;CAAoC;;AAFqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGH,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAc,WAAA,GACW,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","___index_js0","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>>;\n"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAMlB,GAMXT,EANFC,aAMED,CANYE,wBAMZF,GAAAA;IAA4BK,KAAAA,CAAAA,EALvBL,uBAKuBK,EAAAA,GALKD,YAAAA,CAAaM,kBAKlBL;IAE3BF;IAAAA,EAAkB,GAAA,EAAA;EA+DNQ,CAAAA,CAAAA;EAAsB;EAAA,KAAGC,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAG;EAAO,MAAEE,EA/DjDX,kBA+DiDW;EAAM;;;;EAE/B,cAAA,CAAA,EAAA,OAAA;CAAoC;;AAFqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGH,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAc,WAAA,GACW,WAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","___index_js1","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>>;\n"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAMlB,GAMXT,EANFC,aAMED,CANYE,wBAMZF,GAAAA;IAA4BK,KAAAA,CAAAA,EALvBL,uBAKuBK,EAAAA,GALKD,YAAAA,CAAaM,kBAKlBL;IAE3BF;IAAAA,EAAkB,GAAA,EAAA;EA+DNQ,CAAAA,CAAAA;EAAsB;EAAA,KAAGC,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAG;EAAO,MAAEE,EA/DjDX,kBA+DiDW;EAAM;;;;EAE/B,cAAA,CAAA,EAAA,OAAA;CAAoC;;AAFqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGH,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAc,WAAA,GACW,WAAA"}
@@ -2,7 +2,7 @@ import { AgentRunnableSequence } from "../agent.js";
2
2
  import { BasePromptTemplate } from "@langchain/core/prompts";
3
3
  import { ToolInterface } from "@langchain/core/tools";
4
4
  import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
5
- import * as _langchain_core_agents1 from "@langchain/core/agents";
5
+ import * as _langchain_core_agents0 from "@langchain/core/agents";
6
6
  import { AgentStep } from "@langchain/core/agents";
7
7
 
8
8
  //#region src/agents/react/index.d.ts
@@ -75,7 +75,7 @@ declare function createReactAgent({
75
75
  streamRunnable
76
76
  }: CreateReactAgentParams): Promise<AgentRunnableSequence<{
77
77
  steps: AgentStep[];
78
- }, _langchain_core_agents1.AgentAction | _langchain_core_agents1.AgentFinish>>;
78
+ }, _langchain_core_agents0.AgentAction | _langchain_core_agents0.AgentFinish>>;
79
79
  //#endregion
80
80
  export { CreateReactAgentParams, createReactAgent };
81
81
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentAction","AgentFinish","Promise"],"sources":["../../../src/agents/react/index.d.ts"],"sourcesContent":["import type { ToolInterface } from \"@langchain/core/tools\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { AgentRunnableSequence } from \"../agent.js\";\n/**\n * Params used by the createXmlAgent function.\n */\nexport type CreateReactAgentParams = {\n /** LLM to use for the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: ToolInterface[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses ReAct prompting.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createReactAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { PromptTemplate } from \"@langchain/core/prompts\";\n *\n * import { OpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/react\n * const prompt = await pull<PromptTemplate>(\"hwchase17/react\");\n *\n * const llm = new OpenAI({\n * temperature: 0,\n * });\n *\n * const agent = await createReactAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n * ```\n */\nexport declare function createReactAgent({ llm, tools, prompt, streamRunnable }: CreateReactAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n"],"mappings":";;;;;;;;;;;AAQYK,KAAAA,sBAAAA,GAAsB;EAAA;EAAA,GAEzBH,EAAAA,0BAAAA;EAA0B;EAEX,KAKZD,EALDD,aAKCC,EAAAA;EAAkB;AAkD9B;;;EAA8C,MAAEO,EAlDpCP,kBAkDoCO;EAAK;;;;EACjC,cAAAG,CAAAA,EAAAA,OAAAA;CAC2B;;;AAFkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAzFL,gBAAAA;;;;;GAAyDD,yBAAyBS,QAAQV;SACvGD;GAASQ,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
1
+ {"version":3,"file":"index.d.ts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents0","AgentAction","AgentFinish","Promise"],"sources":["../../../src/agents/react/index.d.ts"],"sourcesContent":["import type { ToolInterface } from \"@langchain/core/tools\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { AgentRunnableSequence } from \"../agent.js\";\n/**\n * Params used by the createXmlAgent function.\n */\nexport type CreateReactAgentParams = {\n /** LLM to use for the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: ToolInterface[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses ReAct prompting.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createReactAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { PromptTemplate } from \"@langchain/core/prompts\";\n *\n * import { OpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/react\n * const prompt = await pull<PromptTemplate>(\"hwchase17/react\");\n *\n * const llm = new OpenAI({\n * temperature: 0,\n * });\n *\n * const agent = await createReactAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n * ```\n */\nexport declare function createReactAgent({ llm, tools, prompt, streamRunnable }: CreateReactAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n"],"mappings":";;;;;;;;;;;AAQYK,KAAAA,sBAAAA,GAAsB;EAAA;EAAA,GAEzBH,EAAAA,0BAAAA;EAA0B;EAEX,KAKZD,EALDD,aAKCC,EAAAA;EAAkB;AAkD9B;;;EAA8C,MAAEO,EAlDpCP,kBAkDoCO;EAAK;;;;EACjC,cAAAG,CAAAA,EAAAA,OAAAA;CAC2B;;;AAFkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAzFL,gBAAAA;;;;;GAAyDD,yBAAyBS,QAAQV;SACvGD;GAASQ,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
@@ -5,7 +5,7 @@ import { StructuredChatOutputParserWithRetries } from "./outputParser.js";
5
5
  import { BaseMessagePromptTemplate, BasePromptTemplate, ChatPromptTemplate } from "@langchain/core/prompts";
6
6
  import { StructuredToolInterface } from "@langchain/core/tools";
7
7
  import { BaseLanguageModelInterface, ToolDefinition } from "@langchain/core/language_models/base";
8
- import * as _langchain_core_agents0 from "@langchain/core/agents";
8
+ import * as _langchain_core_agents1 from "@langchain/core/agents";
9
9
  import { AgentStep } from "@langchain/core/agents";
10
10
 
11
11
  //#region src/agents/structured_chat/index.d.ts
@@ -176,7 +176,7 @@ declare function createStructuredChatAgent({
176
176
  streamRunnable
177
177
  }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{
178
178
  steps: AgentStep[];
179
- }, _langchain_core_agents0.AgentAction | _langchain_core_agents0.AgentFinish>>;
179
+ }, _langchain_core_agents1.AgentAction | _langchain_core_agents1.AgentFinish>>;
180
180
  //#endregion
181
181
  export { CreateStructuredChatAgentParams, StructuredChatAgent, StructuredChatAgentInput, StructuredChatCreatePromptArgs, createStructuredChatAgent };
182
182
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents0","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAAoC,UAhBnBc,8BAAAA,CAgBmB;EAAA;EAAsB,MAAnBP,CAAAA,EAAAA,MAAAA;EAAQ;EAK1BS,MAAAA,CAAAA,EAAAA,MAAAA;EAAmB;EAAA,oBAGjBD,CAAAA,EAAAA,MAAAA;EAAwB;EAUQ,cAOZJ,CAAAA,EAAAA,MAAAA,EAAAA;EAAgB;EAEd,aAQdL,CAAAA,EAzCXF,yBAyCWE,EAAAA;;;;;;AA2BCL,KA9DpBc,wBAAAA,GAA2BR,QA8DPN,CA9DgBW,UA8DhBX,EAAAA,cAAAA,CAAAA;;;;;AAzDiBO,cAA5BQ,mBAAAA,SAA4BR,KAAAA,CAAAA;EAAK,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EA8D1CU,YAAAA,EAAAA,MAAAA,EAAAA;EAA+B,WAAA,CAAA,KAAA,EA3DpBH,wBA2DoB;EAAA,UAElCd,CAAAA,CAAAA,EAAAA,6CAAAA;EAA0B,iBAEvBD,CAAAA,CAAAA,EAAAA,MAAAA;EAAuB,SAAGE,CAAAA,CAAAA,EAAAA,MAAAA;EAAc,KAKxCC,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkB;AA+D9B;;;;EAA8D,OAAEmB,aAAAA,CAAAA,KAAAA,EAzHhCtB,uBAyHgCsB,EAAAA,CAAAA,EAAAA,IAAAA;EAAM;;;;;;EAAmF,OAA7BL,sBAAAA,CAAAA,OAAAA,EAlHjFN,gBAkHiFM,GAAAA;IAAO,SAAA,EAAA,MAAA,EAAA;MAhH3HJ;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
1
+ {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAAoC,UAhBnBc,8BAAAA,CAgBmB;EAAA;EAAsB,MAAnBP,CAAAA,EAAAA,MAAAA;EAAQ;EAK1BS,MAAAA,CAAAA,EAAAA,MAAAA;EAAmB;EAAA,oBAGjBD,CAAAA,EAAAA,MAAAA;EAAwB;EAUQ,cAOZJ,CAAAA,EAAAA,MAAAA,EAAAA;EAAgB;EAEd,aAQdL,CAAAA,EAzCXF,yBAyCWE,EAAAA;;;;;;AA2BCL,KA9DpBc,wBAAAA,GAA2BR,QA8DPN,CA9DgBW,UA8DhBX,EAAAA,cAAAA,CAAAA;;;;;AAzDiBO,cAA5BQ,mBAAAA,SAA4BR,KAAAA,CAAAA;EAAK,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EA8D1CU,YAAAA,EAAAA,MAAAA,EAAAA;EAA+B,WAAA,CAAA,KAAA,EA3DpBH,wBA2DoB;EAAA,UAElCd,CAAAA,CAAAA,EAAAA,6CAAAA;EAA0B,iBAEvBD,CAAAA,CAAAA,EAAAA,MAAAA;EAAuB,SAAGE,CAAAA,CAAAA,EAAAA,MAAAA;EAAc,KAKxCC,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkB;AA+D9B;;;;EAA8D,OAAEmB,aAAAA,CAAAA,KAAAA,EAzHhCtB,uBAyHgCsB,EAAAA,CAAAA,EAAAA,IAAAA;EAAM;;;;;;EAAmF,OAA7BL,sBAAAA,CAAAA,OAAAA,EAlHjFN,gBAkHiFM,GAAAA;IAAO,SAAA,EAAA,MAAA,EAAA;MAhH3HJ;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","___index_js1","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>;\n"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAUV,GAAA,EAJrBJ,iBAIqB;EAyDNK;EAAsB,KAAA,EA3DnCN,uBA2DmC,EAAA,GA3DPE,cA2DO,EAAA;EAAA;EAAM,MAAEM,EAzD1CT,kBAyD0CS;EAAK;;;;EAClC,cAAA,CAAA,EAAA,OAAA;CACW;;AAFuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHF,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAc,WAAA,GACW,WAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","___index_js0","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"../index.js\").AgentFinish | import(\"../index.js\").AgentAction[]>;\n"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAAA;;;;;EAUV,GAAA,EAJrBJ,iBAIqB;EAyDNK;EAAsB,KAAA,EA3DnCN,uBA2DmC,EAAA,GA3DPE,cA2DO,EAAA;EAAA;EAAM,MAAEM,EAzD1CT,kBAyD0CS;EAAK;;;;EAClC,cAAA,CAAA,EAAA,OAAA;CACW;;AAFuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHF,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAc,WAAA,GACW,WAAA"}