langchain 1.0.0-alpha.7 → 1.0.0-alpha.8
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.
- package/dist/agents/ReactAgent.cjs +2 -2
- package/dist/agents/ReactAgent.cjs.map +1 -1
- package/dist/agents/ReactAgent.js +2 -2
- package/dist/agents/ReactAgent.js.map +1 -1
- package/dist/agents/RunnableCallable.cjs +10 -0
- package/dist/agents/RunnableCallable.cjs.map +1 -1
- package/dist/agents/RunnableCallable.d.cts +5 -0
- package/dist/agents/RunnableCallable.d.cts.map +1 -1
- package/dist/agents/RunnableCallable.d.ts +5 -0
- package/dist/agents/RunnableCallable.d.ts.map +1 -1
- package/dist/agents/RunnableCallable.js +10 -0
- package/dist/agents/RunnableCallable.js.map +1 -1
- package/dist/agents/annotation.cjs +14 -0
- package/dist/agents/annotation.cjs.map +1 -1
- package/dist/agents/annotation.d.cts +12 -7
- package/dist/agents/annotation.d.cts.map +1 -1
- package/dist/agents/annotation.d.ts +11 -6
- package/dist/agents/annotation.d.ts.map +1 -1
- package/dist/agents/annotation.js +12 -1
- package/dist/agents/annotation.js.map +1 -1
- package/dist/agents/errors.d.cts +9 -2
- package/dist/agents/errors.d.cts.map +1 -1
- package/dist/agents/errors.d.ts +9 -2
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/index.cjs +3 -0
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +6 -5
- package/dist/agents/index.d.cts.map +1 -1
- package/dist/agents/index.d.ts +6 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +4 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/interrupt.d.cts +5 -16
- package/dist/agents/interrupt.d.cts.map +1 -1
- package/dist/agents/interrupt.d.ts +3 -17
- package/dist/agents/interrupt.d.ts.map +1 -1
- package/dist/agents/interrupt.js +3 -1
- package/dist/agents/middlewareAgent/ReactAgent.cjs +145 -28
- package/dist/agents/middlewareAgent/ReactAgent.cjs.map +1 -1
- package/dist/agents/middlewareAgent/ReactAgent.d.cts +92 -12
- package/dist/agents/middlewareAgent/ReactAgent.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/ReactAgent.d.ts +92 -12
- package/dist/agents/middlewareAgent/ReactAgent.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/ReactAgent.js +145 -28
- package/dist/agents/middlewareAgent/ReactAgent.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/callLimit.cjs +128 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.d.cts +119 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.d.ts +119 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.js +127 -0
- package/dist/agents/middlewareAgent/middleware/callLimit.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.cjs +278 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.d.cts +239 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.d.ts +239 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.js +276 -0
- package/dist/agents/middlewareAgent/middleware/contextEditing.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs +1 -1
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts +2 -2
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts +2 -2
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js +1 -1
- package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/hitl.cjs +38 -8
- package/dist/agents/middlewareAgent/middleware/hitl.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware/hitl.d.cts +130 -25
- package/dist/agents/middlewareAgent/middleware/hitl.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/hitl.d.ts +129 -24
- package/dist/agents/middlewareAgent/middleware/hitl.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/hitl.js +38 -8
- package/dist/agents/middlewareAgent/middleware/hitl.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/index.cjs +26 -6
- package/dist/agents/middlewareAgent/middleware/index.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware/index.d.cts +10 -3
- package/dist/agents/middlewareAgent/middleware/index.d.ts +10 -3
- package/dist/agents/middlewareAgent/middleware/index.js +17 -4
- package/dist/agents/middlewareAgent/middleware/index.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.cjs +193 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.cts +83 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.ts +83 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.js +192 -0
- package/dist/agents/middlewareAgent/middleware/llmToolSelector.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.cjs +67 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.d.cts +45 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.d.ts +45 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.js +67 -0
- package/dist/agents/middlewareAgent/middleware/modelFallback.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.cjs +333 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.d.cts +155 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.d.ts +155 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.js +332 -0
- package/dist/agents/middlewareAgent/middleware/piiRedaction.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/promptCaching.cjs +50 -38
- package/dist/agents/middlewareAgent/middleware/promptCaching.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts +18 -18
- package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts +17 -17
- package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/promptCaching.js +50 -38
- package/dist/agents/middlewareAgent/middleware/promptCaching.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/summarization.cjs +3 -23
- package/dist/agents/middlewareAgent/middleware/summarization.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware/summarization.d.cts +10 -17
- package/dist/agents/middlewareAgent/middleware/summarization.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/summarization.d.ts +2 -9
- package/dist/agents/middlewareAgent/middleware/summarization.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/middleware/summarization.js +3 -22
- package/dist/agents/middlewareAgent/middleware/summarization.js.map +1 -1
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.cjs +242 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.cts +158 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.ts +158 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.js +240 -0
- package/dist/agents/middlewareAgent/middleware/toolCallLimit.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware/utils.cjs +26 -0
- package/dist/agents/middlewareAgent/middleware/utils.cjs.map +1 -0
- package/dist/agents/middlewareAgent/middleware/utils.d.cts +13 -0
- package/dist/agents/middlewareAgent/middleware/utils.d.cts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/utils.d.ts +13 -0
- package/dist/agents/middlewareAgent/middleware/utils.d.ts.map +1 -0
- package/dist/agents/middlewareAgent/middleware/utils.js +25 -0
- package/dist/agents/middlewareAgent/middleware/utils.js.map +1 -0
- package/dist/agents/middlewareAgent/middleware.cjs +1 -0
- package/dist/agents/middlewareAgent/middleware.cjs.map +1 -1
- package/dist/agents/middlewareAgent/middleware.d.cts +14 -3
- package/dist/agents/middlewareAgent/middleware.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/middleware.d.ts +14 -3
- package/dist/agents/middlewareAgent/middleware.d.ts.map +1 -1
- package/dist/agents/middlewareAgent/middleware.js +1 -0
- package/dist/agents/middlewareAgent/middleware.js.map +1 -1
- package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs +2 -2
- package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs.map +1 -1
- package/dist/agents/middlewareAgent/nodes/AfterModalNode.js +2 -2
- package/dist/agents/middlewareAgent/nodes/AfterModalNode.js.map +1 -1
- package/dist/agents/middlewareAgent/nodes/AgentNode.cjs +172 -78
- package/dist/agents/middlewareAgent/nodes/AgentNode.cjs.map +1 -1
- package/dist/agents/middlewareAgent/nodes/AgentNode.js +173 -79
- package/dist/agents/middlewareAgent/nodes/AgentNode.js.map +1 -1
- package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs +2 -2
- package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs.map +1 -1
- package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js +2 -2
- package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js.map +1 -1
- package/dist/agents/middlewareAgent/nodes/middleware.cjs +11 -10
- package/dist/agents/middlewareAgent/nodes/middleware.cjs.map +1 -1
- package/dist/agents/middlewareAgent/nodes/middleware.js +12 -11
- package/dist/agents/middlewareAgent/nodes/middleware.js.map +1 -1
- package/dist/agents/middlewareAgent/nodes/utils.cjs +8 -30
- package/dist/agents/middlewareAgent/nodes/utils.cjs.map +1 -1
- package/dist/agents/middlewareAgent/nodes/utils.js +9 -30
- package/dist/agents/middlewareAgent/nodes/utils.js.map +1 -1
- package/dist/agents/middlewareAgent/types.d.cts +56 -51
- package/dist/agents/middlewareAgent/types.d.cts.map +1 -1
- package/dist/agents/middlewareAgent/types.d.ts +56 -51
- package/dist/agents/middlewareAgent/types.d.ts.map +1 -1
- package/dist/agents/nodes/ToolNode.d.cts +1 -1
- package/dist/agents/tests/utils.cjs +77 -0
- package/dist/agents/tests/utils.cjs.map +1 -0
- package/dist/agents/tests/utils.d.cts +53 -0
- package/dist/agents/tests/utils.d.cts.map +1 -0
- package/dist/agents/tests/utils.d.ts +53 -0
- package/dist/agents/tests/utils.d.ts.map +1 -0
- package/dist/agents/tests/utils.js +76 -0
- package/dist/agents/tests/utils.js.map +1 -0
- package/dist/agents/types.cjs +7 -0
- package/dist/agents/types.cjs.map +1 -0
- package/dist/agents/types.d.cts +38 -4
- package/dist/agents/types.d.cts.map +1 -1
- package/dist/agents/types.d.ts +38 -4
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/types.js +6 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/chat_models/universal.cjs +7 -0
- package/dist/chat_models/universal.cjs.map +1 -1
- package/dist/chat_models/universal.d.cts +7 -2
- package/dist/chat_models/universal.d.cts.map +1 -1
- package/dist/chat_models/universal.d.ts +7 -2
- package/dist/chat_models/universal.d.ts.map +1 -1
- package/dist/chat_models/universal.js +7 -0
- package/dist/chat_models/universal.js.map +1 -1
- package/dist/hub/base.cjs +4 -1
- package/dist/hub/base.cjs.map +1 -1
- package/dist/hub/base.js +4 -1
- package/dist/hub/base.js.map +1 -1
- package/dist/index.cjs +64 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -9
- package/dist/index.d.ts +18 -9
- package/dist/index.js +37 -5
- package/dist/index.js.map +1 -1
- package/dist/load/import_constants.cjs +0 -19
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +0 -19
- package/dist/load/import_constants.js.map +1 -1
- package/dist/load/import_map.cjs +2 -113
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +3 -114
- package/dist/load/import_map.js.map +1 -1
- package/dist/load/serializable.d.cts +1 -10
- package/dist/load/serializable.d.ts +1 -10
- package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_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 +5 -4
- package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_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 -1
- package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_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 +3 -2
- package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_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
- package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.cjs +83 -0
- package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js +79 -0
- package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.cjs +16 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js +13 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.cjs +77 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.cjs.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js +74 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.cjs +115 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.cjs.map +1 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js +112 -0
- package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js.map +1 -0
- package/dist/storage/encoder_backed.cjs +1 -1
- package/dist/storage/encoder_backed.d.cts +1 -1
- package/dist/storage/encoder_backed.d.ts +1 -1
- package/dist/storage/encoder_backed.js +1 -1
- package/dist/storage/file_system.cjs +1 -1
- package/dist/storage/file_system.js +1 -1
- package/package.json +36 -649
- package/dist/agents/middlewareAgent/middleware/bigTool.cjs +0 -162
- package/dist/agents/middlewareAgent/middleware/bigTool.cjs.map +0 -1
- package/dist/agents/middlewareAgent/middleware/bigTool.d.cts +0 -113
- package/dist/agents/middlewareAgent/middleware/bigTool.d.cts.map +0 -1
- package/dist/agents/middlewareAgent/middleware/bigTool.d.ts +0 -113
- package/dist/agents/middlewareAgent/middleware/bigTool.d.ts.map +0 -1
- package/dist/agents/middlewareAgent/middleware/bigTool.js +0 -161
- package/dist/agents/middlewareAgent/middleware/bigTool.js.map +0 -1
- package/dist/chains/analyze_documents_chain.cjs +0 -83
- package/dist/chains/analyze_documents_chain.cjs.map +0 -1
- package/dist/chains/analyze_documents_chain.d.cts +0 -58
- package/dist/chains/analyze_documents_chain.d.cts.map +0 -1
- package/dist/chains/analyze_documents_chain.d.ts +0 -58
- package/dist/chains/analyze_documents_chain.d.ts.map +0 -1
- package/dist/chains/analyze_documents_chain.js +0 -82
- package/dist/chains/analyze_documents_chain.js.map +0 -1
- package/dist/chains/api/api_chain.cjs +0 -100
- package/dist/chains/api/api_chain.cjs.map +0 -1
- package/dist/chains/api/api_chain.d.cts +0 -63
- package/dist/chains/api/api_chain.d.cts.map +0 -1
- package/dist/chains/api/api_chain.d.ts +0 -63
- package/dist/chains/api/api_chain.d.ts.map +0 -1
- package/dist/chains/api/api_chain.js +0 -100
- package/dist/chains/api/api_chain.js.map +0 -1
- package/dist/chains/api/prompts.cjs +0 -38
- package/dist/chains/api/prompts.cjs.map +0 -1
- package/dist/chains/api/prompts.js +0 -36
- package/dist/chains/api/prompts.js.map +0 -1
- package/dist/chains/base.cjs +0 -180
- package/dist/chains/base.cjs.map +0 -1
- package/dist/chains/base.d.cts +0 -88
- package/dist/chains/base.d.cts.map +0 -1
- package/dist/chains/base.d.ts +0 -88
- package/dist/chains/base.d.ts.map +0 -1
- package/dist/chains/base.js +0 -179
- package/dist/chains/base.js.map +0 -1
- package/dist/chains/chat_vector_db_chain.cjs +0 -130
- package/dist/chains/chat_vector_db_chain.cjs.map +0 -1
- package/dist/chains/chat_vector_db_chain.d.cts +0 -62
- package/dist/chains/chat_vector_db_chain.d.cts.map +0 -1
- package/dist/chains/chat_vector_db_chain.d.ts +0 -62
- package/dist/chains/chat_vector_db_chain.d.ts.map +0 -1
- package/dist/chains/chat_vector_db_chain.js +0 -129
- package/dist/chains/chat_vector_db_chain.js.map +0 -1
- package/dist/chains/combine_docs_chain.cjs +0 -275
- package/dist/chains/combine_docs_chain.cjs.map +0 -1
- package/dist/chains/combine_docs_chain.d.cts +0 -126
- package/dist/chains/combine_docs_chain.d.cts.map +0 -1
- package/dist/chains/combine_docs_chain.d.ts +0 -126
- package/dist/chains/combine_docs_chain.d.ts.map +0 -1
- package/dist/chains/combine_docs_chain.js +0 -272
- package/dist/chains/combine_docs_chain.js.map +0 -1
- package/dist/chains/combine_documents/base.cjs +0 -22
- package/dist/chains/combine_documents/base.cjs.map +0 -1
- package/dist/chains/combine_documents/base.js +0 -18
- package/dist/chains/combine_documents/base.js.map +0 -1
- package/dist/chains/combine_documents/index.cjs +0 -16
- package/dist/chains/combine_documents/index.cjs.map +0 -1
- package/dist/chains/combine_documents/index.d.cts +0 -2
- package/dist/chains/combine_documents/index.d.ts +0 -2
- package/dist/chains/combine_documents/index.js +0 -10
- package/dist/chains/combine_documents/index.js.map +0 -1
- package/dist/chains/combine_documents/reduce.cjs +0 -73
- package/dist/chains/combine_documents/reduce.cjs.map +0 -1
- package/dist/chains/combine_documents/reduce.d.cts +0 -36
- package/dist/chains/combine_documents/reduce.d.cts.map +0 -1
- package/dist/chains/combine_documents/reduce.d.ts +0 -36
- package/dist/chains/combine_documents/reduce.d.ts.map +0 -1
- package/dist/chains/combine_documents/reduce.js +0 -66
- package/dist/chains/combine_documents/reduce.js.map +0 -1
- package/dist/chains/combine_documents/stuff.cjs +0 -41
- package/dist/chains/combine_documents/stuff.cjs.map +0 -1
- package/dist/chains/combine_documents/stuff.d.cts +0 -40
- package/dist/chains/combine_documents/stuff.d.cts.map +0 -1
- package/dist/chains/combine_documents/stuff.d.ts +0 -40
- package/dist/chains/combine_documents/stuff.d.ts.map +0 -1
- package/dist/chains/combine_documents/stuff.js +0 -40
- package/dist/chains/combine_documents/stuff.js.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_chain.cjs +0 -131
- package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_chain.d.cts +0 -79
- package/dist/chains/constitutional_ai/constitutional_chain.d.cts.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_chain.d.ts +0 -79
- package/dist/chains/constitutional_ai/constitutional_chain.d.ts.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_chain.js +0 -131
- package/dist/chains/constitutional_ai/constitutional_chain.js.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_principle.cjs +0 -322
- package/dist/chains/constitutional_ai/constitutional_principle.cjs.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_principle.d.cts +0 -50
- package/dist/chains/constitutional_ai/constitutional_principle.d.cts.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_principle.d.ts +0 -50
- package/dist/chains/constitutional_ai/constitutional_principle.d.ts.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_principle.js +0 -320
- package/dist/chains/constitutional_ai/constitutional_principle.js.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_prompts.cjs +0 -96
- package/dist/chains/constitutional_ai/constitutional_prompts.cjs.map +0 -1
- package/dist/chains/constitutional_ai/constitutional_prompts.js +0 -94
- package/dist/chains/constitutional_ai/constitutional_prompts.js.map +0 -1
- package/dist/chains/conversation.cjs +0 -50
- package/dist/chains/conversation.cjs.map +0 -1
- package/dist/chains/conversation.d.cts +0 -34
- package/dist/chains/conversation.d.cts.map +0 -1
- package/dist/chains/conversation.d.ts +0 -34
- package/dist/chains/conversation.d.ts.map +0 -1
- package/dist/chains/conversation.js +0 -48
- package/dist/chains/conversation.js.map +0 -1
- package/dist/chains/conversational_retrieval_chain.cjs +0 -218
- package/dist/chains/conversational_retrieval_chain.cjs.map +0 -1
- package/dist/chains/conversational_retrieval_chain.d.cts +0 -152
- package/dist/chains/conversational_retrieval_chain.d.cts.map +0 -1
- package/dist/chains/conversational_retrieval_chain.d.ts +0 -152
- package/dist/chains/conversational_retrieval_chain.d.ts.map +0 -1
- package/dist/chains/conversational_retrieval_chain.js +0 -217
- package/dist/chains/conversational_retrieval_chain.js.map +0 -1
- package/dist/chains/graph_qa/cypher.cjs +0 -133
- package/dist/chains/graph_qa/cypher.cjs.map +0 -1
- package/dist/chains/graph_qa/cypher.d.cts +0 -76
- package/dist/chains/graph_qa/cypher.d.cts.map +0 -1
- package/dist/chains/graph_qa/cypher.d.ts +0 -76
- package/dist/chains/graph_qa/cypher.d.ts.map +0 -1
- package/dist/chains/graph_qa/cypher.js +0 -126
- package/dist/chains/graph_qa/cypher.js.map +0 -1
- package/dist/chains/graph_qa/prompts.cjs +0 -46
- package/dist/chains/graph_qa/prompts.cjs.map +0 -1
- package/dist/chains/graph_qa/prompts.js +0 -44
- package/dist/chains/graph_qa/prompts.js.map +0 -1
- package/dist/chains/history_aware_retriever.cjs +0 -55
- package/dist/chains/history_aware_retriever.cjs.map +0 -1
- package/dist/chains/history_aware_retriever.d.cts +0 -64
- package/dist/chains/history_aware_retriever.d.cts.map +0 -1
- package/dist/chains/history_aware_retriever.d.ts +0 -64
- package/dist/chains/history_aware_retriever.d.ts.map +0 -1
- package/dist/chains/history_aware_retriever.js +0 -49
- package/dist/chains/history_aware_retriever.js.map +0 -1
- package/dist/chains/index.cjs +0 -106
- package/dist/chains/index.cjs.map +0 -1
- package/dist/chains/index.d.cts +0 -25
- package/dist/chains/index.d.ts +0 -25
- package/dist/chains/index.js +0 -67
- package/dist/chains/index.js.map +0 -1
- package/dist/chains/llm_chain.cjs +0 -155
- package/dist/chains/llm_chain.cjs.map +0 -1
- package/dist/chains/llm_chain.d.cts +0 -97
- package/dist/chains/llm_chain.d.cts.map +0 -1
- package/dist/chains/llm_chain.d.ts +0 -97
- package/dist/chains/llm_chain.d.ts.map +0 -1
- package/dist/chains/llm_chain.js +0 -154
- package/dist/chains/llm_chain.js.map +0 -1
- package/dist/chains/load.cjs +0 -48
- package/dist/chains/load.cjs.map +0 -1
- package/dist/chains/load.d.cts +0 -30
- package/dist/chains/load.d.cts.map +0 -1
- package/dist/chains/load.d.ts +0 -30
- package/dist/chains/load.d.ts.map +0 -1
- package/dist/chains/load.js +0 -42
- package/dist/chains/load.js.map +0 -1
- package/dist/chains/openai_functions/base.cjs +0 -139
- package/dist/chains/openai_functions/base.cjs.map +0 -1
- package/dist/chains/openai_functions/base.d.cts +0 -172
- package/dist/chains/openai_functions/base.d.cts.map +0 -1
- package/dist/chains/openai_functions/base.d.ts +0 -172
- package/dist/chains/openai_functions/base.d.ts.map +0 -1
- package/dist/chains/openai_functions/base.js +0 -137
- package/dist/chains/openai_functions/base.js.map +0 -1
- package/dist/chains/openai_functions/extraction.cjs +0 -71
- package/dist/chains/openai_functions/extraction.cjs.map +0 -1
- package/dist/chains/openai_functions/extraction.d.cts +0 -29
- package/dist/chains/openai_functions/extraction.d.cts.map +0 -1
- package/dist/chains/openai_functions/extraction.d.ts +0 -29
- package/dist/chains/openai_functions/extraction.d.ts.map +0 -1
- package/dist/chains/openai_functions/extraction.js +0 -69
- package/dist/chains/openai_functions/extraction.js.map +0 -1
- package/dist/chains/openai_functions/index.cjs +0 -33
- package/dist/chains/openai_functions/index.cjs.map +0 -1
- package/dist/chains/openai_functions/index.d.cts +0 -5
- package/dist/chains/openai_functions/index.d.ts +0 -5
- package/dist/chains/openai_functions/index.js +0 -21
- package/dist/chains/openai_functions/index.js.map +0 -1
- package/dist/chains/openai_functions/openapi.cjs +0 -287
- package/dist/chains/openai_functions/openapi.cjs.map +0 -1
- package/dist/chains/openai_functions/openapi.d.cts +0 -61
- package/dist/chains/openai_functions/openapi.d.cts.map +0 -1
- package/dist/chains/openai_functions/openapi.d.ts +0 -61
- package/dist/chains/openai_functions/openapi.d.ts.map +0 -1
- package/dist/chains/openai_functions/openapi.js +0 -285
- package/dist/chains/openai_functions/openapi.js.map +0 -1
- package/dist/chains/openai_functions/tagging.cjs +0 -72
- package/dist/chains/openai_functions/tagging.cjs.map +0 -1
- package/dist/chains/openai_functions/tagging.d.cts +0 -47
- package/dist/chains/openai_functions/tagging.d.cts.map +0 -1
- package/dist/chains/openai_functions/tagging.d.ts +0 -47
- package/dist/chains/openai_functions/tagging.d.ts.map +0 -1
- package/dist/chains/openai_functions/tagging.js +0 -70
- package/dist/chains/openai_functions/tagging.js.map +0 -1
- package/dist/chains/query_constructor/index.cjs +0 -145
- package/dist/chains/query_constructor/index.cjs.map +0 -1
- package/dist/chains/query_constructor/index.d.cts +0 -82
- package/dist/chains/query_constructor/index.d.cts.map +0 -1
- package/dist/chains/query_constructor/index.d.ts +0 -82
- package/dist/chains/query_constructor/index.d.ts.map +0 -1
- package/dist/chains/query_constructor/index.js +0 -130
- package/dist/chains/query_constructor/index.js.map +0 -1
- package/dist/chains/query_constructor/ir.cjs +0 -22
- package/dist/chains/query_constructor/ir.cjs.map +0 -1
- package/dist/chains/query_constructor/ir.d.cts +0 -1
- package/dist/chains/query_constructor/ir.d.ts +0 -1
- package/dist/chains/query_constructor/ir.js +0 -12
- package/dist/chains/query_constructor/ir.js.map +0 -1
- package/dist/chains/query_constructor/parser.cjs +0 -80
- package/dist/chains/query_constructor/parser.cjs.map +0 -1
- package/dist/chains/query_constructor/parser.d.cts +0 -43
- package/dist/chains/query_constructor/parser.d.cts.map +0 -1
- package/dist/chains/query_constructor/parser.d.ts +0 -43
- package/dist/chains/query_constructor/parser.d.ts.map +0 -1
- package/dist/chains/query_constructor/parser.js +0 -79
- package/dist/chains/query_constructor/parser.js.map +0 -1
- package/dist/chains/query_constructor/prompt.cjs +0 -137
- package/dist/chains/query_constructor/prompt.cjs.map +0 -1
- package/dist/chains/query_constructor/prompt.d.cts +0 -22
- package/dist/chains/query_constructor/prompt.d.cts.map +0 -1
- package/dist/chains/query_constructor/prompt.d.ts +0 -22
- package/dist/chains/query_constructor/prompt.d.ts.map +0 -1
- package/dist/chains/query_constructor/prompt.js +0 -132
- package/dist/chains/query_constructor/prompt.js.map +0 -1
- package/dist/chains/question_answering/load.cjs +0 -99
- package/dist/chains/question_answering/load.cjs.map +0 -1
- package/dist/chains/question_answering/load.d.cts +0 -72
- package/dist/chains/question_answering/load.d.cts.map +0 -1
- package/dist/chains/question_answering/load.d.ts +0 -72
- package/dist/chains/question_answering/load.d.ts.map +0 -1
- package/dist/chains/question_answering/load.js +0 -96
- package/dist/chains/question_answering/load.js.map +0 -1
- package/dist/chains/question_answering/map_reduce_prompts.cjs +0 -61
- package/dist/chains/question_answering/map_reduce_prompts.cjs.map +0 -1
- package/dist/chains/question_answering/map_reduce_prompts.js +0 -59
- package/dist/chains/question_answering/map_reduce_prompts.js.map +0 -1
- package/dist/chains/question_answering/refine_prompts.cjs +0 -60
- package/dist/chains/question_answering/refine_prompts.cjs.map +0 -1
- package/dist/chains/question_answering/refine_prompts.js +0 -58
- package/dist/chains/question_answering/refine_prompts.js.map +0 -1
- package/dist/chains/question_answering/stuff_prompts.cjs +0 -20
- package/dist/chains/question_answering/stuff_prompts.cjs.map +0 -1
- package/dist/chains/question_answering/stuff_prompts.js +0 -19
- package/dist/chains/question_answering/stuff_prompts.js.map +0 -1
- package/dist/chains/retrieval.cjs +0 -55
- package/dist/chains/retrieval.cjs.map +0 -1
- package/dist/chains/retrieval.d.cts +0 -77
- package/dist/chains/retrieval.d.cts.map +0 -1
- package/dist/chains/retrieval.d.ts +0 -77
- package/dist/chains/retrieval.d.ts.map +0 -1
- package/dist/chains/retrieval.js +0 -49
- package/dist/chains/retrieval.js.map +0 -1
- package/dist/chains/retrieval_qa.cjs +0 -106
- package/dist/chains/retrieval_qa.cjs.map +0 -1
- package/dist/chains/retrieval_qa.d.cts +0 -81
- package/dist/chains/retrieval_qa.d.cts.map +0 -1
- package/dist/chains/retrieval_qa.d.ts +0 -81
- package/dist/chains/retrieval_qa.d.ts.map +0 -1
- package/dist/chains/retrieval_qa.js +0 -106
- package/dist/chains/retrieval_qa.js.map +0 -1
- package/dist/chains/router/llm_router.cjs +0 -50
- package/dist/chains/router/llm_router.cjs.map +0 -1
- package/dist/chains/router/llm_router.d.cts +0 -54
- package/dist/chains/router/llm_router.d.cts.map +0 -1
- package/dist/chains/router/llm_router.d.ts +0 -54
- package/dist/chains/router/llm_router.d.ts.map +0 -1
- package/dist/chains/router/llm_router.js +0 -50
- package/dist/chains/router/llm_router.js.map +0 -1
- package/dist/chains/router/multi_prompt.cjs +0 -116
- package/dist/chains/router/multi_prompt.cjs.map +0 -1
- package/dist/chains/router/multi_prompt.d.cts +0 -76
- package/dist/chains/router/multi_prompt.d.cts.map +0 -1
- package/dist/chains/router/multi_prompt.d.ts +0 -76
- package/dist/chains/router/multi_prompt.d.ts.map +0 -1
- package/dist/chains/router/multi_prompt.js +0 -115
- package/dist/chains/router/multi_prompt.js.map +0 -1
- package/dist/chains/router/multi_prompt_prompt.cjs +0 -22
- package/dist/chains/router/multi_prompt_prompt.cjs.map +0 -1
- package/dist/chains/router/multi_prompt_prompt.js +0 -21
- package/dist/chains/router/multi_prompt_prompt.js.map +0 -1
- package/dist/chains/router/multi_retrieval_prompt.cjs +0 -22
- package/dist/chains/router/multi_retrieval_prompt.cjs.map +0 -1
- package/dist/chains/router/multi_retrieval_prompt.js +0 -21
- package/dist/chains/router/multi_retrieval_prompt.js.map +0 -1
- package/dist/chains/router/multi_retrieval_qa.cjs +0 -137
- package/dist/chains/router/multi_retrieval_qa.cjs.map +0 -1
- package/dist/chains/router/multi_retrieval_qa.d.cts +0 -100
- package/dist/chains/router/multi_retrieval_qa.d.cts.map +0 -1
- package/dist/chains/router/multi_retrieval_qa.d.ts +0 -100
- package/dist/chains/router/multi_retrieval_qa.d.ts.map +0 -1
- package/dist/chains/router/multi_retrieval_qa.js +0 -136
- package/dist/chains/router/multi_retrieval_qa.js.map +0 -1
- package/dist/chains/router/multi_route.cjs +0 -69
- package/dist/chains/router/multi_route.cjs.map +0 -1
- package/dist/chains/router/multi_route.d.cts +0 -69
- package/dist/chains/router/multi_route.d.cts.map +0 -1
- package/dist/chains/router/multi_route.d.ts +0 -69
- package/dist/chains/router/multi_route.d.ts.map +0 -1
- package/dist/chains/router/multi_route.js +0 -68
- package/dist/chains/router/multi_route.js.map +0 -1
- package/dist/chains/router/utils.cjs +0 -18
- package/dist/chains/router/utils.cjs.map +0 -1
- package/dist/chains/router/utils.js +0 -17
- package/dist/chains/router/utils.js.map +0 -1
- package/dist/chains/sequential_chain.cjs +0 -255
- package/dist/chains/sequential_chain.cjs.map +0 -1
- package/dist/chains/sequential_chain.d.cts +0 -158
- package/dist/chains/sequential_chain.d.cts.map +0 -1
- package/dist/chains/sequential_chain.d.ts +0 -158
- package/dist/chains/sequential_chain.d.ts.map +0 -1
- package/dist/chains/sequential_chain.js +0 -254
- package/dist/chains/sequential_chain.js.map +0 -1
- package/dist/chains/serde.d.cts +0 -156
- package/dist/chains/serde.d.cts.map +0 -1
- package/dist/chains/serde.d.ts +0 -156
- package/dist/chains/serde.d.ts.map +0 -1
- package/dist/chains/sql_db/index.cjs +0 -35
- package/dist/chains/sql_db/index.cjs.map +0 -1
- package/dist/chains/sql_db/index.d.cts +0 -3
- package/dist/chains/sql_db/index.d.ts +0 -3
- package/dist/chains/sql_db/index.js +0 -21
- package/dist/chains/sql_db/index.js.map +0 -1
- package/dist/chains/sql_db/sql_db_chain.cjs +0 -196
- package/dist/chains/sql_db/sql_db_chain.cjs.map +0 -1
- package/dist/chains/sql_db/sql_db_chain.d.cts +0 -124
- package/dist/chains/sql_db/sql_db_chain.d.cts.map +0 -1
- package/dist/chains/sql_db/sql_db_chain.d.ts +0 -124
- package/dist/chains/sql_db/sql_db_chain.d.ts.map +0 -1
- package/dist/chains/sql_db/sql_db_chain.js +0 -194
- package/dist/chains/sql_db/sql_db_chain.js.map +0 -1
- package/dist/chains/sql_db/sql_db_prompt.cjs +0 -194
- package/dist/chains/sql_db/sql_db_prompt.cjs.map +0 -1
- package/dist/chains/sql_db/sql_db_prompt.d.cts +0 -44
- package/dist/chains/sql_db/sql_db_prompt.d.cts.map +0 -1
- package/dist/chains/sql_db/sql_db_prompt.d.ts +0 -44
- package/dist/chains/sql_db/sql_db_prompt.d.ts.map +0 -1
- package/dist/chains/sql_db/sql_db_prompt.js +0 -186
- package/dist/chains/sql_db/sql_db_prompt.js.map +0 -1
- package/dist/chains/summarization/load.cjs +0 -74
- package/dist/chains/summarization/load.cjs.map +0 -1
- package/dist/chains/summarization/load.d.cts +0 -33
- package/dist/chains/summarization/load.d.cts.map +0 -1
- package/dist/chains/summarization/load.d.ts +0 -33
- package/dist/chains/summarization/load.d.ts.map +0 -1
- package/dist/chains/summarization/load.js +0 -74
- package/dist/chains/summarization/load.js.map +0 -1
- package/dist/chains/summarization/refine_prompts.cjs +0 -24
- package/dist/chains/summarization/refine_prompts.cjs.map +0 -1
- package/dist/chains/summarization/refine_prompts.js +0 -23
- package/dist/chains/summarization/refine_prompts.js.map +0 -1
- package/dist/chains/summarization/stuff_prompts.cjs +0 -19
- package/dist/chains/summarization/stuff_prompts.cjs.map +0 -1
- package/dist/chains/summarization/stuff_prompts.js +0 -18
- package/dist/chains/summarization/stuff_prompts.js.map +0 -1
- package/dist/chains/transform.cjs +0 -43
- package/dist/chains/transform.cjs.map +0 -1
- package/dist/chains/transform.d.cts +0 -44
- package/dist/chains/transform.d.cts.map +0 -1
- package/dist/chains/transform.d.ts +0 -44
- package/dist/chains/transform.d.ts.map +0 -1
- package/dist/chains/transform.js +0 -43
- package/dist/chains/transform.js.map +0 -1
- package/dist/chains/vector_db_qa.cjs +0 -95
- package/dist/chains/vector_db_qa.cjs.map +0 -1
- package/dist/chains/vector_db_qa.d.cts +0 -66
- package/dist/chains/vector_db_qa.d.cts.map +0 -1
- package/dist/chains/vector_db_qa.d.ts +0 -66
- package/dist/chains/vector_db_qa.d.ts.map +0 -1
- package/dist/chains/vector_db_qa.js +0 -95
- package/dist/chains/vector_db_qa.js.map +0 -1
- package/dist/document.cjs +0 -21
- package/dist/document.cjs.map +0 -1
- package/dist/document.d.cts +0 -2
- package/dist/document.d.ts +0 -2
- package/dist/document.js +0 -10
- package/dist/document.js.map +0 -1
- package/dist/document_loaders/base.cjs +0 -22
- package/dist/document_loaders/base.cjs.map +0 -1
- package/dist/document_loaders/base.d.cts +0 -1
- package/dist/document_loaders/base.d.ts +0 -1
- package/dist/document_loaders/base.js +0 -12
- package/dist/document_loaders/base.js.map +0 -1
- package/dist/document_loaders/fs/buffer.cjs +0 -69
- package/dist/document_loaders/fs/buffer.cjs.map +0 -1
- package/dist/document_loaders/fs/buffer.d.cts +0 -46
- package/dist/document_loaders/fs/buffer.d.cts.map +0 -1
- package/dist/document_loaders/fs/buffer.d.ts +0 -46
- package/dist/document_loaders/fs/buffer.d.ts.map +0 -1
- package/dist/document_loaders/fs/buffer.js +0 -63
- package/dist/document_loaders/fs/buffer.js.map +0 -1
- package/dist/document_loaders/fs/directory.cjs +0 -116
- package/dist/document_loaders/fs/directory.cjs.map +0 -1
- package/dist/document_loaders/fs/directory.d.cts +0 -76
- package/dist/document_loaders/fs/directory.d.cts.map +0 -1
- package/dist/document_loaders/fs/directory.d.ts +0 -76
- package/dist/document_loaders/fs/directory.d.ts.map +0 -1
- package/dist/document_loaders/fs/directory.js +0 -109
- package/dist/document_loaders/fs/directory.js.map +0 -1
- package/dist/document_loaders/fs/json.cjs +0 -128
- package/dist/document_loaders/fs/json.cjs.map +0 -1
- package/dist/document_loaders/fs/json.d.cts +0 -65
- package/dist/document_loaders/fs/json.d.cts.map +0 -1
- package/dist/document_loaders/fs/json.d.ts +0 -65
- package/dist/document_loaders/fs/json.d.ts.map +0 -1
- package/dist/document_loaders/fs/json.js +0 -121
- package/dist/document_loaders/fs/json.js.map +0 -1
- package/dist/document_loaders/fs/multi_file.cjs +0 -82
- package/dist/document_loaders/fs/multi_file.cjs.map +0 -1
- package/dist/document_loaders/fs/multi_file.d.cts +0 -43
- package/dist/document_loaders/fs/multi_file.d.cts.map +0 -1
- package/dist/document_loaders/fs/multi_file.d.ts +0 -43
- package/dist/document_loaders/fs/multi_file.d.ts.map +0 -1
- package/dist/document_loaders/fs/multi_file.js +0 -76
- package/dist/document_loaders/fs/multi_file.js.map +0 -1
- package/dist/document_loaders/fs/text.cjs +0 -101
- package/dist/document_loaders/fs/text.cjs.map +0 -1
- package/dist/document_loaders/fs/text.d.cts +0 -57
- package/dist/document_loaders/fs/text.d.cts.map +0 -1
- package/dist/document_loaders/fs/text.d.ts +0 -57
- package/dist/document_loaders/fs/text.d.ts.map +0 -1
- package/dist/document_loaders/fs/text.js +0 -95
- package/dist/document_loaders/fs/text.js.map +0 -1
- package/dist/evaluation/agents/index.cjs +0 -1
- package/dist/evaluation/agents/index.js +0 -1
- package/dist/evaluation/agents/prompt.cjs +0 -132
- package/dist/evaluation/agents/prompt.cjs.map +0 -1
- package/dist/evaluation/agents/prompt.js +0 -130
- package/dist/evaluation/agents/prompt.js.map +0 -1
- package/dist/evaluation/agents/trajectory.cjs +0 -132
- package/dist/evaluation/agents/trajectory.cjs.map +0 -1
- package/dist/evaluation/agents/trajectory.d.cts +0 -61
- package/dist/evaluation/agents/trajectory.d.cts.map +0 -1
- package/dist/evaluation/agents/trajectory.d.ts +0 -61
- package/dist/evaluation/agents/trajectory.d.ts.map +0 -1
- package/dist/evaluation/agents/trajectory.js +0 -130
- package/dist/evaluation/agents/trajectory.js.map +0 -1
- package/dist/evaluation/base.cjs +0 -169
- package/dist/evaluation/base.cjs.map +0 -1
- package/dist/evaluation/base.d.cts +0 -240
- package/dist/evaluation/base.d.cts.map +0 -1
- package/dist/evaluation/base.d.ts +0 -240
- package/dist/evaluation/base.d.ts.map +0 -1
- package/dist/evaluation/base.js +0 -164
- package/dist/evaluation/base.js.map +0 -1
- package/dist/evaluation/comparison/index.cjs +0 -1
- package/dist/evaluation/comparison/index.js +0 -1
- package/dist/evaluation/comparison/pairwise.cjs +0 -178
- package/dist/evaluation/comparison/pairwise.cjs.map +0 -1
- package/dist/evaluation/comparison/pairwise.d.cts +0 -56
- package/dist/evaluation/comparison/pairwise.d.cts.map +0 -1
- package/dist/evaluation/comparison/pairwise.d.ts +0 -56
- package/dist/evaluation/comparison/pairwise.d.ts.map +0 -1
- package/dist/evaluation/comparison/pairwise.js +0 -175
- package/dist/evaluation/comparison/pairwise.js.map +0 -1
- package/dist/evaluation/comparison/prompt.cjs +0 -77
- package/dist/evaluation/comparison/prompt.cjs.map +0 -1
- package/dist/evaluation/comparison/prompt.js +0 -75
- package/dist/evaluation/comparison/prompt.js.map +0 -1
- package/dist/evaluation/criteria/criteria.cjs +0 -164
- package/dist/evaluation/criteria/criteria.cjs.map +0 -1
- package/dist/evaluation/criteria/criteria.d.cts +0 -85
- package/dist/evaluation/criteria/criteria.d.cts.map +0 -1
- package/dist/evaluation/criteria/criteria.d.ts +0 -85
- package/dist/evaluation/criteria/criteria.d.ts.map +0 -1
- package/dist/evaluation/criteria/criteria.js +0 -161
- package/dist/evaluation/criteria/criteria.js.map +0 -1
- package/dist/evaluation/criteria/index.cjs +0 -1
- package/dist/evaluation/criteria/index.js +0 -1
- package/dist/evaluation/criteria/prompt.cjs +0 -50
- package/dist/evaluation/criteria/prompt.cjs.map +0 -1
- package/dist/evaluation/criteria/prompt.js +0 -48
- package/dist/evaluation/criteria/prompt.js.map +0 -1
- package/dist/evaluation/embedding_distance/base.cjs +0 -108
- package/dist/evaluation/embedding_distance/base.cjs.map +0 -1
- package/dist/evaluation/embedding_distance/base.d.cts +0 -82
- package/dist/evaluation/embedding_distance/base.d.cts.map +0 -1
- package/dist/evaluation/embedding_distance/base.d.ts +0 -82
- package/dist/evaluation/embedding_distance/base.d.ts.map +0 -1
- package/dist/evaluation/embedding_distance/base.js +0 -105
- package/dist/evaluation/embedding_distance/base.js.map +0 -1
- package/dist/evaluation/embedding_distance/index.cjs +0 -1
- package/dist/evaluation/embedding_distance/index.js +0 -1
- package/dist/evaluation/index.cjs +0 -54
- package/dist/evaluation/index.cjs.map +0 -1
- package/dist/evaluation/index.d.cts +0 -8
- package/dist/evaluation/index.d.ts +0 -8
- package/dist/evaluation/index.js +0 -35
- package/dist/evaluation/index.js.map +0 -1
- package/dist/evaluation/loader.cjs +0 -57
- package/dist/evaluation/loader.cjs.map +0 -1
- package/dist/evaluation/loader.d.cts +0 -38
- package/dist/evaluation/loader.d.cts.map +0 -1
- package/dist/evaluation/loader.d.ts +0 -38
- package/dist/evaluation/loader.d.ts.map +0 -1
- package/dist/evaluation/loader.js +0 -56
- package/dist/evaluation/loader.js.map +0 -1
- package/dist/evaluation/qa/eval_chain.cjs +0 -41
- package/dist/evaluation/qa/eval_chain.cjs.map +0 -1
- package/dist/evaluation/qa/eval_chain.d.cts +0 -22
- package/dist/evaluation/qa/eval_chain.d.cts.map +0 -1
- package/dist/evaluation/qa/eval_chain.d.ts +0 -22
- package/dist/evaluation/qa/eval_chain.d.ts.map +0 -1
- package/dist/evaluation/qa/eval_chain.js +0 -41
- package/dist/evaluation/qa/eval_chain.js.map +0 -1
- package/dist/evaluation/qa/index.cjs +0 -1
- package/dist/evaluation/qa/index.js +0 -1
- package/dist/evaluation/qa/prompt.cjs +0 -31
- package/dist/evaluation/qa/prompt.cjs.map +0 -1
- package/dist/evaluation/qa/prompt.js +0 -30
- package/dist/evaluation/qa/prompt.js.map +0 -1
- package/dist/evaluation/types.d.cts +0 -40
- package/dist/evaluation/types.d.cts.map +0 -1
- package/dist/evaluation/types.d.ts +0 -40
- package/dist/evaluation/types.d.ts.map +0 -1
- package/dist/langchain-core/dist/load/map_keys.d.cts +0 -10
- package/dist/langchain-core/dist/load/map_keys.d.cts.map +0 -1
- package/dist/langchain-core/dist/load/serializable.d.cts +0 -82
- package/dist/langchain-core/dist/load/serializable.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/base.d.cts +0 -125
- package/dist/langchain-core/dist/messages/base.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/content/base.d.cts +0 -22
- package/dist/langchain-core/dist/messages/content/base.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/content/data.d.cts +0 -96
- package/dist/langchain-core/dist/messages/content/data.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/content/index.d.cts +0 -121
- package/dist/langchain-core/dist/messages/content/index.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/content/multimodal.d.cts +0 -110
- package/dist/langchain-core/dist/messages/content/multimodal.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/content/tools.d.cts +0 -214
- package/dist/langchain-core/dist/messages/content/tools.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/message.d.cts +0 -598
- package/dist/langchain-core/dist/messages/message.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/metadata.d.cts +0 -97
- package/dist/langchain-core/dist/messages/metadata.d.cts.map +0 -1
- package/dist/langchain-core/dist/messages/utils.d.cts +0 -75
- package/dist/langchain-core/dist/messages/utils.d.cts.map +0 -1
- package/dist/langchain-core/dist/prompt_values.d.cts +0 -13
- package/dist/langchain-core/dist/prompt_values.d.cts.map +0 -1
- package/dist/langchain-core/dist/utils/types/index.d.cts +0 -8
- package/dist/langchain-core/dist/utils/types/index.d.cts.map +0 -1
- package/dist/libs/langchain-core/dist/load/map_keys.d.ts +0 -10
- package/dist/libs/langchain-core/dist/load/map_keys.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/load/serializable.d.ts +0 -82
- package/dist/libs/langchain-core/dist/load/serializable.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/base.d.ts +0 -125
- package/dist/libs/langchain-core/dist/messages/base.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/content/base.d.ts +0 -22
- package/dist/libs/langchain-core/dist/messages/content/base.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/content/data.d.ts +0 -96
- package/dist/libs/langchain-core/dist/messages/content/data.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/content/index.d.ts +0 -121
- package/dist/libs/langchain-core/dist/messages/content/index.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/content/multimodal.d.ts +0 -110
- package/dist/libs/langchain-core/dist/messages/content/multimodal.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/content/tools.d.ts +0 -214
- package/dist/libs/langchain-core/dist/messages/content/tools.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/message.d.ts +0 -598
- package/dist/libs/langchain-core/dist/messages/message.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/metadata.d.ts +0 -97
- package/dist/libs/langchain-core/dist/messages/metadata.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/messages/utils.d.ts +0 -75
- package/dist/libs/langchain-core/dist/messages/utils.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/prompt_values.d.ts +0 -13
- package/dist/libs/langchain-core/dist/prompt_values.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/utils/types/index.d.ts +0 -10
- package/dist/libs/langchain-core/dist/utils/types/index.d.ts.map +0 -1
- package/dist/libs/langchain-core/dist/utils/types/zod.d.ts +0 -1
- package/dist/load/map_keys.d.cts +0 -8
- package/dist/load/map_keys.d.cts.map +0 -1
- package/dist/load/map_keys.d.ts +0 -8
- package/dist/load/map_keys.d.ts.map +0 -1
- package/dist/load/serializable.d.cts.map +0 -1
- package/dist/load/serializable.d.ts.map +0 -1
- package/dist/memory/buffer_memory.cjs +0 -80
- package/dist/memory/buffer_memory.cjs.map +0 -1
- package/dist/memory/buffer_memory.d.cts +0 -67
- package/dist/memory/buffer_memory.d.cts.map +0 -1
- package/dist/memory/buffer_memory.d.ts +0 -67
- package/dist/memory/buffer_memory.d.ts.map +0 -1
- package/dist/memory/buffer_memory.js +0 -79
- package/dist/memory/buffer_memory.js.map +0 -1
- package/dist/memory/buffer_token_memory.cjs +0 -80
- package/dist/memory/buffer_token_memory.cjs.map +0 -1
- package/dist/memory/buffer_token_memory.d.cts +0 -67
- package/dist/memory/buffer_token_memory.d.cts.map +0 -1
- package/dist/memory/buffer_token_memory.d.ts +0 -67
- package/dist/memory/buffer_token_memory.d.ts.map +0 -1
- package/dist/memory/buffer_token_memory.js +0 -79
- package/dist/memory/buffer_token_memory.js.map +0 -1
- package/dist/memory/buffer_window_memory.cjs +0 -77
- package/dist/memory/buffer_window_memory.cjs.map +0 -1
- package/dist/memory/buffer_window_memory.d.cts +0 -64
- package/dist/memory/buffer_window_memory.d.cts.map +0 -1
- package/dist/memory/buffer_window_memory.d.ts +0 -64
- package/dist/memory/buffer_window_memory.d.ts.map +0 -1
- package/dist/memory/buffer_window_memory.js +0 -76
- package/dist/memory/buffer_window_memory.js.map +0 -1
- package/dist/memory/chat_memory.cjs +0 -53
- package/dist/memory/chat_memory.cjs.map +0 -1
- package/dist/memory/chat_memory.d.cts +0 -42
- package/dist/memory/chat_memory.d.cts.map +0 -1
- package/dist/memory/chat_memory.d.ts +0 -42
- package/dist/memory/chat_memory.d.ts.map +0 -1
- package/dist/memory/chat_memory.js +0 -47
- package/dist/memory/chat_memory.js.map +0 -1
- package/dist/memory/combined_memory.cjs +0 -88
- package/dist/memory/combined_memory.cjs.map +0 -1
- package/dist/memory/combined_memory.d.cts +0 -60
- package/dist/memory/combined_memory.d.cts.map +0 -1
- package/dist/memory/combined_memory.d.ts +0 -60
- package/dist/memory/combined_memory.d.ts.map +0 -1
- package/dist/memory/combined_memory.js +0 -88
- package/dist/memory/combined_memory.js.map +0 -1
- package/dist/memory/entity_memory.cjs +0 -144
- package/dist/memory/entity_memory.cjs.map +0 -1
- package/dist/memory/entity_memory.d.cts +0 -99
- package/dist/memory/entity_memory.d.cts.map +0 -1
- package/dist/memory/entity_memory.d.ts +0 -99
- package/dist/memory/entity_memory.d.ts.map +0 -1
- package/dist/memory/entity_memory.js +0 -143
- package/dist/memory/entity_memory.js.map +0 -1
- package/dist/memory/index.cjs +0 -85
- package/dist/memory/index.cjs.map +0 -1
- package/dist/memory/index.d.cts +0 -14
- package/dist/memory/index.d.ts +0 -14
- package/dist/memory/index.js +0 -39
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/prompt.cjs +0 -124
- package/dist/memory/prompt.cjs.map +0 -1
- package/dist/memory/prompt.d.cts +0 -12
- package/dist/memory/prompt.d.cts.map +0 -1
- package/dist/memory/prompt.d.ts +0 -12
- package/dist/memory/prompt.d.ts.map +0 -1
- package/dist/memory/prompt.js +0 -120
- package/dist/memory/prompt.js.map +0 -1
- package/dist/memory/stores/entity/base.cjs +0 -13
- package/dist/memory/stores/entity/base.cjs.map +0 -1
- package/dist/memory/stores/entity/base.d.cts +0 -18
- package/dist/memory/stores/entity/base.d.cts.map +0 -1
- package/dist/memory/stores/entity/base.d.ts +0 -18
- package/dist/memory/stores/entity/base.d.ts.map +0 -1
- package/dist/memory/stores/entity/base.js +0 -12
- package/dist/memory/stores/entity/base.js.map +0 -1
- package/dist/memory/stores/entity/in_memory.cjs +0 -64
- package/dist/memory/stores/entity/in_memory.cjs.map +0 -1
- package/dist/memory/stores/entity/in_memory.js +0 -64
- package/dist/memory/stores/entity/in_memory.js.map +0 -1
- package/dist/memory/summary.cjs +0 -127
- package/dist/memory/summary.cjs.map +0 -1
- package/dist/memory/summary.d.cts +0 -101
- package/dist/memory/summary.d.cts.map +0 -1
- package/dist/memory/summary.d.ts +0 -101
- package/dist/memory/summary.d.ts.map +0 -1
- package/dist/memory/summary.js +0 -125
- package/dist/memory/summary.js.map +0 -1
- package/dist/memory/summary_buffer.cjs +0 -117
- package/dist/memory/summary_buffer.cjs.map +0 -1
- package/dist/memory/summary_buffer.d.cts +0 -90
- package/dist/memory/summary_buffer.d.cts.map +0 -1
- package/dist/memory/summary_buffer.d.ts +0 -90
- package/dist/memory/summary_buffer.d.ts.map +0 -1
- package/dist/memory/summary_buffer.js +0 -116
- package/dist/memory/summary_buffer.js.map +0 -1
- package/dist/memory/vector_store.cjs +0 -87
- package/dist/memory/vector_store.cjs.map +0 -1
- package/dist/memory/vector_store.d.cts +0 -81
- package/dist/memory/vector_store.d.cts.map +0 -1
- package/dist/memory/vector_store.d.ts +0 -81
- package/dist/memory/vector_store.d.ts.map +0 -1
- package/dist/memory/vector_store.js +0 -86
- package/dist/memory/vector_store.js.map +0 -1
- package/dist/output_parsers/combining.cjs +0 -61
- package/dist/output_parsers/combining.cjs.map +0 -1
- package/dist/output_parsers/combining.d.cts +0 -46
- package/dist/output_parsers/combining.d.cts.map +0 -1
- package/dist/output_parsers/combining.d.ts +0 -46
- package/dist/output_parsers/combining.d.ts.map +0 -1
- package/dist/output_parsers/combining.js +0 -60
- package/dist/output_parsers/combining.js.map +0 -1
- package/dist/output_parsers/datetime.cjs +0 -46
- package/dist/output_parsers/datetime.cjs.map +0 -1
- package/dist/output_parsers/datetime.d.cts +0 -33
- package/dist/output_parsers/datetime.d.cts.map +0 -1
- package/dist/output_parsers/datetime.d.ts +0 -33
- package/dist/output_parsers/datetime.d.ts.map +0 -1
- package/dist/output_parsers/datetime.js +0 -45
- package/dist/output_parsers/datetime.js.map +0 -1
- package/dist/output_parsers/expression.cjs +0 -86
- package/dist/output_parsers/expression.cjs.map +0 -1
- package/dist/output_parsers/expression.d.cts +0 -53
- package/dist/output_parsers/expression.d.cts.map +0 -1
- package/dist/output_parsers/expression.d.ts +0 -53
- package/dist/output_parsers/expression.d.ts.map +0 -1
- package/dist/output_parsers/expression.js +0 -79
- package/dist/output_parsers/expression.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs +0 -38
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js +0 -38
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/base.cjs +0 -130
- package/dist/output_parsers/expression_type_handlers/base.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/base.d.cts +0 -108
- package/dist/output_parsers/expression_type_handlers/base.d.cts.map +0 -1
- package/dist/output_parsers/expression_type_handlers/base.d.ts +0 -108
- package/dist/output_parsers/expression_type_handlers/base.d.ts.map +0 -1
- package/dist/output_parsers/expression_type_handlers/base.js +0 -129
- package/dist/output_parsers/expression_type_handlers/base.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs +0 -38
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js +0 -38
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs +0 -64
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.js +0 -64
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/factory.cjs +0 -68
- package/dist/output_parsers/expression_type_handlers/factory.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/factory.d.cts +0 -35
- package/dist/output_parsers/expression_type_handlers/factory.d.cts.map +0 -1
- package/dist/output_parsers/expression_type_handlers/factory.d.ts +0 -35
- package/dist/output_parsers/expression_type_handlers/factory.d.ts.map +0 -1
- package/dist/output_parsers/expression_type_handlers/factory.js +0 -68
- package/dist/output_parsers/expression_type_handlers/factory.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs +0 -299
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js +0 -298
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs +0 -40
- package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/identifier_handler.js +0 -40
- package/dist/output_parsers/expression_type_handlers/identifier_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs +0 -48
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.js +0 -48
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs +0 -36
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js +0 -36
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs +0 -40
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js +0 -40
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs +0 -45
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js +0 -45
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs +0 -37
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs.map +0 -1
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.js +0 -37
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.js.map +0 -1
- package/dist/output_parsers/expression_type_handlers/types.d.cts +0 -95
- package/dist/output_parsers/expression_type_handlers/types.d.cts.map +0 -1
- package/dist/output_parsers/expression_type_handlers/types.d.ts +0 -95
- package/dist/output_parsers/expression_type_handlers/types.d.ts.map +0 -1
- package/dist/output_parsers/fix.cjs +0 -92
- package/dist/output_parsers/fix.cjs.map +0 -1
- package/dist/output_parsers/fix.d.cts +0 -60
- package/dist/output_parsers/fix.d.cts.map +0 -1
- package/dist/output_parsers/fix.d.ts +0 -60
- package/dist/output_parsers/fix.d.ts.map +0 -1
- package/dist/output_parsers/fix.js +0 -91
- package/dist/output_parsers/fix.js.map +0 -1
- package/dist/output_parsers/http_response.cjs +0 -53
- package/dist/output_parsers/http_response.cjs.map +0 -1
- package/dist/output_parsers/http_response.d.cts +0 -33
- package/dist/output_parsers/http_response.d.cts.map +0 -1
- package/dist/output_parsers/http_response.d.ts +0 -33
- package/dist/output_parsers/http_response.d.ts.map +0 -1
- package/dist/output_parsers/http_response.js +0 -52
- package/dist/output_parsers/http_response.js.map +0 -1
- package/dist/output_parsers/index.cjs +0 -74
- package/dist/output_parsers/index.cjs.map +0 -1
- package/dist/output_parsers/index.d.cts +0 -11
- package/dist/output_parsers/index.d.ts +0 -11
- package/dist/output_parsers/index.js +0 -37
- package/dist/output_parsers/index.js.map +0 -1
- package/dist/output_parsers/noop.cjs +0 -43
- package/dist/output_parsers/noop.cjs.map +0 -1
- package/dist/output_parsers/noop.js +0 -42
- package/dist/output_parsers/noop.js.map +0 -1
- package/dist/output_parsers/openai_functions.cjs +0 -145
- package/dist/output_parsers/openai_functions.cjs.map +0 -1
- package/dist/output_parsers/openai_functions.d.cts +0 -85
- package/dist/output_parsers/openai_functions.d.cts.map +0 -1
- package/dist/output_parsers/openai_functions.d.ts +0 -85
- package/dist/output_parsers/openai_functions.d.ts.map +0 -1
- package/dist/output_parsers/openai_functions.js +0 -142
- package/dist/output_parsers/openai_functions.js.map +0 -1
- package/dist/output_parsers/openai_tools.cjs +0 -89
- package/dist/output_parsers/openai_tools.cjs.map +0 -1
- package/dist/output_parsers/openai_tools.d.cts +0 -69
- package/dist/output_parsers/openai_tools.d.cts.map +0 -1
- package/dist/output_parsers/openai_tools.d.ts +0 -69
- package/dist/output_parsers/openai_tools.d.ts.map +0 -1
- package/dist/output_parsers/openai_tools.js +0 -87
- package/dist/output_parsers/openai_tools.js.map +0 -1
- package/dist/output_parsers/prompts.cjs +0 -25
- package/dist/output_parsers/prompts.cjs.map +0 -1
- package/dist/output_parsers/prompts.js +0 -24
- package/dist/output_parsers/prompts.js.map +0 -1
- package/dist/output_parsers/regex.cjs +0 -74
- package/dist/output_parsers/regex.cjs.map +0 -1
- package/dist/output_parsers/regex.d.cts +0 -49
- package/dist/output_parsers/regex.d.cts.map +0 -1
- package/dist/output_parsers/regex.d.ts +0 -49
- package/dist/output_parsers/regex.d.ts.map +0 -1
- package/dist/output_parsers/regex.js +0 -73
- package/dist/output_parsers/regex.js.map +0 -1
- package/dist/output_parsers/router.cjs +0 -40
- package/dist/output_parsers/router.cjs.map +0 -1
- package/dist/output_parsers/router.d.cts +0 -36
- package/dist/output_parsers/router.d.cts.map +0 -1
- package/dist/output_parsers/router.d.ts +0 -36
- package/dist/output_parsers/router.d.ts.map +0 -1
- package/dist/output_parsers/router.js +0 -39
- package/dist/output_parsers/router.js.map +0 -1
- package/dist/output_parsers/structured.cjs +0 -164
- package/dist/output_parsers/structured.cjs.map +0 -1
- package/dist/output_parsers/structured.d.cts +0 -97
- package/dist/output_parsers/structured.d.cts.map +0 -1
- package/dist/output_parsers/structured.d.ts +0 -97
- package/dist/output_parsers/structured.d.ts.map +0 -1
- package/dist/output_parsers/structured.js +0 -161
- package/dist/output_parsers/structured.js.map +0 -1
- package/dist/retrievers/contextual_compression.cjs +0 -53
- package/dist/retrievers/contextual_compression.cjs.map +0 -1
- package/dist/retrievers/contextual_compression.d.cts +0 -42
- package/dist/retrievers/contextual_compression.d.cts.map +0 -1
- package/dist/retrievers/contextual_compression.d.ts +0 -42
- package/dist/retrievers/contextual_compression.d.ts.map +0 -1
- package/dist/retrievers/contextual_compression.js +0 -47
- package/dist/retrievers/contextual_compression.js.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract.cjs +0 -103
- package/dist/retrievers/document_compressors/chain_extract.cjs.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract.d.cts +0 -47
- package/dist/retrievers/document_compressors/chain_extract.d.cts.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract.d.ts +0 -47
- package/dist/retrievers/document_compressors/chain_extract.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract.js +0 -97
- package/dist/retrievers/document_compressors/chain_extract.js.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract_prompt.cjs +0 -16
- package/dist/retrievers/document_compressors/chain_extract_prompt.cjs.map +0 -1
- package/dist/retrievers/document_compressors/chain_extract_prompt.js +0 -15
- package/dist/retrievers/document_compressors/chain_extract_prompt.js.map +0 -1
- package/dist/retrievers/document_compressors/embeddings_filter.cjs +0 -74
- package/dist/retrievers/document_compressors/embeddings_filter.cjs.map +0 -1
- package/dist/retrievers/document_compressors/embeddings_filter.d.cts +0 -58
- package/dist/retrievers/document_compressors/embeddings_filter.d.cts.map +0 -1
- package/dist/retrievers/document_compressors/embeddings_filter.d.ts +0 -58
- package/dist/retrievers/document_compressors/embeddings_filter.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/embeddings_filter.js +0 -68
- package/dist/retrievers/document_compressors/embeddings_filter.js.map +0 -1
- package/dist/retrievers/document_compressors/index.cjs +0 -69
- package/dist/retrievers/document_compressors/index.cjs.map +0 -1
- package/dist/retrievers/document_compressors/index.d.cts +0 -61
- package/dist/retrievers/document_compressors/index.d.cts.map +0 -1
- package/dist/retrievers/document_compressors/index.d.ts +0 -61
- package/dist/retrievers/document_compressors/index.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/index.js +0 -62
- package/dist/retrievers/document_compressors/index.js.map +0 -1
- package/dist/retrievers/ensemble.cjs +0 -76
- package/dist/retrievers/ensemble.cjs.map +0 -1
- package/dist/retrievers/ensemble.d.cts +0 -39
- package/dist/retrievers/ensemble.d.cts.map +0 -1
- package/dist/retrievers/ensemble.d.ts +0 -39
- package/dist/retrievers/ensemble.d.ts.map +0 -1
- package/dist/retrievers/ensemble.js +0 -70
- package/dist/retrievers/ensemble.js.map +0 -1
- package/dist/retrievers/hyde.cjs +0 -128
- package/dist/retrievers/hyde.cjs.map +0 -1
- package/dist/retrievers/hyde.d.cts +0 -61
- package/dist/retrievers/hyde.d.cts.map +0 -1
- package/dist/retrievers/hyde.d.ts +0 -61
- package/dist/retrievers/hyde.d.ts.map +0 -1
- package/dist/retrievers/hyde.js +0 -121
- package/dist/retrievers/hyde.js.map +0 -1
- package/dist/retrievers/matryoshka_retriever.cjs +0 -116
- package/dist/retrievers/matryoshka_retriever.cjs.map +0 -1
- package/dist/retrievers/matryoshka_retriever.d.cts +0 -99
- package/dist/retrievers/matryoshka_retriever.d.cts.map +0 -1
- package/dist/retrievers/matryoshka_retriever.d.ts +0 -99
- package/dist/retrievers/matryoshka_retriever.d.ts.map +0 -1
- package/dist/retrievers/matryoshka_retriever.js +0 -110
- package/dist/retrievers/matryoshka_retriever.js.map +0 -1
- package/dist/retrievers/multi_query.cjs +0 -150
- package/dist/retrievers/multi_query.cjs.map +0 -1
- package/dist/retrievers/multi_query.d.cts +0 -59
- package/dist/retrievers/multi_query.d.cts.map +0 -1
- package/dist/retrievers/multi_query.d.ts +0 -59
- package/dist/retrievers/multi_query.d.ts.map +0 -1
- package/dist/retrievers/multi_query.js +0 -144
- package/dist/retrievers/multi_query.js.map +0 -1
- package/dist/retrievers/multi_vector.cjs +0 -67
- package/dist/retrievers/multi_vector.cjs.map +0 -1
- package/dist/retrievers/multi_vector.d.cts +0 -51
- package/dist/retrievers/multi_vector.d.cts.map +0 -1
- package/dist/retrievers/multi_vector.d.ts +0 -51
- package/dist/retrievers/multi_vector.d.ts.map +0 -1
- package/dist/retrievers/multi_vector.js +0 -61
- package/dist/retrievers/multi_vector.js.map +0 -1
- package/dist/retrievers/parent_document.cjs +0 -137
- package/dist/retrievers/parent_document.cjs.map +0 -1
- package/dist/retrievers/parent_document.d.cts +0 -92
- package/dist/retrievers/parent_document.d.cts.map +0 -1
- package/dist/retrievers/parent_document.d.ts +0 -92
- package/dist/retrievers/parent_document.d.ts.map +0 -1
- package/dist/retrievers/parent_document.js +0 -131
- package/dist/retrievers/parent_document.js.map +0 -1
- package/dist/retrievers/score_threshold.cjs +0 -43
- package/dist/retrievers/score_threshold.cjs.map +0 -1
- package/dist/retrievers/score_threshold.d.cts +0 -20
- package/dist/retrievers/score_threshold.d.cts.map +0 -1
- package/dist/retrievers/score_threshold.d.ts +0 -20
- package/dist/retrievers/score_threshold.d.ts.map +0 -1
- package/dist/retrievers/score_threshold.js +0 -37
- package/dist/retrievers/score_threshold.js.map +0 -1
- package/dist/retrievers/self_query/functional.cjs +0 -21
- package/dist/retrievers/self_query/functional.cjs.map +0 -1
- package/dist/retrievers/self_query/functional.d.cts +0 -2
- package/dist/retrievers/self_query/functional.d.ts +0 -2
- package/dist/retrievers/self_query/functional.js +0 -10
- package/dist/retrievers/self_query/functional.js.map +0 -1
- package/dist/retrievers/self_query/index.cjs +0 -130
- package/dist/retrievers/self_query/index.cjs.map +0 -1
- package/dist/retrievers/self_query/index.d.cts +0 -79
- package/dist/retrievers/self_query/index.d.cts.map +0 -1
- package/dist/retrievers/self_query/index.d.ts +0 -79
- package/dist/retrievers/self_query/index.d.ts.map +0 -1
- package/dist/retrievers/self_query/index.js +0 -106
- package/dist/retrievers/self_query/index.js.map +0 -1
- package/dist/retrievers/time_weighted.cjs +0 -236
- package/dist/retrievers/time_weighted.cjs.map +0 -1
- package/dist/retrievers/time_weighted.d.cts +0 -142
- package/dist/retrievers/time_weighted.d.cts.map +0 -1
- package/dist/retrievers/time_weighted.d.ts +0 -142
- package/dist/retrievers/time_weighted.d.ts.map +0 -1
- package/dist/retrievers/time_weighted.js +0 -228
- package/dist/retrievers/time_weighted.js.map +0 -1
- package/dist/sql_db.cjs +0 -119
- package/dist/sql_db.cjs.map +0 -1
- package/dist/sql_db.d.cts +0 -60
- package/dist/sql_db.d.cts.map +0 -1
- package/dist/sql_db.d.ts +0 -60
- package/dist/sql_db.d.ts.map +0 -1
- package/dist/sql_db.js +0 -113
- package/dist/sql_db.js.map +0 -1
- package/dist/stores/doc/base.cjs +0 -20
- package/dist/stores/doc/base.cjs.map +0 -1
- package/dist/stores/doc/base.d.cts +0 -15
- package/dist/stores/doc/base.d.cts.map +0 -1
- package/dist/stores/doc/base.d.ts +0 -15
- package/dist/stores/doc/base.d.ts.map +0 -1
- package/dist/stores/doc/base.js +0 -14
- package/dist/stores/doc/base.js.map +0 -1
- package/dist/stores/doc/in_memory.cjs +0 -94
- package/dist/stores/doc/in_memory.cjs.map +0 -1
- package/dist/stores/doc/in_memory.d.cts +0 -53
- package/dist/stores/doc/in_memory.d.cts.map +0 -1
- package/dist/stores/doc/in_memory.d.ts +0 -53
- package/dist/stores/doc/in_memory.d.ts.map +0 -1
- package/dist/stores/doc/in_memory.js +0 -87
- package/dist/stores/doc/in_memory.js.map +0 -1
- package/dist/stores/file/base.cjs +0 -13
- package/dist/stores/file/base.cjs.map +0 -1
- package/dist/stores/file/base.d.cts +0 -15
- package/dist/stores/file/base.d.cts.map +0 -1
- package/dist/stores/file/base.d.ts +0 -15
- package/dist/stores/file/base.d.ts.map +0 -1
- package/dist/stores/file/base.js +0 -12
- package/dist/stores/file/base.js.map +0 -1
- package/dist/stores/file/in_memory.cjs +0 -53
- package/dist/stores/file/in_memory.cjs.map +0 -1
- package/dist/stores/file/in_memory.d.cts +0 -33
- package/dist/stores/file/in_memory.d.cts.map +0 -1
- package/dist/stores/file/in_memory.d.ts +0 -33
- package/dist/stores/file/in_memory.d.ts.map +0 -1
- package/dist/stores/file/in_memory.js +0 -47
- package/dist/stores/file/in_memory.js.map +0 -1
- package/dist/stores/file/node.cjs +0 -52
- package/dist/stores/file/node.cjs.map +0 -1
- package/dist/stores/file/node.d.cts +0 -29
- package/dist/stores/file/node.d.cts.map +0 -1
- package/dist/stores/file/node.d.ts +0 -29
- package/dist/stores/file/node.d.ts.map +0 -1
- package/dist/stores/file/node.js +0 -46
- package/dist/stores/file/node.js.map +0 -1
- package/dist/stores/message/in_memory.cjs +0 -21
- package/dist/stores/message/in_memory.cjs.map +0 -1
- package/dist/stores/message/in_memory.d.cts +0 -2
- package/dist/stores/message/in_memory.d.ts +0 -2
- package/dist/stores/message/in_memory.js +0 -10
- package/dist/stores/message/in_memory.js.map +0 -1
- package/dist/text_splitter.cjs +0 -22
- package/dist/text_splitter.cjs.map +0 -1
- package/dist/text_splitter.d.cts +0 -1
- package/dist/text_splitter.d.ts +0 -1
- package/dist/text_splitter.js +0 -12
- package/dist/text_splitter.js.map +0 -1
- package/dist/tools/chain.cjs +0 -36
- package/dist/tools/chain.cjs.map +0 -1
- package/dist/tools/chain.d.cts +0 -32
- package/dist/tools/chain.d.cts.map +0 -1
- package/dist/tools/chain.d.ts +0 -32
- package/dist/tools/chain.d.ts.map +0 -1
- package/dist/tools/chain.js +0 -30
- package/dist/tools/chain.js.map +0 -1
- package/dist/tools/fs.cjs +0 -56
- package/dist/tools/fs.cjs.map +0 -1
- package/dist/tools/fs.d.cts +0 -92
- package/dist/tools/fs.d.cts.map +0 -1
- package/dist/tools/fs.d.ts +0 -92
- package/dist/tools/fs.d.ts.map +0 -1
- package/dist/tools/fs.js +0 -54
- package/dist/tools/fs.js.map +0 -1
- package/dist/tools/index.cjs +0 -68
- package/dist/tools/index.cjs.map +0 -1
- package/dist/tools/index.d.cts +0 -8
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.js +0 -30
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/json.cjs +0 -107
- package/dist/tools/json.cjs.map +0 -1
- package/dist/tools/json.d.cts +0 -65
- package/dist/tools/json.d.cts.map +0 -1
- package/dist/tools/json.d.ts +0 -65
- package/dist/tools/json.d.ts.map +0 -1
- package/dist/tools/json.js +0 -104
- package/dist/tools/json.js.map +0 -1
- package/dist/tools/render.cjs +0 -55
- package/dist/tools/render.cjs.map +0 -1
- package/dist/tools/render.d.cts +0 -32
- package/dist/tools/render.d.cts.map +0 -1
- package/dist/tools/render.d.ts +0 -32
- package/dist/tools/render.d.ts.map +0 -1
- package/dist/tools/render.js +0 -48
- package/dist/tools/render.js.map +0 -1
- package/dist/tools/requests.cjs +0 -73
- package/dist/tools/requests.cjs.map +0 -1
- package/dist/tools/requests.d.cts +0 -56
- package/dist/tools/requests.d.cts.map +0 -1
- package/dist/tools/requests.d.ts +0 -56
- package/dist/tools/requests.d.ts.map +0 -1
- package/dist/tools/requests.js +0 -71
- package/dist/tools/requests.js.map +0 -1
- package/dist/tools/retriever.cjs +0 -30
- package/dist/tools/retriever.cjs.map +0 -1
- package/dist/tools/retriever.d.cts +0 -19
- package/dist/tools/retriever.d.cts.map +0 -1
- package/dist/tools/retriever.d.ts +0 -19
- package/dist/tools/retriever.d.ts.map +0 -1
- package/dist/tools/retriever.js +0 -24
- package/dist/tools/retriever.js.map +0 -1
- package/dist/tools/sql.cjs +0 -165
- package/dist/tools/sql.cjs.map +0 -1
- package/dist/tools/sql.d.cts +0 -86
- package/dist/tools/sql.d.cts.map +0 -1
- package/dist/tools/sql.d.ts +0 -86
- package/dist/tools/sql.d.ts.map +0 -1
- package/dist/tools/sql.js +0 -156
- package/dist/tools/sql.js.map +0 -1
- package/dist/tools/vectorstore.cjs +0 -45
- package/dist/tools/vectorstore.cjs.map +0 -1
- package/dist/tools/vectorstore.d.cts +0 -40
- package/dist/tools/vectorstore.d.cts.map +0 -1
- package/dist/tools/vectorstore.d.ts +0 -40
- package/dist/tools/vectorstore.d.ts.map +0 -1
- package/dist/tools/vectorstore.js +0 -44
- package/dist/tools/vectorstore.js.map +0 -1
- package/dist/tools/webbrowser.cjs +0 -176
- package/dist/tools/webbrowser.cjs.map +0 -1
- package/dist/tools/webbrowser.d.cts +0 -69
- package/dist/tools/webbrowser.d.cts.map +0 -1
- package/dist/tools/webbrowser.d.ts +0 -69
- package/dist/tools/webbrowser.d.ts.map +0 -1
- package/dist/tools/webbrowser.js +0 -168
- package/dist/tools/webbrowser.js.map +0 -1
- package/dist/types/expression-parser.d.cts +0 -91
- package/dist/types/expression-parser.d.cts.map +0 -1
- package/dist/types/expression-parser.d.ts +0 -91
- package/dist/types/expression-parser.d.ts.map +0 -1
- package/dist/types/type-utils.d.cts +0 -7
- package/dist/types/type-utils.d.cts.map +0 -1
- package/dist/types/type-utils.d.ts +0 -7
- package/dist/types/type-utils.d.ts.map +0 -1
- package/dist/util/document.cjs +0 -23
- package/dist/util/document.cjs.map +0 -1
- package/dist/util/document.d.cts +0 -15
- package/dist/util/document.d.cts.map +0 -1
- package/dist/util/document.d.ts +0 -15
- package/dist/util/document.d.ts.map +0 -1
- package/dist/util/document.js +0 -17
- package/dist/util/document.js.map +0 -1
- package/dist/util/entrypoint_deprecation.cjs +0 -1
- package/dist/util/entrypoint_deprecation.js +0 -1
- package/dist/util/env.cjs +0 -2
- package/dist/util/env.js +0 -1
- package/dist/util/extname.cjs +0 -7
- package/dist/util/extname.cjs.map +0 -1
- package/dist/util/extname.js +0 -6
- package/dist/util/extname.js.map +0 -1
- package/dist/util/hub.cjs +0 -39
- package/dist/util/hub.cjs.map +0 -1
- package/dist/util/hub.js +0 -38
- package/dist/util/hub.js.map +0 -1
- package/dist/util/load.cjs +0 -15
- package/dist/util/load.cjs.map +0 -1
- package/dist/util/load.d.cts +0 -6
- package/dist/util/load.d.cts.map +0 -1
- package/dist/util/load.d.ts +0 -6
- package/dist/util/load.d.ts.map +0 -1
- package/dist/util/load.js +0 -14
- package/dist/util/load.js.map +0 -1
- package/dist/util/math.cjs +0 -22
- package/dist/util/math.cjs.map +0 -1
- package/dist/util/math.d.cts +0 -1
- package/dist/util/math.d.ts +0 -1
- package/dist/util/math.js +0 -12
- package/dist/util/math.js.map +0 -1
- package/dist/util/ml-distance/distances.cjs +0 -35
- package/dist/util/ml-distance/distances.cjs.map +0 -1
- package/dist/util/ml-distance/distances.js +0 -33
- package/dist/util/ml-distance/distances.js.map +0 -1
- package/dist/util/ml-distance/similarities.cjs +0 -23
- package/dist/util/ml-distance/similarities.cjs.map +0 -1
- package/dist/util/ml-distance/similarities.d.cts +0 -11
- package/dist/util/ml-distance/similarities.d.cts.map +0 -1
- package/dist/util/ml-distance/similarities.d.ts +0 -11
- package/dist/util/ml-distance/similarities.d.ts.map +0 -1
- package/dist/util/ml-distance/similarities.js +0 -22
- package/dist/util/ml-distance/similarities.js.map +0 -1
- package/dist/util/ml-distance-euclidean/euclidean.cjs +0 -14
- package/dist/util/ml-distance-euclidean/euclidean.cjs.map +0 -1
- package/dist/util/ml-distance-euclidean/euclidean.js +0 -13
- package/dist/util/ml-distance-euclidean/euclidean.js.map +0 -1
- package/dist/util/openapi.cjs +0 -149
- package/dist/util/openapi.cjs.map +0 -1
- package/dist/util/openapi.d.cts +0 -83
- package/dist/util/openapi.d.cts.map +0 -1
- package/dist/util/openapi.d.ts +0 -83
- package/dist/util/openapi.d.ts.map +0 -1
- package/dist/util/openapi.js +0 -148
- package/dist/util/openapi.js.map +0 -1
- package/dist/util/parse.cjs +0 -22
- package/dist/util/parse.cjs.map +0 -1
- package/dist/util/parse.js +0 -21
- package/dist/util/parse.js.map +0 -1
- package/dist/util/set.cjs +0 -35
- package/dist/util/set.cjs.map +0 -1
- package/dist/util/set.js +0 -32
- package/dist/util/set.js.map +0 -1
- package/dist/util/sql_utils.cjs +0 -178
- package/dist/util/sql_utils.cjs.map +0 -1
- package/dist/util/sql_utils.d.cts +0 -31
- package/dist/util/sql_utils.d.cts.map +0 -1
- package/dist/util/sql_utils.d.ts +0 -31
- package/dist/util/sql_utils.d.ts.map +0 -1
- package/dist/util/sql_utils.js +0 -173
- package/dist/util/sql_utils.js.map +0 -1
- package/dist/util/time.cjs +0 -25
- package/dist/util/time.cjs.map +0 -1
- package/dist/util/time.d.cts +0 -10
- package/dist/util/time.d.cts.map +0 -1
- package/dist/util/time.d.ts +0 -10
- package/dist/util/time.d.ts.map +0 -1
- package/dist/util/time.js +0 -19
- package/dist/util/time.js.map +0 -1
- package/dist/vectorstores/memory.cjs +0 -265
- package/dist/vectorstores/memory.cjs.map +0 -1
- package/dist/vectorstores/memory.d.cts +0 -216
- package/dist/vectorstores/memory.d.cts.map +0 -1
- package/dist/vectorstores/memory.d.ts +0 -216
- package/dist/vectorstores/memory.d.ts.map +0 -1
- package/dist/vectorstores/memory.js +0 -259
- package/dist/vectorstores/memory.js.map +0 -1
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_llm_chain = require('../chains/llm_chain.cjs');
|
|
3
|
-
const require_memory_chat_memory = require('./chat_memory.cjs');
|
|
4
|
-
const require_prompt = require('./prompt.cjs');
|
|
5
|
-
const require_in_memory = require('./stores/entity/in_memory.cjs');
|
|
6
|
-
const __langchain_core_messages = require_rolldown_runtime.__toESM(require("@langchain/core/messages"));
|
|
7
|
-
const __langchain_core_memory = require_rolldown_runtime.__toESM(require("@langchain/core/memory"));
|
|
8
|
-
|
|
9
|
-
//#region src/memory/entity_memory.ts
|
|
10
|
-
/**
|
|
11
|
-
* Class for managing entity extraction and summarization to memory in
|
|
12
|
-
* chatbot applications. Extends the BaseChatMemory class and implements
|
|
13
|
-
* the EntityMemoryInput interface.
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const memory = new EntityMemory({
|
|
17
|
-
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
18
|
-
* chatHistoryKey: "history",
|
|
19
|
-
* entitiesKey: "entities",
|
|
20
|
-
* });
|
|
21
|
-
* const model = new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.9 });
|
|
22
|
-
* const chain = new LLMChain({
|
|
23
|
-
* llm: model,
|
|
24
|
-
* prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,
|
|
25
|
-
* memory,
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* const res1 = await chain.call({ input: "Hi! I'm Jim." });
|
|
29
|
-
* console.log({
|
|
30
|
-
* res1,
|
|
31
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
* const res2 = await chain.call({
|
|
35
|
-
* input: "I work in construction. What about you?",
|
|
36
|
-
* });
|
|
37
|
-
* console.log({
|
|
38
|
-
* res2,
|
|
39
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
var EntityMemory = class extends require_memory_chat_memory.BaseChatMemory {
|
|
45
|
-
entityExtractionChain;
|
|
46
|
-
entitySummarizationChain;
|
|
47
|
-
entityStore;
|
|
48
|
-
entityCache = [];
|
|
49
|
-
k = 3;
|
|
50
|
-
chatHistoryKey = "history";
|
|
51
|
-
llm;
|
|
52
|
-
entitiesKey = "entities";
|
|
53
|
-
humanPrefix;
|
|
54
|
-
aiPrefix;
|
|
55
|
-
constructor(fields) {
|
|
56
|
-
super({
|
|
57
|
-
chatHistory: fields.chatHistory,
|
|
58
|
-
returnMessages: fields.returnMessages ?? false,
|
|
59
|
-
inputKey: fields.inputKey,
|
|
60
|
-
outputKey: fields.outputKey
|
|
61
|
-
});
|
|
62
|
-
this.llm = fields.llm;
|
|
63
|
-
this.humanPrefix = fields.humanPrefix;
|
|
64
|
-
this.aiPrefix = fields.aiPrefix;
|
|
65
|
-
this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;
|
|
66
|
-
this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;
|
|
67
|
-
this.entityExtractionChain = new require_llm_chain.LLMChain({
|
|
68
|
-
llm: this.llm,
|
|
69
|
-
prompt: fields.entityExtractionPrompt ?? require_prompt.ENTITY_EXTRACTION_PROMPT
|
|
70
|
-
});
|
|
71
|
-
this.entitySummarizationChain = new require_llm_chain.LLMChain({
|
|
72
|
-
llm: this.llm,
|
|
73
|
-
prompt: fields.entitySummarizationPrompt ?? require_prompt.ENTITY_SUMMARIZATION_PROMPT
|
|
74
|
-
});
|
|
75
|
-
this.entityStore = fields.entityStore ?? new require_in_memory.InMemoryEntityStore();
|
|
76
|
-
this.entityCache = fields.entityCache ?? this.entityCache;
|
|
77
|
-
this.k = fields.k ?? this.k;
|
|
78
|
-
}
|
|
79
|
-
get memoryKeys() {
|
|
80
|
-
return [this.chatHistoryKey];
|
|
81
|
-
}
|
|
82
|
-
get memoryVariables() {
|
|
83
|
-
return [this.entitiesKey, this.chatHistoryKey];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Method to load memory variables and perform entity extraction.
|
|
87
|
-
* @param inputs Input values for the method.
|
|
88
|
-
* @returns Promise resolving to an object containing memory variables.
|
|
89
|
-
*/
|
|
90
|
-
async loadMemoryVariables(inputs) {
|
|
91
|
-
const promptInputKey = this.inputKey ?? (0, __langchain_core_memory.getPromptInputKey)(inputs, this.memoryVariables);
|
|
92
|
-
const messages = await this.chatHistory.getMessages();
|
|
93
|
-
const serializedMessages = (0, __langchain_core_messages.getBufferString)(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
|
|
94
|
-
const output = await this.entityExtractionChain.predict({
|
|
95
|
-
history: serializedMessages,
|
|
96
|
-
input: inputs[promptInputKey]
|
|
97
|
-
});
|
|
98
|
-
const entities = output.trim() === "NONE" ? [] : output.split(",").map((w) => w.trim());
|
|
99
|
-
const entitySummaries = {};
|
|
100
|
-
for (const entity of entities) entitySummaries[entity] = await this.entityStore.get(entity, "No current information known.");
|
|
101
|
-
this.entityCache = [...entities];
|
|
102
|
-
const buffer = this.returnMessages ? messages.slice(-this.k * 2) : serializedMessages;
|
|
103
|
-
return {
|
|
104
|
-
[this.chatHistoryKey]: buffer,
|
|
105
|
-
[this.entitiesKey]: entitySummaries
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Method to save the context from a conversation to a buffer and perform
|
|
110
|
-
* entity summarization.
|
|
111
|
-
* @param inputs Input values for the method.
|
|
112
|
-
* @param outputs Output values from the method.
|
|
113
|
-
* @returns Promise resolving to void.
|
|
114
|
-
*/
|
|
115
|
-
async saveContext(inputs, outputs) {
|
|
116
|
-
await super.saveContext(inputs, outputs);
|
|
117
|
-
const promptInputKey = this.inputKey ?? (0, __langchain_core_memory.getPromptInputKey)(inputs, this.memoryVariables);
|
|
118
|
-
const messages = await this.chatHistory.getMessages();
|
|
119
|
-
const serializedMessages = (0, __langchain_core_messages.getBufferString)(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
|
|
120
|
-
const inputData = inputs[promptInputKey];
|
|
121
|
-
for (const entity of this.entityCache) {
|
|
122
|
-
const existingSummary = await this.entityStore.get(entity, "No current information known.");
|
|
123
|
-
const output = await this.entitySummarizationChain.predict({
|
|
124
|
-
summary: existingSummary,
|
|
125
|
-
entity,
|
|
126
|
-
history: serializedMessages,
|
|
127
|
-
input: inputData
|
|
128
|
-
});
|
|
129
|
-
if (output.trim() !== "UNCHANGED") await this.entityStore.set(entity, output.trim());
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Method to clear the memory contents.
|
|
134
|
-
* @returns Promise resolving to void.
|
|
135
|
-
*/
|
|
136
|
-
async clear() {
|
|
137
|
-
await super.clear();
|
|
138
|
-
await this.entityStore.clear();
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
//#endregion
|
|
143
|
-
exports.EntityMemory = EntityMemory;
|
|
144
|
-
//# sourceMappingURL=entity_memory.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity_memory.cjs","names":["BaseChatMemory","fields: EntityMemoryInput","LLMChain","ENTITY_EXTRACTION_PROMPT","ENTITY_SUMMARIZATION_PROMPT","InMemoryEntityStore","inputs: InputValues","entities: string[]","entitySummaries: { [key: string]: string | undefined }","outputs: OutputValues"],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkCA,0CAA4C;CAC5E,AAAQ;CAER,AAAQ;CAER;CAEA,cAAwB,CAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAYC,QAA2B;EACrC,MAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;EACnB,EAAC;EACF,KAAK,MAAM,OAAO;EAClB,KAAK,cAAc,OAAO;EAC1B,KAAK,WAAW,OAAO;EACvB,KAAK,iBAAiB,OAAO,kBAAkB,KAAK;EACpD,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,wBAAwB,IAAIC,2BAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0BC;EAC1C;EACD,KAAK,2BAA2B,IAAID,2BAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6BE;EAC7C;EACD,KAAK,cAAc,OAAO,eAAe,IAAIC;EAC7C,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,IAAI,OAAO,KAAK,KAAK;CAC3B;CAED,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,cAAe;CAC7B;CAGD,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,cAAe;CAC/C;;;;;;CAQD,MAAM,oBAAoBC,QAA+C;EACvE,MAAM,iBACJ,KAAK,2DAA8B,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,oEACJ,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;EACf,EAAC;EACF,MAAMC,WACJ,OAAO,MAAM,KAAK,SAAS,CAAE,IAAG,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;EACxE,MAAMC,kBAAyD,CAAE;AAEjE,OAAK,MAAM,UAAU,UACnB,gBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;EAEH,KAAK,cAAc,CAAC,GAAG,QAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;EACrB;CACF;;;;;;;;CAUD,MAAM,YAAYF,QAAqBG,SAAsC;EAC3E,MAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,2DAA8B,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,oEACJ,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;GACR,EAAC;AACF,OAAI,OAAO,MAAM,KAAK,aACpB,MAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;EAEpD;CACF;;;;;CAOD,MAAM,QAAQ;EACZ,MAAM,MAAM,OAAO;EACnB,MAAM,KAAK,YAAY,OAAO;CAC/B;AACF"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { BaseChatMemory, BaseChatMemoryInput } from "./chat_memory.cjs";
|
|
2
|
-
import { BaseEntityStore } from "./stores/entity/base.cjs";
|
|
3
|
-
import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
4
|
-
import { PromptTemplate } from "@langchain/core/prompts";
|
|
5
|
-
import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
|
|
6
|
-
|
|
7
|
-
//#region src/memory/entity_memory.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Interface for the input parameters required by the EntityMemory class.
|
|
11
|
-
*/
|
|
12
|
-
interface EntityMemoryInput extends BaseChatMemoryInput {
|
|
13
|
-
llm: BaseLanguageModelInterface;
|
|
14
|
-
humanPrefix?: string;
|
|
15
|
-
aiPrefix?: string;
|
|
16
|
-
entityExtractionPrompt?: PromptTemplate;
|
|
17
|
-
entitySummarizationPrompt?: PromptTemplate;
|
|
18
|
-
entityCache?: string[];
|
|
19
|
-
k?: number;
|
|
20
|
-
chatHistoryKey?: string;
|
|
21
|
-
entitiesKey?: string;
|
|
22
|
-
entityStore?: BaseEntityStore;
|
|
23
|
-
}
|
|
24
|
-
// Entity extractor & summarizer to memory.
|
|
25
|
-
/**
|
|
26
|
-
* Class for managing entity extraction and summarization to memory in
|
|
27
|
-
* chatbot applications. Extends the BaseChatMemory class and implements
|
|
28
|
-
* the EntityMemoryInput interface.
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const memory = new EntityMemory({
|
|
32
|
-
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
33
|
-
* chatHistoryKey: "history",
|
|
34
|
-
* entitiesKey: "entities",
|
|
35
|
-
* });
|
|
36
|
-
* const model = new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.9 });
|
|
37
|
-
* const chain = new LLMChain({
|
|
38
|
-
* llm: model,
|
|
39
|
-
* prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,
|
|
40
|
-
* memory,
|
|
41
|
-
* });
|
|
42
|
-
*
|
|
43
|
-
* const res1 = await chain.call({ input: "Hi! I'm Jim." });
|
|
44
|
-
* console.log({
|
|
45
|
-
* res1,
|
|
46
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* const res2 = await chain.call({
|
|
50
|
-
* input: "I work in construction. What about you?",
|
|
51
|
-
* });
|
|
52
|
-
* console.log({
|
|
53
|
-
* res2,
|
|
54
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
55
|
-
* });
|
|
56
|
-
*
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
declare class EntityMemory extends BaseChatMemory implements EntityMemoryInput {
|
|
60
|
-
private entityExtractionChain;
|
|
61
|
-
private entitySummarizationChain;
|
|
62
|
-
entityStore: BaseEntityStore;
|
|
63
|
-
entityCache: string[];
|
|
64
|
-
k: number;
|
|
65
|
-
chatHistoryKey: string;
|
|
66
|
-
llm: BaseLanguageModelInterface;
|
|
67
|
-
entitiesKey: string;
|
|
68
|
-
humanPrefix?: string;
|
|
69
|
-
aiPrefix?: string;
|
|
70
|
-
constructor(fields: EntityMemoryInput);
|
|
71
|
-
get memoryKeys(): string[];
|
|
72
|
-
// Will always return list of memory variables.
|
|
73
|
-
get memoryVariables(): string[];
|
|
74
|
-
// Return history buffer.
|
|
75
|
-
/**
|
|
76
|
-
* Method to load memory variables and perform entity extraction.
|
|
77
|
-
* @param inputs Input values for the method.
|
|
78
|
-
* @returns Promise resolving to an object containing memory variables.
|
|
79
|
-
*/
|
|
80
|
-
loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables>;
|
|
81
|
-
// Save context from this conversation to buffer.
|
|
82
|
-
/**
|
|
83
|
-
* Method to save the context from a conversation to a buffer and perform
|
|
84
|
-
* entity summarization.
|
|
85
|
-
* @param inputs Input values for the method.
|
|
86
|
-
* @param outputs Output values from the method.
|
|
87
|
-
* @returns Promise resolving to void.
|
|
88
|
-
*/
|
|
89
|
-
saveContext(inputs: InputValues, outputs: OutputValues): Promise<void>;
|
|
90
|
-
// Clear memory contents.
|
|
91
|
-
/**
|
|
92
|
-
* Method to clear the memory contents.
|
|
93
|
-
* @returns Promise resolving to void.
|
|
94
|
-
*/
|
|
95
|
-
clear(): Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { EntityMemory };
|
|
99
|
-
//# sourceMappingURL=entity_memory.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity_memory.d.cts","names":["BaseLanguageModelInterface","PromptTemplate","InputValues","MemoryVariables","OutputValues","BaseEntityStore","BaseChatMemory","BaseChatMemoryInput","EntityMemoryInput","EntityMemory","Promise"],"sources":["../../src/memory/entity_memory.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport declare class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain;\n private entitySummarizationChain;\n entityStore: BaseEntityStore;\n entityCache: string[];\n k: number;\n chatHistoryKey: string;\n llm: BaseLanguageModelInterface;\n entitiesKey: string;\n humanPrefix?: string;\n aiPrefix?: string;\n constructor(fields: EntityMemoryInput);\n get memoryKeys(): string[];\n // Will always return list of memory variables.\n get memoryVariables(): string[];\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables>;\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n saveContext(inputs: InputValues, outputs: OutputValues): Promise<void>;\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n clear(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;AAQA;AAAkC,UAAjBQ,iBAAAA,SAA0BD,mBAAT,CAAA;EAAA,GACzBP,EAAAA,0BAAAA;EAA0B,WAGNC,CAAAA,EAAAA,MAAAA;EAAc,QACXA,CAAAA,EAAAA,MAAAA;EAAc,sBAK5BI,CAAAA,EANWJ,cAMXI;EAAe,yBAVUE,CAAAA,EAKXN,cALWM;EAAmB,WAAA,CAAA,EAAA,MAAA,EAAA;EA+CzCE,CAAAA,CAAAA,EAAAA,MAAAA;EAAY,cAAA,CAAA,EAAA,MAAA;EAAA,WAGhBJ,CAAAA,EAAAA,MAAAA;EAAe,WAIvBL,CAAAA,EA5CSK,eA4CTL;;;;;;;;;;;AAP4E;;;;;;;;;;;;;;;;;;;;;;;;;;cAAhES,YAAAA,SAAqBH,cAAAA,YAA0BE;;;eAGnDH;;;;OAIRL;;;;sBAIeQ;;;;;;;;;;8BAUQN,cAAcQ,QAAQP;;;;;;;;;sBAS9BD,sBAAsBE,eAAeM;;;;;;WAMhDA"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { BaseChatMemory, BaseChatMemoryInput } from "./chat_memory.js";
|
|
2
|
-
import { BaseEntityStore } from "./stores/entity/base.js";
|
|
3
|
-
import { PromptTemplate } from "@langchain/core/prompts";
|
|
4
|
-
import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
5
|
-
import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
|
|
6
|
-
|
|
7
|
-
//#region src/memory/entity_memory.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Interface for the input parameters required by the EntityMemory class.
|
|
11
|
-
*/
|
|
12
|
-
interface EntityMemoryInput extends BaseChatMemoryInput {
|
|
13
|
-
llm: BaseLanguageModelInterface;
|
|
14
|
-
humanPrefix?: string;
|
|
15
|
-
aiPrefix?: string;
|
|
16
|
-
entityExtractionPrompt?: PromptTemplate;
|
|
17
|
-
entitySummarizationPrompt?: PromptTemplate;
|
|
18
|
-
entityCache?: string[];
|
|
19
|
-
k?: number;
|
|
20
|
-
chatHistoryKey?: string;
|
|
21
|
-
entitiesKey?: string;
|
|
22
|
-
entityStore?: BaseEntityStore;
|
|
23
|
-
}
|
|
24
|
-
// Entity extractor & summarizer to memory.
|
|
25
|
-
/**
|
|
26
|
-
* Class for managing entity extraction and summarization to memory in
|
|
27
|
-
* chatbot applications. Extends the BaseChatMemory class and implements
|
|
28
|
-
* the EntityMemoryInput interface.
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const memory = new EntityMemory({
|
|
32
|
-
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
33
|
-
* chatHistoryKey: "history",
|
|
34
|
-
* entitiesKey: "entities",
|
|
35
|
-
* });
|
|
36
|
-
* const model = new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.9 });
|
|
37
|
-
* const chain = new LLMChain({
|
|
38
|
-
* llm: model,
|
|
39
|
-
* prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,
|
|
40
|
-
* memory,
|
|
41
|
-
* });
|
|
42
|
-
*
|
|
43
|
-
* const res1 = await chain.call({ input: "Hi! I'm Jim." });
|
|
44
|
-
* console.log({
|
|
45
|
-
* res1,
|
|
46
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* const res2 = await chain.call({
|
|
50
|
-
* input: "I work in construction. What about you?",
|
|
51
|
-
* });
|
|
52
|
-
* console.log({
|
|
53
|
-
* res2,
|
|
54
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
55
|
-
* });
|
|
56
|
-
*
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
declare class EntityMemory extends BaseChatMemory implements EntityMemoryInput {
|
|
60
|
-
private entityExtractionChain;
|
|
61
|
-
private entitySummarizationChain;
|
|
62
|
-
entityStore: BaseEntityStore;
|
|
63
|
-
entityCache: string[];
|
|
64
|
-
k: number;
|
|
65
|
-
chatHistoryKey: string;
|
|
66
|
-
llm: BaseLanguageModelInterface;
|
|
67
|
-
entitiesKey: string;
|
|
68
|
-
humanPrefix?: string;
|
|
69
|
-
aiPrefix?: string;
|
|
70
|
-
constructor(fields: EntityMemoryInput);
|
|
71
|
-
get memoryKeys(): string[];
|
|
72
|
-
// Will always return list of memory variables.
|
|
73
|
-
get memoryVariables(): string[];
|
|
74
|
-
// Return history buffer.
|
|
75
|
-
/**
|
|
76
|
-
* Method to load memory variables and perform entity extraction.
|
|
77
|
-
* @param inputs Input values for the method.
|
|
78
|
-
* @returns Promise resolving to an object containing memory variables.
|
|
79
|
-
*/
|
|
80
|
-
loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables>;
|
|
81
|
-
// Save context from this conversation to buffer.
|
|
82
|
-
/**
|
|
83
|
-
* Method to save the context from a conversation to a buffer and perform
|
|
84
|
-
* entity summarization.
|
|
85
|
-
* @param inputs Input values for the method.
|
|
86
|
-
* @param outputs Output values from the method.
|
|
87
|
-
* @returns Promise resolving to void.
|
|
88
|
-
*/
|
|
89
|
-
saveContext(inputs: InputValues, outputs: OutputValues): Promise<void>;
|
|
90
|
-
// Clear memory contents.
|
|
91
|
-
/**
|
|
92
|
-
* Method to clear the memory contents.
|
|
93
|
-
* @returns Promise resolving to void.
|
|
94
|
-
*/
|
|
95
|
-
clear(): Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { EntityMemory };
|
|
99
|
-
//# sourceMappingURL=entity_memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity_memory.d.ts","names":["BaseLanguageModelInterface","PromptTemplate","InputValues","MemoryVariables","OutputValues","BaseEntityStore","BaseChatMemory","BaseChatMemoryInput","EntityMemoryInput","EntityMemory","Promise"],"sources":["../../src/memory/entity_memory.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport declare class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain;\n private entitySummarizationChain;\n entityStore: BaseEntityStore;\n entityCache: string[];\n k: number;\n chatHistoryKey: string;\n llm: BaseLanguageModelInterface;\n entitiesKey: string;\n humanPrefix?: string;\n aiPrefix?: string;\n constructor(fields: EntityMemoryInput);\n get memoryKeys(): string[];\n // Will always return list of memory variables.\n get memoryVariables(): string[];\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables>;\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n saveContext(inputs: InputValues, outputs: OutputValues): Promise<void>;\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n clear(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;AAQA;AAAkC,UAAjBQ,iBAAAA,SAA0BD,mBAAT,CAAA;EAAA,GACzBP,EAAAA,0BAAAA;EAA0B,WAGNC,CAAAA,EAAAA,MAAAA;EAAc,QACXA,CAAAA,EAAAA,MAAAA;EAAc,sBAK5BI,CAAAA,EANWJ,cAMXI;EAAe,yBAVUE,CAAAA,EAKXN,cALWM;EAAmB,WAAA,CAAA,EAAA,MAAA,EAAA;EA+CzCE,CAAAA,CAAAA,EAAAA,MAAAA;EAAY,cAAA,CAAA,EAAA,MAAA;EAAA,WAGhBJ,CAAAA,EAAAA,MAAAA;EAAe,WAIvBL,CAAAA,EA5CSK,eA4CTL;;;;;;;;;;;AAP4E;;;;;;;;;;;;;;;;;;;;;;;;;;cAAhES,YAAAA,SAAqBH,cAAAA,YAA0BE;;;eAGnDH;;;;OAIRL;;;;sBAIeQ;;;;;;;;;;8BAUQN,cAAcQ,QAAQP;;;;;;;;;sBAS9BD,sBAAsBE,eAAeM;;;;;;WAMhDA"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { LLMChain } from "../chains/llm_chain.js";
|
|
2
|
-
import { BaseChatMemory } from "./chat_memory.js";
|
|
3
|
-
import { ENTITY_EXTRACTION_PROMPT, ENTITY_SUMMARIZATION_PROMPT } from "./prompt.js";
|
|
4
|
-
import { InMemoryEntityStore } from "./stores/entity/in_memory.js";
|
|
5
|
-
import { getBufferString } from "@langchain/core/messages";
|
|
6
|
-
import { getPromptInputKey } from "@langchain/core/memory";
|
|
7
|
-
|
|
8
|
-
//#region src/memory/entity_memory.ts
|
|
9
|
-
/**
|
|
10
|
-
* Class for managing entity extraction and summarization to memory in
|
|
11
|
-
* chatbot applications. Extends the BaseChatMemory class and implements
|
|
12
|
-
* the EntityMemoryInput interface.
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const memory = new EntityMemory({
|
|
16
|
-
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
17
|
-
* chatHistoryKey: "history",
|
|
18
|
-
* entitiesKey: "entities",
|
|
19
|
-
* });
|
|
20
|
-
* const model = new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.9 });
|
|
21
|
-
* const chain = new LLMChain({
|
|
22
|
-
* llm: model,
|
|
23
|
-
* prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,
|
|
24
|
-
* memory,
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* const res1 = await chain.call({ input: "Hi! I'm Jim." });
|
|
28
|
-
* console.log({
|
|
29
|
-
* res1,
|
|
30
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* const res2 = await chain.call({
|
|
34
|
-
* input: "I work in construction. What about you?",
|
|
35
|
-
* });
|
|
36
|
-
* console.log({
|
|
37
|
-
* res2,
|
|
38
|
-
* memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }),
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
var EntityMemory = class extends BaseChatMemory {
|
|
44
|
-
entityExtractionChain;
|
|
45
|
-
entitySummarizationChain;
|
|
46
|
-
entityStore;
|
|
47
|
-
entityCache = [];
|
|
48
|
-
k = 3;
|
|
49
|
-
chatHistoryKey = "history";
|
|
50
|
-
llm;
|
|
51
|
-
entitiesKey = "entities";
|
|
52
|
-
humanPrefix;
|
|
53
|
-
aiPrefix;
|
|
54
|
-
constructor(fields) {
|
|
55
|
-
super({
|
|
56
|
-
chatHistory: fields.chatHistory,
|
|
57
|
-
returnMessages: fields.returnMessages ?? false,
|
|
58
|
-
inputKey: fields.inputKey,
|
|
59
|
-
outputKey: fields.outputKey
|
|
60
|
-
});
|
|
61
|
-
this.llm = fields.llm;
|
|
62
|
-
this.humanPrefix = fields.humanPrefix;
|
|
63
|
-
this.aiPrefix = fields.aiPrefix;
|
|
64
|
-
this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;
|
|
65
|
-
this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;
|
|
66
|
-
this.entityExtractionChain = new LLMChain({
|
|
67
|
-
llm: this.llm,
|
|
68
|
-
prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT
|
|
69
|
-
});
|
|
70
|
-
this.entitySummarizationChain = new LLMChain({
|
|
71
|
-
llm: this.llm,
|
|
72
|
-
prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT
|
|
73
|
-
});
|
|
74
|
-
this.entityStore = fields.entityStore ?? new InMemoryEntityStore();
|
|
75
|
-
this.entityCache = fields.entityCache ?? this.entityCache;
|
|
76
|
-
this.k = fields.k ?? this.k;
|
|
77
|
-
}
|
|
78
|
-
get memoryKeys() {
|
|
79
|
-
return [this.chatHistoryKey];
|
|
80
|
-
}
|
|
81
|
-
get memoryVariables() {
|
|
82
|
-
return [this.entitiesKey, this.chatHistoryKey];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Method to load memory variables and perform entity extraction.
|
|
86
|
-
* @param inputs Input values for the method.
|
|
87
|
-
* @returns Promise resolving to an object containing memory variables.
|
|
88
|
-
*/
|
|
89
|
-
async loadMemoryVariables(inputs) {
|
|
90
|
-
const promptInputKey = this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);
|
|
91
|
-
const messages = await this.chatHistory.getMessages();
|
|
92
|
-
const serializedMessages = getBufferString(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
|
|
93
|
-
const output = await this.entityExtractionChain.predict({
|
|
94
|
-
history: serializedMessages,
|
|
95
|
-
input: inputs[promptInputKey]
|
|
96
|
-
});
|
|
97
|
-
const entities = output.trim() === "NONE" ? [] : output.split(",").map((w) => w.trim());
|
|
98
|
-
const entitySummaries = {};
|
|
99
|
-
for (const entity of entities) entitySummaries[entity] = await this.entityStore.get(entity, "No current information known.");
|
|
100
|
-
this.entityCache = [...entities];
|
|
101
|
-
const buffer = this.returnMessages ? messages.slice(-this.k * 2) : serializedMessages;
|
|
102
|
-
return {
|
|
103
|
-
[this.chatHistoryKey]: buffer,
|
|
104
|
-
[this.entitiesKey]: entitySummaries
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Method to save the context from a conversation to a buffer and perform
|
|
109
|
-
* entity summarization.
|
|
110
|
-
* @param inputs Input values for the method.
|
|
111
|
-
* @param outputs Output values from the method.
|
|
112
|
-
* @returns Promise resolving to void.
|
|
113
|
-
*/
|
|
114
|
-
async saveContext(inputs, outputs) {
|
|
115
|
-
await super.saveContext(inputs, outputs);
|
|
116
|
-
const promptInputKey = this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);
|
|
117
|
-
const messages = await this.chatHistory.getMessages();
|
|
118
|
-
const serializedMessages = getBufferString(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
|
|
119
|
-
const inputData = inputs[promptInputKey];
|
|
120
|
-
for (const entity of this.entityCache) {
|
|
121
|
-
const existingSummary = await this.entityStore.get(entity, "No current information known.");
|
|
122
|
-
const output = await this.entitySummarizationChain.predict({
|
|
123
|
-
summary: existingSummary,
|
|
124
|
-
entity,
|
|
125
|
-
history: serializedMessages,
|
|
126
|
-
input: inputData
|
|
127
|
-
});
|
|
128
|
-
if (output.trim() !== "UNCHANGED") await this.entityStore.set(entity, output.trim());
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Method to clear the memory contents.
|
|
133
|
-
* @returns Promise resolving to void.
|
|
134
|
-
*/
|
|
135
|
-
async clear() {
|
|
136
|
-
await super.clear();
|
|
137
|
-
await this.entityStore.clear();
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
export { EntityMemory };
|
|
143
|
-
//# sourceMappingURL=entity_memory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity_memory.js","names":["fields: EntityMemoryInput","inputs: InputValues","entities: string[]","entitySummaries: { [key: string]: string | undefined }","outputs: OutputValues"],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkC,eAA4C;CAC5E,AAAQ;CAER,AAAQ;CAER;CAEA,cAAwB,CAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAYA,QAA2B;EACrC,MAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;EACnB,EAAC;EACF,KAAK,MAAM,OAAO;EAClB,KAAK,cAAc,OAAO;EAC1B,KAAK,WAAW,OAAO;EACvB,KAAK,iBAAiB,OAAO,kBAAkB,KAAK;EACpD,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,wBAAwB,IAAI,SAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0B;EAC1C;EACD,KAAK,2BAA2B,IAAI,SAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6B;EAC7C;EACD,KAAK,cAAc,OAAO,eAAe,IAAI;EAC7C,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,IAAI,OAAO,KAAK,KAAK;CAC3B;CAED,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,cAAe;CAC7B;CAGD,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,cAAe;CAC/C;;;;;;CAQD,MAAM,oBAAoBC,QAA+C;EACvE,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,qBAAqB,gBACzB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;EACf,EAAC;EACF,MAAMC,WACJ,OAAO,MAAM,KAAK,SAAS,CAAE,IAAG,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;EACxE,MAAMC,kBAAyD,CAAE;AAEjE,OAAK,MAAM,UAAU,UACnB,gBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;EAEH,KAAK,cAAc,CAAC,GAAG,QAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;EACrB;CACF;;;;;;;;CAUD,MAAM,YAAYF,QAAqBG,SAAsC;EAC3E,MAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,qBAAqB,gBACzB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;GACR,EAAC;AACF,OAAI,OAAO,MAAM,KAAK,aACpB,MAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;EAEpD;CACF;;;;;CAOD,MAAM,QAAQ;EACZ,MAAM,MAAM,OAAO;EACnB,MAAM,KAAK,YAAY,OAAO;CAC/B;AACF"}
|
package/dist/memory/index.cjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_memory_chat_memory = require('./chat_memory.cjs');
|
|
3
|
-
const require_buffer_memory = require('./buffer_memory.cjs');
|
|
4
|
-
const require_prompt = require('./prompt.cjs');
|
|
5
|
-
const require_summary = require('./summary.cjs');
|
|
6
|
-
const require_buffer_window_memory = require('./buffer_window_memory.cjs');
|
|
7
|
-
const require_vector_store = require('./vector_store.cjs');
|
|
8
|
-
const require_entity_memory = require('./entity_memory.cjs');
|
|
9
|
-
const require_combined_memory = require('./combined_memory.cjs');
|
|
10
|
-
const require_summary_buffer = require('./summary_buffer.cjs');
|
|
11
|
-
const require_buffer_token_memory = require('./buffer_token_memory.cjs');
|
|
12
|
-
const __langchain_core_messages = require_rolldown_runtime.__toESM(require("@langchain/core/messages"));
|
|
13
|
-
const __langchain_core_chat_history = require_rolldown_runtime.__toESM(require("@langchain/core/chat_history"));
|
|
14
|
-
const __langchain_core_memory = require_rolldown_runtime.__toESM(require("@langchain/core/memory"));
|
|
15
|
-
|
|
16
|
-
//#region src/memory/index.ts
|
|
17
|
-
var memory_exports = {};
|
|
18
|
-
require_rolldown_runtime.__export(memory_exports, {
|
|
19
|
-
BaseChatMemory: () => require_memory_chat_memory.BaseChatMemory,
|
|
20
|
-
BaseConversationSummaryMemory: () => require_summary.BaseConversationSummaryMemory,
|
|
21
|
-
BaseMemory: () => __langchain_core_memory.BaseMemory,
|
|
22
|
-
BufferMemory: () => require_buffer_memory.BufferMemory,
|
|
23
|
-
BufferWindowMemory: () => require_buffer_window_memory.BufferWindowMemory,
|
|
24
|
-
ChatMessageHistory: () => __langchain_core_chat_history.InMemoryChatMessageHistory,
|
|
25
|
-
CombinedMemory: () => require_combined_memory.CombinedMemory,
|
|
26
|
-
ConversationSummaryBufferMemory: () => require_summary_buffer.ConversationSummaryBufferMemory,
|
|
27
|
-
ConversationSummaryMemory: () => require_summary.ConversationSummaryMemory,
|
|
28
|
-
ConversationTokenBufferMemory: () => require_buffer_token_memory.ConversationTokenBufferMemory,
|
|
29
|
-
ENTITY_MEMORY_CONVERSATION_TEMPLATE: () => require_prompt.ENTITY_MEMORY_CONVERSATION_TEMPLATE,
|
|
30
|
-
EntityMemory: () => require_entity_memory.EntityMemory,
|
|
31
|
-
VectorStoreRetrieverMemory: () => require_vector_store.VectorStoreRetrieverMemory,
|
|
32
|
-
getBufferString: () => __langchain_core_messages.getBufferString,
|
|
33
|
-
getInputValue: () => __langchain_core_memory.getInputValue,
|
|
34
|
-
getOutputValue: () => __langchain_core_memory.getOutputValue
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
exports.BaseChatMemory = require_memory_chat_memory.BaseChatMemory;
|
|
39
|
-
exports.BaseConversationSummaryMemory = require_summary.BaseConversationSummaryMemory;
|
|
40
|
-
Object.defineProperty(exports, 'BaseMemory', {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () {
|
|
43
|
-
return __langchain_core_memory.BaseMemory;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
exports.BufferMemory = require_buffer_memory.BufferMemory;
|
|
47
|
-
exports.BufferWindowMemory = require_buffer_window_memory.BufferWindowMemory;
|
|
48
|
-
Object.defineProperty(exports, 'ChatMessageHistory', {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return __langchain_core_chat_history.InMemoryChatMessageHistory;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
exports.CombinedMemory = require_combined_memory.CombinedMemory;
|
|
55
|
-
exports.ConversationSummaryBufferMemory = require_summary_buffer.ConversationSummaryBufferMemory;
|
|
56
|
-
exports.ConversationSummaryMemory = require_summary.ConversationSummaryMemory;
|
|
57
|
-
exports.ConversationTokenBufferMemory = require_buffer_token_memory.ConversationTokenBufferMemory;
|
|
58
|
-
exports.ENTITY_MEMORY_CONVERSATION_TEMPLATE = require_prompt.ENTITY_MEMORY_CONVERSATION_TEMPLATE;
|
|
59
|
-
exports.EntityMemory = require_entity_memory.EntityMemory;
|
|
60
|
-
exports.VectorStoreRetrieverMemory = require_vector_store.VectorStoreRetrieverMemory;
|
|
61
|
-
Object.defineProperty(exports, 'getBufferString', {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () {
|
|
64
|
-
return __langchain_core_messages.getBufferString;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, 'getInputValue', {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () {
|
|
70
|
-
return __langchain_core_memory.getInputValue;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, 'getOutputValue', {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return __langchain_core_memory.getOutputValue;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, 'memory_exports', {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () {
|
|
82
|
-
return memory_exports;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/memory/index.ts"],"sourcesContent":["export {\n getInputValue,\n getOutputValue,\n BaseMemory,\n type InputValues,\n type OutputValues,\n type MemoryVariables,\n} from \"@langchain/core/memory\";\nexport { getBufferString } from \"@langchain/core/messages\";\nexport { InMemoryChatMessageHistory as ChatMessageHistory } from \"@langchain/core/chat_history\";\n\nexport { BufferMemory, type BufferMemoryInput } from \"./buffer_memory.js\";\nexport {\n ConversationSummaryMemory,\n type ConversationSummaryMemoryInput,\n BaseConversationSummaryMemory,\n type BaseConversationSummaryMemoryInput,\n} from \"./summary.js\";\nexport {\n BufferWindowMemory,\n type BufferWindowMemoryInput,\n} from \"./buffer_window_memory.js\";\nexport { BaseChatMemory, type BaseChatMemoryInput } from \"./chat_memory.js\";\nexport {\n VectorStoreRetrieverMemory,\n type VectorStoreRetrieverMemoryParams,\n} from \"./vector_store.js\";\nexport { EntityMemory } from \"./entity_memory.js\";\nexport { ENTITY_MEMORY_CONVERSATION_TEMPLATE } from \"./prompt.js\";\nexport { type CombinedMemoryInput, CombinedMemory } from \"./combined_memory.js\";\nexport {\n ConversationSummaryBufferMemory,\n type ConversationSummaryBufferMemoryInput,\n} from \"./summary_buffer.js\";\nexport {\n ConversationTokenBufferMemory,\n type ConversationTokenBufferMemoryInput,\n} from \"./buffer_token_memory.js\";\n"],"mappings":""}
|
package/dist/memory/index.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseChatMemory, BaseChatMemoryInput } from "./chat_memory.cjs";
|
|
2
|
-
import { BufferMemory, BufferMemoryInput } from "./buffer_memory.cjs";
|
|
3
|
-
import { BaseConversationSummaryMemory, BaseConversationSummaryMemoryInput, ConversationSummaryMemory, ConversationSummaryMemoryInput } from "./summary.cjs";
|
|
4
|
-
import { BufferWindowMemory, BufferWindowMemoryInput } from "./buffer_window_memory.cjs";
|
|
5
|
-
import { VectorStoreRetrieverMemory, VectorStoreRetrieverMemoryParams } from "./vector_store.cjs";
|
|
6
|
-
import { EntityMemory } from "./entity_memory.cjs";
|
|
7
|
-
import { ENTITY_MEMORY_CONVERSATION_TEMPLATE } from "./prompt.cjs";
|
|
8
|
-
import { CombinedMemory, CombinedMemoryInput } from "./combined_memory.cjs";
|
|
9
|
-
import { ConversationSummaryBufferMemory, ConversationSummaryBufferMemoryInput } from "./summary_buffer.cjs";
|
|
10
|
-
import { ConversationTokenBufferMemory, ConversationTokenBufferMemoryInput } from "./buffer_token_memory.cjs";
|
|
11
|
-
import { getBufferString } from "@langchain/core/messages";
|
|
12
|
-
import { BaseMemory, InputValues, MemoryVariables, OutputValues, getInputValue, getOutputValue } from "@langchain/core/memory";
|
|
13
|
-
import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history";
|
|
14
|
-
export { BaseChatMemory, type BaseChatMemoryInput, BaseConversationSummaryMemory, type BaseConversationSummaryMemoryInput, BaseMemory, BufferMemory, type BufferMemoryInput, BufferWindowMemory, type BufferWindowMemoryInput, ChatMessageHistory, CombinedMemory, type CombinedMemoryInput, ConversationSummaryBufferMemory, type ConversationSummaryBufferMemoryInput, ConversationSummaryMemory, type ConversationSummaryMemoryInput, ConversationTokenBufferMemory, type ConversationTokenBufferMemoryInput, ENTITY_MEMORY_CONVERSATION_TEMPLATE, EntityMemory, type InputValues, type MemoryVariables, type OutputValues, VectorStoreRetrieverMemory, type VectorStoreRetrieverMemoryParams, getBufferString, getInputValue, getOutputValue };
|