@langchain/classic 1.0.23 → 1.0.24-dev-1773698445534
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/_virtual/_rolldown/runtime.cjs +12 -22
- package/dist/_virtual/_rolldown/runtime.js +12 -21
- package/dist/agents/agent.cjs +2 -3
- package/dist/agents/agent.cjs.map +1 -1
- package/dist/agents/agent.js +1 -2
- package/dist/agents/agent.js.map +1 -1
- package/dist/agents/chat/index.cjs +6 -7
- package/dist/agents/chat/index.cjs.map +1 -1
- package/dist/agents/chat/index.js +1 -2
- package/dist/agents/chat/index.js.map +1 -1
- package/dist/agents/chat/outputParser.cjs +5 -6
- package/dist/agents/chat/outputParser.cjs.map +1 -1
- package/dist/agents/chat/outputParser.js +2 -3
- package/dist/agents/chat/outputParser.js.map +1 -1
- package/dist/agents/chat/prompt.cjs +1 -2
- package/dist/agents/chat/prompt.cjs.map +1 -1
- package/dist/agents/chat/prompt.js +1 -1
- package/dist/agents/chat_convo/index.cjs +6 -7
- package/dist/agents/chat_convo/index.cjs.map +1 -1
- package/dist/agents/chat_convo/index.js +1 -2
- package/dist/agents/chat_convo/index.js.map +1 -1
- package/dist/agents/chat_convo/outputParser.cjs +5 -6
- package/dist/agents/chat_convo/outputParser.cjs.map +1 -1
- package/dist/agents/chat_convo/outputParser.js +1 -2
- package/dist/agents/chat_convo/outputParser.js.map +1 -1
- package/dist/agents/chat_convo/prompt.cjs +1 -2
- package/dist/agents/chat_convo/prompt.cjs.map +1 -1
- package/dist/agents/chat_convo/prompt.js +1 -1
- package/dist/agents/executor.cjs +4 -5
- package/dist/agents/executor.cjs.map +1 -1
- package/dist/agents/executor.js +1 -2
- package/dist/agents/executor.js.map +1 -1
- package/dist/agents/format_scratchpad/log.cjs +8 -10
- package/dist/agents/format_scratchpad/log.cjs.map +1 -1
- package/dist/agents/format_scratchpad/log.js +1 -2
- package/dist/agents/format_scratchpad/log.js.map +1 -1
- package/dist/agents/format_scratchpad/log_to_message.cjs +8 -9
- package/dist/agents/format_scratchpad/log_to_message.cjs.map +1 -1
- package/dist/agents/format_scratchpad/log_to_message.js +1 -2
- package/dist/agents/format_scratchpad/log_to_message.js.map +1 -1
- package/dist/agents/format_scratchpad/openai_functions.cjs +9 -10
- package/dist/agents/format_scratchpad/openai_functions.cjs.map +1 -1
- package/dist/agents/format_scratchpad/openai_functions.js +1 -2
- package/dist/agents/format_scratchpad/openai_functions.js.map +1 -1
- package/dist/agents/format_scratchpad/openai_tools.cjs +9 -10
- package/dist/agents/format_scratchpad/openai_tools.js +1 -2
- package/dist/agents/format_scratchpad/tool_calling.cjs +2 -3
- package/dist/agents/format_scratchpad/tool_calling.cjs.map +1 -1
- package/dist/agents/format_scratchpad/tool_calling.js +1 -2
- package/dist/agents/format_scratchpad/tool_calling.js.map +1 -1
- package/dist/agents/format_scratchpad/xml.cjs +8 -10
- package/dist/agents/format_scratchpad/xml.cjs.map +1 -1
- package/dist/agents/format_scratchpad/xml.js +1 -2
- package/dist/agents/format_scratchpad/xml.js.map +1 -1
- package/dist/agents/helpers.cjs +2 -3
- package/dist/agents/helpers.cjs.map +1 -1
- package/dist/agents/helpers.js +1 -2
- package/dist/agents/helpers.js.map +1 -1
- package/dist/agents/index.cjs +35 -36
- package/dist/agents/index.d.ts +0 -1
- package/dist/agents/index.js +1 -2
- package/dist/agents/initialize.cjs +9 -10
- package/dist/agents/initialize.cjs.map +1 -1
- package/dist/agents/initialize.js +1 -2
- package/dist/agents/initialize.js.map +1 -1
- package/dist/agents/load.cjs +12 -13
- package/dist/agents/load.cjs.map +1 -1
- package/dist/agents/load.js +1 -2
- package/dist/agents/load.js.map +1 -1
- package/dist/agents/mrkl/index.cjs +7 -8
- package/dist/agents/mrkl/index.cjs.map +1 -1
- package/dist/agents/mrkl/index.js +1 -2
- package/dist/agents/mrkl/index.js.map +1 -1
- package/dist/agents/mrkl/outputParser.cjs +5 -8
- package/dist/agents/mrkl/outputParser.cjs.map +1 -1
- package/dist/agents/mrkl/outputParser.d.cts +1 -1
- package/dist/agents/mrkl/outputParser.js +2 -5
- package/dist/agents/mrkl/outputParser.js.map +1 -1
- package/dist/agents/mrkl/prompt.cjs +1 -2
- package/dist/agents/mrkl/prompt.cjs.map +1 -1
- package/dist/agents/mrkl/prompt.js +1 -1
- package/dist/agents/openai/output_parser.cjs +10 -11
- package/dist/agents/openai/output_parser.js +1 -2
- package/dist/agents/openai_functions/index.cjs +8 -9
- package/dist/agents/openai_functions/index.cjs.map +1 -1
- package/dist/agents/openai_functions/index.d.ts +0 -1
- package/dist/agents/openai_functions/index.d.ts.map +1 -1
- package/dist/agents/openai_functions/index.js +1 -2
- package/dist/agents/openai_functions/index.js.map +1 -1
- package/dist/agents/openai_functions/output_parser.cjs +3 -4
- package/dist/agents/openai_functions/output_parser.cjs.map +1 -1
- package/dist/agents/openai_functions/output_parser.js +1 -2
- package/dist/agents/openai_functions/output_parser.js.map +1 -1
- package/dist/agents/openai_functions/prompt.cjs +1 -2
- package/dist/agents/openai_functions/prompt.cjs.map +1 -1
- package/dist/agents/openai_functions/prompt.js +1 -1
- package/dist/agents/openai_tools/index.cjs +6 -7
- package/dist/agents/openai_tools/index.cjs.map +1 -1
- package/dist/agents/openai_tools/index.js +1 -2
- package/dist/agents/openai_tools/index.js.map +1 -1
- package/dist/agents/openai_tools/output_parser.cjs +3 -4
- package/dist/agents/openai_tools/output_parser.cjs.map +1 -1
- package/dist/agents/openai_tools/output_parser.js +1 -2
- package/dist/agents/openai_tools/output_parser.js.map +1 -1
- package/dist/agents/react/index.cjs +6 -7
- package/dist/agents/react/index.cjs.map +1 -1
- package/dist/agents/react/index.js +1 -2
- package/dist/agents/react/index.js.map +1 -1
- package/dist/agents/react/output_parser.cjs +10 -11
- package/dist/agents/react/output_parser.cjs.map +1 -1
- package/dist/agents/react/output_parser.js +1 -2
- package/dist/agents/react/output_parser.js.map +1 -1
- package/dist/agents/react/prompt.cjs +1 -2
- package/dist/agents/react/prompt.cjs.map +1 -1
- package/dist/agents/react/prompt.js +1 -1
- package/dist/agents/structured_chat/index.cjs +8 -9
- package/dist/agents/structured_chat/index.cjs.map +1 -1
- package/dist/agents/structured_chat/index.js +1 -2
- package/dist/agents/structured_chat/index.js.map +1 -1
- package/dist/agents/structured_chat/outputParser.cjs +5 -6
- package/dist/agents/structured_chat/outputParser.cjs.map +1 -1
- package/dist/agents/structured_chat/outputParser.js +1 -2
- package/dist/agents/structured_chat/outputParser.js.map +1 -1
- package/dist/agents/structured_chat/prompt.cjs +1 -2
- package/dist/agents/structured_chat/prompt.cjs.map +1 -1
- package/dist/agents/structured_chat/prompt.js +1 -1
- package/dist/agents/tool_calling/index.cjs +5 -6
- package/dist/agents/tool_calling/index.cjs.map +1 -1
- package/dist/agents/tool_calling/index.js +1 -2
- package/dist/agents/tool_calling/index.js.map +1 -1
- package/dist/agents/tool_calling/output_parser.cjs +3 -4
- package/dist/agents/tool_calling/output_parser.cjs.map +1 -1
- package/dist/agents/tool_calling/output_parser.d.ts +0 -1
- package/dist/agents/tool_calling/output_parser.d.ts.map +1 -1
- package/dist/agents/tool_calling/output_parser.js +1 -2
- package/dist/agents/tool_calling/output_parser.js.map +1 -1
- package/dist/agents/toolkits/base.cjs +2 -2
- package/dist/agents/toolkits/base.js +1 -2
- package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs +4 -5
- package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/openai_functions.js +1 -2
- package/dist/agents/toolkits/conversational_retrieval/openai_functions.js.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs +4 -5
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.js +1 -2
- package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.js.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/tool.cjs +3 -4
- package/dist/agents/toolkits/conversational_retrieval/tool.cjs.map +1 -1
- package/dist/agents/toolkits/conversational_retrieval/tool.js +1 -2
- package/dist/agents/toolkits/conversational_retrieval/tool.js.map +1 -1
- package/dist/agents/toolkits/index.cjs +14 -15
- package/dist/agents/toolkits/index.js +1 -2
- package/dist/agents/toolkits/json/json.cjs +7 -8
- package/dist/agents/toolkits/json/json.cjs.map +1 -1
- package/dist/agents/toolkits/json/json.js +1 -2
- package/dist/agents/toolkits/json/json.js.map +1 -1
- package/dist/agents/toolkits/json/prompt.cjs +1 -2
- package/dist/agents/toolkits/json/prompt.cjs.map +1 -1
- package/dist/agents/toolkits/json/prompt.js +1 -1
- package/dist/agents/toolkits/openapi/openapi.cjs +8 -9
- package/dist/agents/toolkits/openapi/openapi.cjs.map +1 -1
- package/dist/agents/toolkits/openapi/openapi.js +1 -2
- package/dist/agents/toolkits/openapi/openapi.js.map +1 -1
- package/dist/agents/toolkits/openapi/prompt.cjs +1 -2
- package/dist/agents/toolkits/openapi/prompt.cjs.map +1 -1
- package/dist/agents/toolkits/openapi/prompt.js +1 -1
- package/dist/agents/toolkits/sql/index.cjs +10 -11
- package/dist/agents/toolkits/sql/index.js +1 -2
- package/dist/agents/toolkits/sql/prompt.cjs +1 -2
- package/dist/agents/toolkits/sql/prompt.cjs.map +1 -1
- package/dist/agents/toolkits/sql/prompt.js +1 -1
- package/dist/agents/toolkits/sql/sql.cjs +7 -8
- package/dist/agents/toolkits/sql/sql.cjs.map +1 -1
- package/dist/agents/toolkits/sql/sql.js +1 -2
- package/dist/agents/toolkits/sql/sql.js.map +1 -1
- package/dist/agents/toolkits/vectorstore/prompt.cjs +1 -2
- package/dist/agents/toolkits/vectorstore/prompt.cjs.map +1 -1
- package/dist/agents/toolkits/vectorstore/prompt.js +1 -1
- package/dist/agents/toolkits/vectorstore/vectorstore.cjs +8 -9
- package/dist/agents/toolkits/vectorstore/vectorstore.cjs.map +1 -1
- package/dist/agents/toolkits/vectorstore/vectorstore.js +1 -2
- package/dist/agents/toolkits/vectorstore/vectorstore.js.map +1 -1
- package/dist/agents/types.cjs +2 -3
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.js +1 -2
- package/dist/agents/types.js.map +1 -1
- package/dist/agents/xml/index.cjs +8 -9
- package/dist/agents/xml/index.cjs.map +1 -1
- package/dist/agents/xml/index.js +1 -2
- package/dist/agents/xml/index.js.map +1 -1
- package/dist/agents/xml/output_parser.cjs +9 -10
- package/dist/agents/xml/output_parser.cjs.map +1 -1
- package/dist/agents/xml/output_parser.js +1 -2
- package/dist/agents/xml/output_parser.js.map +1 -1
- package/dist/agents/xml/prompt.cjs +1 -2
- package/dist/agents/xml/prompt.cjs.map +1 -1
- package/dist/agents/xml/prompt.js +1 -1
- package/dist/cache/file_system.cjs +8 -9
- package/dist/cache/file_system.cjs.map +1 -1
- package/dist/cache/file_system.js +1 -2
- package/dist/cache/file_system.js.map +1 -1
- package/dist/callbacks/handlers/console.cjs +13 -13
- package/dist/callbacks/handlers/console.d.cts +0 -1
- package/dist/callbacks/handlers/console.d.ts +0 -1
- package/dist/callbacks/handlers/console.js +2 -4
- package/dist/callbacks/handlers/run_collector.cjs +13 -13
- package/dist/callbacks/handlers/run_collector.d.cts +0 -1
- package/dist/callbacks/handlers/run_collector.d.ts +0 -1
- package/dist/callbacks/handlers/run_collector.js +2 -4
- package/dist/callbacks/handlers/tracer.cjs +13 -13
- package/dist/callbacks/handlers/tracer.d.cts +0 -1
- package/dist/callbacks/handlers/tracer.d.ts +0 -1
- package/dist/callbacks/handlers/tracer.js +2 -4
- package/dist/callbacks/handlers/tracer_langchain.cjs +13 -13
- package/dist/callbacks/handlers/tracer_langchain.d.cts +0 -1
- package/dist/callbacks/handlers/tracer_langchain.d.ts +0 -1
- package/dist/callbacks/handlers/tracer_langchain.js +2 -4
- package/dist/callbacks/index.cjs +49 -50
- package/dist/callbacks/index.js +1 -2
- package/dist/callbacks/promises.cjs +13 -13
- package/dist/callbacks/promises.d.cts +0 -1
- package/dist/callbacks/promises.d.ts +0 -1
- package/dist/callbacks/promises.js +2 -4
- package/dist/chains/analyze_documents_chain.cjs +3 -4
- package/dist/chains/analyze_documents_chain.cjs.map +1 -1
- package/dist/chains/analyze_documents_chain.js +1 -2
- package/dist/chains/analyze_documents_chain.js.map +1 -1
- package/dist/chains/api/api_chain.cjs +4 -5
- package/dist/chains/api/api_chain.cjs.map +1 -1
- package/dist/chains/api/api_chain.js +1 -2
- package/dist/chains/api/api_chain.js.map +1 -1
- package/dist/chains/api/prompts.cjs +2 -3
- package/dist/chains/api/prompts.cjs.map +1 -1
- package/dist/chains/api/prompts.js +10 -12
- package/dist/chains/api/prompts.js.map +1 -1
- package/dist/chains/base.cjs +2 -3
- package/dist/chains/base.cjs.map +1 -1
- package/dist/chains/base.js +1 -2
- package/dist/chains/base.js.map +1 -1
- package/dist/chains/chat_vector_db_chain.cjs +5 -6
- package/dist/chains/chat_vector_db_chain.cjs.map +1 -1
- package/dist/chains/chat_vector_db_chain.js +1 -2
- package/dist/chains/chat_vector_db_chain.js.map +1 -1
- package/dist/chains/combine_docs_chain.cjs +4 -5
- package/dist/chains/combine_docs_chain.cjs.map +1 -1
- package/dist/chains/combine_docs_chain.js +1 -2
- package/dist/chains/combine_docs_chain.js.map +1 -1
- package/dist/chains/combine_documents/base.cjs +2 -5
- package/dist/chains/combine_documents/base.cjs.map +1 -1
- package/dist/chains/combine_documents/base.js +2 -4
- package/dist/chains/combine_documents/base.js.map +1 -1
- package/dist/chains/combine_documents/index.cjs +9 -10
- package/dist/chains/combine_documents/index.js +1 -2
- package/dist/chains/combine_documents/reduce.cjs +8 -10
- package/dist/chains/combine_documents/reduce.cjs.map +1 -1
- package/dist/chains/combine_documents/reduce.js +1 -2
- package/dist/chains/combine_documents/reduce.js.map +1 -1
- package/dist/chains/combine_documents/stuff.cjs +5 -6
- package/dist/chains/combine_documents/stuff.cjs.map +1 -1
- package/dist/chains/combine_documents/stuff.js +4 -5
- package/dist/chains/combine_documents/stuff.js.map +1 -1
- package/dist/chains/constitutional_ai/constitutional_chain.cjs +5 -6
- package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +1 -1
- package/dist/chains/constitutional_ai/constitutional_chain.js +1 -2
- package/dist/chains/constitutional_ai/constitutional_chain.js.map +1 -1
- package/dist/chains/constitutional_ai/constitutional_principle.cjs +1 -2
- package/dist/chains/constitutional_ai/constitutional_principle.cjs.map +1 -1
- package/dist/chains/constitutional_ai/constitutional_principle.js +1 -1
- package/dist/chains/constitutional_ai/constitutional_prompts.cjs +5 -8
- package/dist/chains/constitutional_ai/constitutional_prompts.cjs.map +1 -1
- package/dist/chains/constitutional_ai/constitutional_prompts.js +4 -7
- package/dist/chains/constitutional_ai/constitutional_prompts.js.map +1 -1
- package/dist/chains/conversation.cjs +4 -5
- package/dist/chains/conversation.cjs.map +1 -1
- package/dist/chains/conversation.js +1 -2
- package/dist/chains/conversation.js.map +1 -1
- package/dist/chains/conversational_retrieval_chain.cjs +5 -6
- package/dist/chains/conversational_retrieval_chain.cjs.map +1 -1
- package/dist/chains/conversational_retrieval_chain.js +1 -2
- package/dist/chains/conversational_retrieval_chain.js.map +1 -1
- package/dist/chains/graph_qa/cypher.cjs +12 -13
- package/dist/chains/graph_qa/cypher.cjs.map +1 -1
- package/dist/chains/graph_qa/cypher.js +1 -2
- package/dist/chains/graph_qa/cypher.js.map +1 -1
- package/dist/chains/graph_qa/prompts.cjs +8 -12
- package/dist/chains/graph_qa/prompts.cjs.map +1 -1
- package/dist/chains/graph_qa/prompts.js +7 -11
- package/dist/chains/graph_qa/prompts.js.map +1 -1
- package/dist/chains/history_aware_retriever.cjs +8 -9
- package/dist/chains/history_aware_retriever.cjs.map +1 -1
- package/dist/chains/history_aware_retriever.js +1 -2
- package/dist/chains/history_aware_retriever.js.map +1 -1
- package/dist/chains/index.cjs +32 -33
- package/dist/chains/index.js +1 -2
- package/dist/chains/llm_chain.cjs +4 -5
- package/dist/chains/llm_chain.cjs.map +1 -1
- package/dist/chains/llm_chain.js +1 -2
- package/dist/chains/llm_chain.js.map +1 -1
- package/dist/chains/load.cjs +12 -13
- package/dist/chains/load.cjs.map +1 -1
- package/dist/chains/load.js +1 -2
- package/dist/chains/load.js.map +1 -1
- package/dist/chains/openai_functions/base.cjs +3 -4
- package/dist/chains/openai_functions/base.cjs.map +1 -1
- package/dist/chains/openai_functions/base.js +1 -2
- package/dist/chains/openai_functions/base.js.map +1 -1
- package/dist/chains/openai_functions/extraction.cjs +4 -5
- package/dist/chains/openai_functions/extraction.cjs.map +1 -1
- package/dist/chains/openai_functions/extraction.js +1 -2
- package/dist/chains/openai_functions/extraction.js.map +1 -1
- package/dist/chains/openai_functions/index.cjs +12 -13
- package/dist/chains/openai_functions/index.js +1 -2
- package/dist/chains/openai_functions/openapi.cjs +7 -8
- package/dist/chains/openai_functions/openapi.cjs.map +1 -1
- package/dist/chains/openai_functions/openapi.js +1 -2
- package/dist/chains/openai_functions/openapi.js.map +1 -1
- package/dist/chains/openai_functions/tagging.cjs +4 -5
- package/dist/chains/openai_functions/tagging.cjs.map +1 -1
- package/dist/chains/openai_functions/tagging.js +1 -2
- package/dist/chains/openai_functions/tagging.js.map +1 -1
- package/dist/chains/openai_moderation.cjs +3 -4
- package/dist/chains/openai_moderation.cjs.map +1 -1
- package/dist/chains/openai_moderation.js +1 -2
- package/dist/chains/openai_moderation.js.map +1 -1
- package/dist/chains/query_constructor/index.cjs +11 -12
- package/dist/chains/query_constructor/index.cjs.map +1 -1
- package/dist/chains/query_constructor/index.js +1 -2
- package/dist/chains/query_constructor/index.js.map +1 -1
- package/dist/chains/query_constructor/ir.cjs +14 -14
- package/dist/chains/query_constructor/ir.js +2 -4
- package/dist/chains/query_constructor/parser.cjs +3 -4
- package/dist/chains/query_constructor/parser.cjs.map +1 -1
- package/dist/chains/query_constructor/parser.js +1 -2
- package/dist/chains/query_constructor/parser.js.map +1 -1
- package/dist/chains/query_constructor/prompt.cjs +23 -27
- package/dist/chains/query_constructor/prompt.cjs.map +1 -1
- package/dist/chains/query_constructor/prompt.js +22 -26
- package/dist/chains/query_constructor/prompt.js.map +1 -1
- package/dist/chains/question_answering/load.cjs +6 -7
- package/dist/chains/question_answering/load.cjs.map +1 -1
- package/dist/chains/question_answering/load.js +1 -2
- package/dist/chains/question_answering/load.js.map +1 -1
- package/dist/chains/question_answering/map_reduce_prompts.cjs +6 -10
- package/dist/chains/question_answering/map_reduce_prompts.cjs.map +1 -1
- package/dist/chains/question_answering/map_reduce_prompts.js +7 -13
- package/dist/chains/question_answering/map_reduce_prompts.js.map +1 -1
- package/dist/chains/question_answering/refine_prompts.cjs +14 -18
- package/dist/chains/question_answering/refine_prompts.cjs.map +1 -1
- package/dist/chains/question_answering/refine_prompts.js +15 -21
- package/dist/chains/question_answering/refine_prompts.js.map +1 -1
- package/dist/chains/question_answering/stuff_prompts.cjs +2 -3
- package/dist/chains/question_answering/stuff_prompts.cjs.map +1 -1
- package/dist/chains/question_answering/stuff_prompts.js +2 -4
- package/dist/chains/question_answering/stuff_prompts.js.map +1 -1
- package/dist/chains/retrieval.cjs +8 -9
- package/dist/chains/retrieval.cjs.map +1 -1
- package/dist/chains/retrieval.js +1 -2
- package/dist/chains/retrieval.js.map +1 -1
- package/dist/chains/retrieval_qa.cjs +3 -4
- package/dist/chains/retrieval_qa.cjs.map +1 -1
- package/dist/chains/retrieval_qa.js +1 -2
- package/dist/chains/retrieval_qa.js.map +1 -1
- package/dist/chains/router/llm_router.cjs +3 -4
- package/dist/chains/router/llm_router.cjs.map +1 -1
- package/dist/chains/router/llm_router.js +1 -2
- package/dist/chains/router/llm_router.js.map +1 -1
- package/dist/chains/router/multi_prompt.cjs +9 -10
- package/dist/chains/router/multi_prompt.cjs.map +1 -1
- package/dist/chains/router/multi_prompt.js +1 -2
- package/dist/chains/router/multi_prompt.js.map +1 -1
- package/dist/chains/router/multi_prompt_prompt.cjs +1 -2
- package/dist/chains/router/multi_prompt_prompt.cjs.map +1 -1
- package/dist/chains/router/multi_prompt_prompt.js +1 -1
- package/dist/chains/router/multi_retrieval_prompt.cjs +1 -2
- package/dist/chains/router/multi_retrieval_prompt.cjs.map +1 -1
- package/dist/chains/router/multi_retrieval_prompt.js +1 -1
- package/dist/chains/router/multi_retrieval_qa.cjs +9 -10
- package/dist/chains/router/multi_retrieval_qa.cjs.map +1 -1
- package/dist/chains/router/multi_retrieval_qa.js +1 -2
- package/dist/chains/router/multi_retrieval_qa.js.map +1 -1
- package/dist/chains/router/multi_route.cjs +2 -3
- package/dist/chains/router/multi_route.cjs.map +1 -1
- package/dist/chains/router/multi_route.js +1 -2
- package/dist/chains/router/multi_route.js.map +1 -1
- package/dist/chains/router/utils.cjs +1 -2
- package/dist/chains/router/utils.cjs.map +1 -1
- package/dist/chains/router/utils.js +1 -1
- package/dist/chains/sequential_chain.cjs +3 -4
- package/dist/chains/sequential_chain.cjs.map +1 -1
- package/dist/chains/sequential_chain.js +1 -2
- package/dist/chains/sequential_chain.js.map +1 -1
- package/dist/chains/sql_db/index.cjs +10 -11
- package/dist/chains/sql_db/index.js +1 -2
- package/dist/chains/sql_db/sql_db_chain.cjs +6 -7
- package/dist/chains/sql_db/sql_db_chain.cjs.map +1 -1
- package/dist/chains/sql_db/sql_db_chain.js +1 -2
- package/dist/chains/sql_db/sql_db_chain.js.map +1 -1
- package/dist/chains/sql_db/sql_db_prompt.cjs +2 -3
- package/dist/chains/sql_db/sql_db_prompt.cjs.map +1 -1
- package/dist/chains/sql_db/sql_db_prompt.js +1 -2
- package/dist/chains/sql_db/sql_db_prompt.js.map +1 -1
- package/dist/chains/summarization/load.cjs +5 -6
- package/dist/chains/summarization/load.cjs.map +1 -1
- package/dist/chains/summarization/load.js +1 -2
- package/dist/chains/summarization/load.js.map +1 -1
- package/dist/chains/summarization/refine_prompts.cjs +5 -9
- package/dist/chains/summarization/refine_prompts.cjs.map +1 -1
- package/dist/chains/summarization/refine_prompts.js +4 -7
- package/dist/chains/summarization/refine_prompts.js.map +1 -1
- package/dist/chains/summarization/stuff_prompts.cjs +5 -9
- package/dist/chains/summarization/stuff_prompts.cjs.map +1 -1
- package/dist/chains/summarization/stuff_prompts.js +4 -7
- package/dist/chains/summarization/stuff_prompts.js.map +1 -1
- package/dist/chains/transform.cjs +2 -3
- package/dist/chains/transform.cjs.map +1 -1
- package/dist/chains/transform.js +1 -2
- package/dist/chains/transform.js.map +1 -1
- package/dist/chains/vector_db_qa.cjs +3 -4
- package/dist/chains/vector_db_qa.cjs.map +1 -1
- package/dist/chains/vector_db_qa.js +1 -2
- package/dist/chains/vector_db_qa.js.map +1 -1
- package/dist/chat_models/universal.cjs +8 -9
- package/dist/chat_models/universal.cjs.map +1 -1
- package/dist/chat_models/universal.js +1 -2
- package/dist/chat_models/universal.js.map +1 -1
- package/dist/document.cjs +13 -14
- package/dist/document.js +1 -2
- package/dist/document_loaders/base.cjs +14 -14
- package/dist/document_loaders/base.js +2 -4
- package/dist/document_loaders/fs/buffer.cjs +8 -9
- package/dist/document_loaders/fs/buffer.cjs.map +1 -1
- package/dist/document_loaders/fs/buffer.js +1 -2
- package/dist/document_loaders/fs/buffer.js.map +1 -1
- package/dist/document_loaders/fs/directory.cjs +8 -9
- package/dist/document_loaders/fs/directory.cjs.map +1 -1
- package/dist/document_loaders/fs/directory.js +1 -2
- package/dist/document_loaders/fs/directory.js.map +1 -1
- package/dist/document_loaders/fs/json.cjs +9 -10
- package/dist/document_loaders/fs/json.cjs.map +1 -1
- package/dist/document_loaders/fs/json.js +1 -2
- package/dist/document_loaders/fs/json.js.map +1 -1
- package/dist/document_loaders/fs/multi_file.cjs +9 -10
- package/dist/document_loaders/fs/multi_file.cjs.map +1 -1
- package/dist/document_loaders/fs/multi_file.js +1 -2
- package/dist/document_loaders/fs/multi_file.js.map +1 -1
- package/dist/document_loaders/fs/text.cjs +8 -9
- package/dist/document_loaders/fs/text.cjs.map +1 -1
- package/dist/document_loaders/fs/text.js +1 -2
- package/dist/document_loaders/fs/text.js.map +1 -1
- package/dist/document_transformers/openai_functions.cjs +10 -11
- package/dist/document_transformers/openai_functions.cjs.map +1 -1
- package/dist/document_transformers/openai_functions.d.ts +0 -1
- package/dist/document_transformers/openai_functions.d.ts.map +1 -1
- package/dist/document_transformers/openai_functions.js +1 -2
- package/dist/document_transformers/openai_functions.js.map +1 -1
- package/dist/embeddings/cache_backed.cjs +9 -10
- package/dist/embeddings/cache_backed.cjs.map +1 -1
- package/dist/embeddings/cache_backed.js +1 -2
- package/dist/embeddings/cache_backed.js.map +1 -1
- package/dist/embeddings/fake.cjs +14 -14
- package/dist/embeddings/fake.js +2 -4
- package/dist/evaluation/agents/index.cjs +1 -1
- package/dist/evaluation/agents/index.js +2 -3
- package/dist/evaluation/agents/prompt.cjs +8 -10
- package/dist/evaluation/agents/prompt.cjs.map +1 -1
- package/dist/evaluation/agents/prompt.js +7 -9
- package/dist/evaluation/agents/prompt.js.map +1 -1
- package/dist/evaluation/agents/trajectory.cjs +4 -5
- package/dist/evaluation/agents/trajectory.cjs.map +1 -1
- package/dist/evaluation/agents/trajectory.js +1 -2
- package/dist/evaluation/agents/trajectory.js.map +1 -1
- package/dist/evaluation/base.cjs +4 -5
- package/dist/evaluation/base.cjs.map +1 -1
- package/dist/evaluation/base.d.ts +0 -1
- package/dist/evaluation/base.d.ts.map +1 -1
- package/dist/evaluation/base.js +1 -2
- package/dist/evaluation/base.js.map +1 -1
- package/dist/evaluation/comparison/index.cjs +1 -1
- package/dist/evaluation/comparison/index.js +2 -3
- package/dist/evaluation/comparison/pairwise.cjs +6 -7
- package/dist/evaluation/comparison/pairwise.cjs.map +1 -1
- package/dist/evaluation/comparison/pairwise.js +1 -2
- package/dist/evaluation/comparison/pairwise.js.map +1 -1
- package/dist/evaluation/comparison/prompt.cjs +16 -27
- package/dist/evaluation/comparison/prompt.cjs.map +1 -1
- package/dist/evaluation/comparison/prompt.js +15 -26
- package/dist/evaluation/comparison/prompt.js.map +1 -1
- package/dist/evaluation/criteria/criteria.cjs +5 -6
- package/dist/evaluation/criteria/criteria.cjs.map +1 -1
- package/dist/evaluation/criteria/criteria.js +1 -2
- package/dist/evaluation/criteria/criteria.js.map +1 -1
- package/dist/evaluation/criteria/index.cjs +1 -1
- package/dist/evaluation/criteria/index.js +2 -3
- package/dist/evaluation/criteria/prompt.cjs +16 -20
- package/dist/evaluation/criteria/prompt.cjs.map +1 -1
- package/dist/evaluation/criteria/prompt.js +15 -19
- package/dist/evaluation/criteria/prompt.js.map +1 -1
- package/dist/evaluation/embedding_distance/base.cjs +5 -6
- package/dist/evaluation/embedding_distance/base.cjs.map +1 -1
- package/dist/evaluation/embedding_distance/base.js +1 -2
- package/dist/evaluation/embedding_distance/base.js.map +1 -1
- package/dist/evaluation/embedding_distance/index.cjs +1 -1
- package/dist/evaluation/embedding_distance/index.js +2 -3
- package/dist/evaluation/index.cjs +19 -20
- package/dist/evaluation/index.d.ts +0 -5
- package/dist/evaluation/index.js +1 -2
- package/dist/evaluation/loader.cjs +10 -11
- package/dist/evaluation/loader.cjs.map +1 -1
- package/dist/evaluation/loader.d.ts +0 -2
- package/dist/evaluation/loader.d.ts.map +1 -1
- package/dist/evaluation/loader.js +1 -2
- package/dist/evaluation/loader.js.map +1 -1
- package/dist/evaluation/qa/eval_chain.cjs +3 -4
- package/dist/evaluation/qa/eval_chain.cjs.map +1 -1
- package/dist/evaluation/qa/eval_chain.js +1 -2
- package/dist/evaluation/qa/eval_chain.js.map +1 -1
- package/dist/evaluation/qa/index.cjs +1 -1
- package/dist/evaluation/qa/index.js +2 -3
- package/dist/evaluation/qa/prompt.cjs +10 -14
- package/dist/evaluation/qa/prompt.cjs.map +1 -1
- package/dist/evaluation/qa/prompt.js +9 -12
- package/dist/evaluation/qa/prompt.js.map +1 -1
- package/dist/experimental/autogpt/agent.cjs +8 -9
- package/dist/experimental/autogpt/agent.cjs.map +1 -1
- package/dist/experimental/autogpt/agent.js +3 -4
- package/dist/experimental/autogpt/agent.js.map +1 -1
- package/dist/experimental/autogpt/index.cjs +11 -12
- package/dist/experimental/autogpt/index.js +1 -2
- package/dist/experimental/autogpt/output_parser.cjs +2 -3
- package/dist/experimental/autogpt/output_parser.cjs.map +1 -1
- package/dist/experimental/autogpt/output_parser.js +1 -2
- package/dist/experimental/autogpt/output_parser.js.map +1 -1
- package/dist/experimental/autogpt/prompt.cjs +3 -4
- package/dist/experimental/autogpt/prompt.cjs.map +1 -1
- package/dist/experimental/autogpt/prompt.js +1 -2
- package/dist/experimental/autogpt/prompt.js.map +1 -1
- package/dist/experimental/autogpt/prompt_generator.cjs +3 -4
- package/dist/experimental/autogpt/prompt_generator.cjs.map +1 -1
- package/dist/experimental/autogpt/prompt_generator.js +1 -2
- package/dist/experimental/autogpt/prompt_generator.js.map +1 -1
- package/dist/experimental/autogpt/schema.cjs +1 -2
- package/dist/experimental/autogpt/schema.cjs.map +1 -1
- package/dist/experimental/autogpt/schema.js +1 -1
- package/dist/experimental/babyagi/agent.cjs +6 -7
- package/dist/experimental/babyagi/agent.cjs.map +1 -1
- package/dist/experimental/babyagi/agent.js +1 -2
- package/dist/experimental/babyagi/agent.js.map +1 -1
- package/dist/experimental/babyagi/index.cjs +12 -13
- package/dist/experimental/babyagi/index.js +1 -2
- package/dist/experimental/babyagi/task_creation.cjs +3 -4
- package/dist/experimental/babyagi/task_creation.cjs.map +1 -1
- package/dist/experimental/babyagi/task_creation.js +1 -2
- package/dist/experimental/babyagi/task_creation.js.map +1 -1
- package/dist/experimental/babyagi/task_execution.cjs +3 -4
- package/dist/experimental/babyagi/task_execution.cjs.map +1 -1
- package/dist/experimental/babyagi/task_execution.js +1 -2
- package/dist/experimental/babyagi/task_execution.js.map +1 -1
- package/dist/experimental/babyagi/task_prioritization.cjs +3 -4
- package/dist/experimental/babyagi/task_prioritization.cjs.map +1 -1
- package/dist/experimental/babyagi/task_prioritization.js +1 -2
- package/dist/experimental/babyagi/task_prioritization.js.map +1 -1
- package/dist/experimental/chains/violation_of_expectations/index.cjs +9 -10
- package/dist/experimental/chains/violation_of_expectations/index.js +1 -2
- package/dist/experimental/chains/violation_of_expectations/types.cjs +1 -2
- package/dist/experimental/chains/violation_of_expectations/types.cjs.map +1 -1
- package/dist/experimental/chains/violation_of_expectations/types.js +1 -1
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs +6 -7
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs.map +1 -1
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js +1 -2
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js.map +1 -1
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs +2 -3
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs.map +1 -1
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.js +1 -2
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.js.map +1 -1
- package/dist/experimental/generative_agents/generative_agent.cjs +4 -5
- package/dist/experimental/generative_agents/generative_agent.cjs.map +1 -1
- package/dist/experimental/generative_agents/generative_agent.js +1 -2
- package/dist/experimental/generative_agents/generative_agent.js.map +1 -1
- package/dist/experimental/generative_agents/generative_agent_memory.cjs +4 -5
- package/dist/experimental/generative_agents/generative_agent_memory.cjs.map +1 -1
- package/dist/experimental/generative_agents/generative_agent_memory.js +1 -2
- package/dist/experimental/generative_agents/generative_agent_memory.js.map +1 -1
- package/dist/experimental/generative_agents/index.cjs +10 -11
- package/dist/experimental/generative_agents/index.js +1 -2
- package/dist/experimental/masking/index.cjs +11 -12
- package/dist/experimental/masking/index.js +1 -2
- package/dist/experimental/masking/parser.cjs +1 -2
- package/dist/experimental/masking/parser.cjs.map +1 -1
- package/dist/experimental/masking/parser.js +1 -1
- package/dist/experimental/masking/parser.js.map +1 -1
- package/dist/experimental/masking/regex_masking_transformer.cjs +2 -3
- package/dist/experimental/masking/regex_masking_transformer.cjs.map +1 -1
- package/dist/experimental/masking/regex_masking_transformer.js +1 -2
- package/dist/experimental/masking/regex_masking_transformer.js.map +1 -1
- package/dist/experimental/masking/transformer.cjs +1 -2
- package/dist/experimental/masking/transformer.cjs.map +1 -1
- package/dist/experimental/masking/transformer.js +1 -1
- package/dist/experimental/openai_assistant/index.cjs +9 -10
- package/dist/experimental/openai_assistant/index.cjs.map +1 -1
- package/dist/experimental/openai_assistant/index.js +1 -2
- package/dist/experimental/openai_assistant/index.js.map +1 -1
- package/dist/experimental/openai_files/index.cjs +8 -9
- package/dist/experimental/openai_files/index.cjs.map +1 -1
- package/dist/experimental/openai_files/index.js +1 -2
- package/dist/experimental/openai_files/index.js.map +1 -1
- package/dist/experimental/plan_and_execute/agent_executor.cjs +10 -11
- package/dist/experimental/plan_and_execute/agent_executor.cjs.map +1 -1
- package/dist/experimental/plan_and_execute/agent_executor.js +1 -2
- package/dist/experimental/plan_and_execute/agent_executor.js.map +1 -1
- package/dist/experimental/plan_and_execute/base.cjs +1 -2
- package/dist/experimental/plan_and_execute/base.cjs.map +1 -1
- package/dist/experimental/plan_and_execute/base.js +1 -1
- package/dist/experimental/plan_and_execute/base.js.map +1 -1
- package/dist/experimental/plan_and_execute/index.cjs +11 -12
- package/dist/experimental/plan_and_execute/index.js +1 -2
- package/dist/experimental/plan_and_execute/outputParser.cjs +3 -4
- package/dist/experimental/plan_and_execute/outputParser.cjs.map +1 -1
- package/dist/experimental/plan_and_execute/outputParser.js +1 -2
- package/dist/experimental/plan_and_execute/outputParser.js.map +1 -1
- package/dist/experimental/plan_and_execute/prompt.cjs +2 -3
- package/dist/experimental/plan_and_execute/prompt.cjs.map +1 -1
- package/dist/experimental/plan_and_execute/prompt.js +1 -2
- package/dist/experimental/plan_and_execute/prompt.js.map +1 -1
- package/dist/experimental/prompts/custom_format.cjs +8 -9
- package/dist/experimental/prompts/custom_format.cjs.map +1 -1
- package/dist/experimental/prompts/custom_format.js +1 -2
- package/dist/experimental/prompts/custom_format.js.map +1 -1
- package/dist/experimental/prompts/handlebars.cjs +9 -10
- package/dist/experimental/prompts/handlebars.cjs.map +1 -1
- package/dist/experimental/prompts/handlebars.js +1 -2
- package/dist/experimental/prompts/handlebars.js.map +1 -1
- package/dist/hub/base.cjs +1 -2
- package/dist/hub/base.cjs.map +1 -1
- package/dist/hub/base.js +1 -1
- package/dist/hub/base.js.map +1 -1
- package/dist/hub/index.cjs +4 -5
- package/dist/hub/index.cjs.map +1 -1
- package/dist/hub/index.js +1 -2
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/node.cjs +5 -6
- package/dist/hub/node.cjs.map +1 -1
- package/dist/hub/node.js +1 -2
- package/dist/hub/node.js.map +1 -1
- package/dist/index.cjs +8 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +8 -9
- package/dist/indexes/index.js +1 -2
- package/dist/load/import_constants.cjs +1 -2
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +1 -1
- package/dist/load/import_map.cjs +98 -99
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +1 -2
- package/dist/load/import_map.js.map +1 -1
- package/dist/load/index.cjs +5 -6
- package/dist/load/index.cjs.map +1 -1
- package/dist/load/index.js +1 -2
- package/dist/load/index.js.map +1 -1
- package/dist/load/serializable.cjs +14 -14
- package/dist/load/serializable.js +2 -4
- package/dist/memory/buffer_memory.cjs +3 -4
- package/dist/memory/buffer_memory.cjs.map +1 -1
- package/dist/memory/buffer_memory.js +1 -2
- package/dist/memory/buffer_memory.js.map +1 -1
- package/dist/memory/buffer_token_memory.cjs +3 -4
- package/dist/memory/buffer_token_memory.cjs.map +1 -1
- package/dist/memory/buffer_token_memory.js +1 -2
- package/dist/memory/buffer_token_memory.js.map +1 -1
- package/dist/memory/buffer_window_memory.cjs +3 -4
- package/dist/memory/buffer_window_memory.cjs.map +1 -1
- package/dist/memory/buffer_window_memory.js +1 -2
- package/dist/memory/buffer_window_memory.js.map +1 -1
- package/dist/memory/chat_memory.cjs +8 -9
- package/dist/memory/chat_memory.cjs.map +1 -1
- package/dist/memory/chat_memory.js +1 -2
- package/dist/memory/chat_memory.js.map +1 -1
- package/dist/memory/combined_memory.cjs +2 -3
- package/dist/memory/combined_memory.cjs.map +1 -1
- package/dist/memory/combined_memory.js +1 -2
- package/dist/memory/combined_memory.js.map +1 -1
- package/dist/memory/entity_memory.cjs +6 -7
- package/dist/memory/entity_memory.cjs.map +1 -1
- package/dist/memory/entity_memory.js +1 -2
- package/dist/memory/entity_memory.js.map +1 -1
- package/dist/memory/index.cjs +43 -44
- package/dist/memory/index.js +1 -2
- package/dist/memory/prompt.cjs +27 -33
- package/dist/memory/prompt.cjs.map +1 -1
- package/dist/memory/prompt.js +26 -32
- package/dist/memory/prompt.js.map +1 -1
- package/dist/memory/stores/entity/base.cjs +2 -3
- package/dist/memory/stores/entity/base.cjs.map +1 -1
- package/dist/memory/stores/entity/base.js +1 -2
- package/dist/memory/stores/entity/base.js.map +1 -1
- package/dist/memory/stores/entity/in_memory.cjs +2 -3
- package/dist/memory/stores/entity/in_memory.cjs.map +1 -1
- package/dist/memory/stores/entity/in_memory.js +1 -2
- package/dist/memory/stores/entity/in_memory.js.map +1 -1
- package/dist/memory/summary.cjs +5 -6
- package/dist/memory/summary.cjs.map +1 -1
- package/dist/memory/summary.js +1 -2
- package/dist/memory/summary.js.map +1 -1
- package/dist/memory/summary_buffer.cjs +3 -4
- package/dist/memory/summary_buffer.cjs.map +1 -1
- package/dist/memory/summary_buffer.js +1 -2
- package/dist/memory/summary_buffer.js.map +1 -1
- package/dist/memory/vector_store.cjs +3 -4
- package/dist/memory/vector_store.cjs.map +1 -1
- package/dist/memory/vector_store.js +1 -2
- package/dist/memory/vector_store.js.map +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.cts +1 -4
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.ts +1 -4
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.cts +1 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +1 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.cts +1 -4
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.ts +1 -4
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.cts +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.ts +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts.map +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts.map +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts.map +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts.map +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.cts +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.ts +1 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.cts +1 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.ts +1 -2
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.cts +1 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.ts +1 -1
- package/dist/output_parsers/combining.cjs +2 -3
- package/dist/output_parsers/combining.cjs.map +1 -1
- package/dist/output_parsers/combining.js +1 -2
- package/dist/output_parsers/combining.js.map +1 -1
- package/dist/output_parsers/datetime.cjs +2 -3
- package/dist/output_parsers/datetime.cjs.map +1 -1
- package/dist/output_parsers/datetime.js +1 -2
- package/dist/output_parsers/datetime.js.map +1 -1
- package/dist/output_parsers/expression.cjs +10 -11
- package/dist/output_parsers/expression.cjs.map +1 -1
- package/dist/output_parsers/expression.js +1 -2
- package/dist/output_parsers/expression.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/base.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/base.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/base.js +1 -2
- package/dist/output_parsers/expression_type_handlers/base.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/call_expression_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/factory.cjs +11 -12
- package/dist/output_parsers/expression_type_handlers/factory.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/factory.js +1 -2
- package/dist/output_parsers/expression_type_handlers/factory.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs +1 -2
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js +1 -1
- package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/identifier_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/identifier_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/member_expression_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs +3 -4
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js.map +1 -1
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs +2 -3
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs.map +1 -1
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.js +1 -2
- package/dist/output_parsers/expression_type_handlers/string_literal_handler.js.map +1 -1
- package/dist/output_parsers/fix.cjs +4 -5
- package/dist/output_parsers/fix.cjs.map +1 -1
- package/dist/output_parsers/fix.js +1 -2
- package/dist/output_parsers/fix.js.map +1 -1
- package/dist/output_parsers/http_response.cjs +2 -3
- package/dist/output_parsers/http_response.cjs.map +1 -1
- package/dist/output_parsers/http_response.js +1 -2
- package/dist/output_parsers/http_response.js.map +1 -1
- package/dist/output_parsers/index.cjs +32 -33
- package/dist/output_parsers/index.js +1 -2
- package/dist/output_parsers/noop.cjs +2 -3
- package/dist/output_parsers/noop.cjs.map +1 -1
- package/dist/output_parsers/noop.js +1 -2
- package/dist/output_parsers/noop.js.map +1 -1
- package/dist/output_parsers/openai_functions.cjs +2 -3
- package/dist/output_parsers/openai_functions.cjs.map +1 -1
- package/dist/output_parsers/openai_functions.js +1 -2
- package/dist/output_parsers/openai_functions.js.map +1 -1
- package/dist/output_parsers/openai_tools.cjs +2 -3
- package/dist/output_parsers/openai_tools.cjs.map +1 -1
- package/dist/output_parsers/openai_tools.js +1 -2
- package/dist/output_parsers/openai_tools.js.map +1 -1
- package/dist/output_parsers/prompts.cjs +4 -8
- package/dist/output_parsers/prompts.cjs.map +1 -1
- package/dist/output_parsers/prompts.js +3 -6
- package/dist/output_parsers/prompts.js.map +1 -1
- package/dist/output_parsers/regex.cjs +2 -3
- package/dist/output_parsers/regex.cjs.map +1 -1
- package/dist/output_parsers/regex.js +1 -2
- package/dist/output_parsers/regex.js.map +1 -1
- package/dist/output_parsers/router.cjs +3 -4
- package/dist/output_parsers/router.cjs.map +1 -1
- package/dist/output_parsers/router.js +1 -2
- package/dist/output_parsers/router.js.map +1 -1
- package/dist/output_parsers/structured.cjs +2 -3
- package/dist/output_parsers/structured.cjs.map +1 -1
- package/dist/output_parsers/structured.js +1 -2
- package/dist/output_parsers/structured.js.map +1 -1
- package/dist/retrievers/contextual_compression.cjs +8 -9
- package/dist/retrievers/contextual_compression.cjs.map +1 -1
- package/dist/retrievers/contextual_compression.js +1 -2
- package/dist/retrievers/contextual_compression.js.map +1 -1
- package/dist/retrievers/document_compressors/chain_extract.cjs +11 -12
- package/dist/retrievers/document_compressors/chain_extract.cjs.map +1 -1
- package/dist/retrievers/document_compressors/chain_extract.js +1 -2
- package/dist/retrievers/document_compressors/chain_extract.js.map +1 -1
- package/dist/retrievers/document_compressors/chain_extract_prompt.cjs +1 -2
- package/dist/retrievers/document_compressors/chain_extract_prompt.cjs.map +1 -1
- package/dist/retrievers/document_compressors/chain_extract_prompt.js +1 -1
- package/dist/retrievers/document_compressors/embeddings_filter.cjs +9 -10
- package/dist/retrievers/document_compressors/embeddings_filter.cjs.map +1 -1
- package/dist/retrievers/document_compressors/embeddings_filter.js +1 -2
- package/dist/retrievers/document_compressors/embeddings_filter.js.map +1 -1
- package/dist/retrievers/document_compressors/index.cjs +8 -10
- package/dist/retrievers/document_compressors/index.cjs.map +1 -1
- package/dist/retrievers/document_compressors/index.js +1 -2
- package/dist/retrievers/document_compressors/index.js.map +1 -1
- package/dist/retrievers/ensemble.cjs +8 -9
- package/dist/retrievers/ensemble.cjs.map +1 -1
- package/dist/retrievers/ensemble.js +1 -2
- package/dist/retrievers/ensemble.js.map +1 -1
- package/dist/retrievers/hyde.cjs +8 -9
- package/dist/retrievers/hyde.cjs.map +1 -1
- package/dist/retrievers/hyde.js +1 -2
- package/dist/retrievers/hyde.js.map +1 -1
- package/dist/retrievers/matryoshka_retriever.cjs +8 -9
- package/dist/retrievers/matryoshka_retriever.cjs.map +1 -1
- package/dist/retrievers/matryoshka_retriever.js +1 -2
- package/dist/retrievers/matryoshka_retriever.js.map +1 -1
- package/dist/retrievers/multi_query.cjs +9 -10
- package/dist/retrievers/multi_query.cjs.map +1 -1
- package/dist/retrievers/multi_query.js +1 -2
- package/dist/retrievers/multi_query.js.map +1 -1
- package/dist/retrievers/multi_vector.cjs +9 -10
- package/dist/retrievers/multi_vector.cjs.map +1 -1
- package/dist/retrievers/multi_vector.js +1 -2
- package/dist/retrievers/multi_vector.js.map +1 -1
- package/dist/retrievers/parent_document.cjs +9 -10
- package/dist/retrievers/parent_document.cjs.map +1 -1
- package/dist/retrievers/parent_document.js +1 -2
- package/dist/retrievers/parent_document.js.map +1 -1
- package/dist/retrievers/score_threshold.cjs +8 -9
- package/dist/retrievers/score_threshold.cjs.map +1 -1
- package/dist/retrievers/score_threshold.js +1 -2
- package/dist/retrievers/score_threshold.js.map +1 -1
- package/dist/retrievers/self_query/functional.cjs +13 -14
- package/dist/retrievers/self_query/functional.js +1 -2
- package/dist/retrievers/self_query/index.cjs +24 -25
- package/dist/retrievers/self_query/index.cjs.map +1 -1
- package/dist/retrievers/self_query/index.js +1 -2
- package/dist/retrievers/self_query/index.js.map +1 -1
- package/dist/retrievers/time_weighted.cjs +9 -10
- package/dist/retrievers/time_weighted.cjs.map +1 -1
- package/dist/retrievers/time_weighted.js +2 -3
- package/dist/retrievers/time_weighted.js.map +1 -1
- package/dist/schema/prompt_template.cjs +8 -10
- package/dist/schema/prompt_template.cjs.map +1 -1
- package/dist/schema/prompt_template.js +1 -2
- package/dist/schema/prompt_template.js.map +1 -1
- package/dist/schema/query_constructor.cjs +8 -10
- package/dist/schema/query_constructor.cjs.map +1 -1
- package/dist/schema/query_constructor.js +1 -2
- package/dist/schema/query_constructor.js.map +1 -1
- package/dist/smith/config.cjs +1 -2
- package/dist/smith/config.cjs.map +1 -1
- package/dist/smith/config.d.cts +0 -1
- package/dist/smith/config.d.cts.map +1 -1
- package/dist/smith/config.d.ts +0 -2
- package/dist/smith/config.d.ts.map +1 -1
- package/dist/smith/config.js +1 -1
- package/dist/smith/index.cjs +10 -11
- package/dist/smith/index.js +1 -2
- package/dist/smith/name_generation.cjs +1 -2
- package/dist/smith/name_generation.cjs.map +1 -1
- package/dist/smith/name_generation.js +1 -1
- package/dist/smith/progress.cjs +1 -2
- package/dist/smith/progress.cjs.map +1 -1
- package/dist/smith/progress.js +1 -1
- package/dist/smith/progress.js.map +1 -1
- package/dist/smith/runner_utils.cjs +6 -7
- package/dist/smith/runner_utils.cjs.map +1 -1
- package/dist/smith/runner_utils.d.cts +0 -1
- package/dist/smith/runner_utils.d.cts.map +1 -1
- package/dist/smith/runner_utils.d.ts +0 -1
- package/dist/smith/runner_utils.d.ts.map +1 -1
- package/dist/smith/runner_utils.js +1 -2
- package/dist/smith/runner_utils.js.map +1 -1
- package/dist/sql_db.cjs +9 -10
- package/dist/sql_db.cjs.map +1 -1
- package/dist/sql_db.js +1 -2
- package/dist/sql_db.js.map +1 -1
- package/dist/storage/encoder_backed.cjs +8 -9
- package/dist/storage/encoder_backed.cjs.map +1 -1
- package/dist/storage/encoder_backed.js +1 -2
- package/dist/storage/encoder_backed.js.map +1 -1
- package/dist/storage/file_system.cjs +8 -9
- package/dist/storage/file_system.cjs.map +1 -1
- package/dist/storage/file_system.js +1 -2
- package/dist/storage/file_system.js.map +1 -1
- package/dist/storage/in_memory.cjs +13 -14
- package/dist/storage/in_memory.js +1 -2
- package/dist/stores/doc/base.cjs +8 -10
- package/dist/stores/doc/base.cjs.map +1 -1
- package/dist/stores/doc/base.js +1 -2
- package/dist/stores/doc/base.js.map +1 -1
- package/dist/stores/doc/in_memory.cjs +9 -10
- package/dist/stores/doc/in_memory.cjs.map +1 -1
- package/dist/stores/doc/in_memory.js +1 -2
- package/dist/stores/doc/in_memory.js.map +1 -1
- package/dist/stores/file/base.cjs +2 -3
- package/dist/stores/file/base.cjs.map +1 -1
- package/dist/stores/file/base.js +1 -2
- package/dist/stores/file/base.js.map +1 -1
- package/dist/stores/file/in_memory.cjs +9 -10
- package/dist/stores/file/in_memory.cjs.map +1 -1
- package/dist/stores/file/in_memory.js +1 -2
- package/dist/stores/file/in_memory.js.map +1 -1
- package/dist/stores/file/node.cjs +9 -10
- package/dist/stores/file/node.cjs.map +1 -1
- package/dist/stores/file/node.js +1 -2
- package/dist/stores/file/node.js.map +1 -1
- package/dist/stores/message/in_memory.cjs +13 -14
- package/dist/stores/message/in_memory.js +1 -2
- package/dist/text_splitter.cjs +14 -14
- package/dist/text_splitter.d.cts +0 -1
- package/dist/text_splitter.d.ts +0 -1
- package/dist/text_splitter.js +2 -4
- package/dist/tools/chain.cjs +8 -9
- package/dist/tools/chain.cjs.map +1 -1
- package/dist/tools/chain.js +1 -2
- package/dist/tools/chain.js.map +1 -1
- package/dist/tools/fs.cjs +2 -3
- package/dist/tools/fs.cjs.map +1 -1
- package/dist/tools/fs.js +1 -2
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/index.cjs +33 -34
- package/dist/tools/index.js +1 -2
- package/dist/tools/json.cjs +2 -3
- package/dist/tools/json.cjs.map +1 -1
- package/dist/tools/json.js +1 -2
- package/dist/tools/json.js.map +1 -1
- package/dist/tools/render.cjs +8 -9
- package/dist/tools/render.cjs.map +1 -1
- package/dist/tools/render.js +1 -2
- package/dist/tools/render.js.map +1 -1
- package/dist/tools/requests.cjs +2 -3
- package/dist/tools/requests.cjs.map +1 -1
- package/dist/tools/requests.js +1 -2
- package/dist/tools/requests.js.map +1 -1
- package/dist/tools/retriever.cjs +9 -10
- package/dist/tools/retriever.cjs.map +1 -1
- package/dist/tools/retriever.js +1 -2
- package/dist/tools/retriever.js.map +1 -1
- package/dist/tools/sql.cjs +9 -10
- package/dist/tools/sql.cjs.map +1 -1
- package/dist/tools/sql.js +1 -2
- package/dist/tools/sql.js.map +1 -1
- package/dist/tools/vectorstore.cjs +3 -4
- package/dist/tools/vectorstore.cjs.map +1 -1
- package/dist/tools/vectorstore.js +1 -2
- package/dist/tools/vectorstore.js.map +1 -1
- package/dist/tools/webbrowser.cjs +10 -11
- package/dist/tools/webbrowser.cjs.map +1 -1
- package/dist/tools/webbrowser.js +1 -2
- package/dist/tools/webbrowser.js.map +1 -1
- package/dist/util/document.cjs +8 -10
- package/dist/util/document.cjs.map +1 -1
- package/dist/util/document.js +1 -2
- package/dist/util/document.js.map +1 -1
- package/dist/util/entrypoint_deprecation.cjs +1 -1
- package/dist/util/entrypoint_deprecation.js +1 -2
- package/dist/util/env.cjs +2 -2
- package/dist/util/env.js +1 -2
- package/dist/util/extname.cjs +1 -2
- package/dist/util/extname.cjs.map +1 -1
- package/dist/util/extname.js +1 -1
- package/dist/util/hub.cjs +4 -5
- package/dist/util/hub.cjs.map +1 -1
- package/dist/util/hub.js +1 -2
- package/dist/util/hub.js.map +1 -1
- package/dist/util/is-network-error/index.cjs +1 -2
- package/dist/util/is-network-error/index.cjs.map +1 -1
- package/dist/util/is-network-error/index.js +1 -1
- package/dist/util/is-network-error/index.js.map +1 -1
- package/dist/util/load.cjs +1 -2
- package/dist/util/load.cjs.map +1 -1
- package/dist/util/load.js +1 -1
- package/dist/util/math.cjs +14 -14
- package/dist/util/math.js +2 -4
- package/dist/util/ml-distance/distances.cjs +1 -2
- package/dist/util/ml-distance/distances.cjs.map +1 -1
- package/dist/util/ml-distance/distances.js +1 -1
- package/dist/util/ml-distance/similarities.cjs +1 -2
- package/dist/util/ml-distance/similarities.cjs.map +1 -1
- package/dist/util/ml-distance/similarities.js +1 -1
- package/dist/util/ml-distance-euclidean/euclidean.cjs +1 -2
- package/dist/util/ml-distance-euclidean/euclidean.cjs.map +1 -1
- package/dist/util/ml-distance-euclidean/euclidean.js +1 -1
- package/dist/util/openapi.cjs +2 -3
- package/dist/util/openapi.cjs.map +1 -1
- package/dist/util/openapi.js +1 -2
- package/dist/util/openapi.js.map +1 -1
- package/dist/util/p-retry/index.cjs +2 -3
- package/dist/util/p-retry/index.cjs.map +1 -1
- package/dist/util/p-retry/index.js +1 -2
- package/dist/util/p-retry/index.js.map +1 -1
- package/dist/util/parse.cjs +3 -4
- package/dist/util/parse.cjs.map +1 -1
- package/dist/util/parse.js +1 -2
- package/dist/util/parse.js.map +1 -1
- package/dist/util/set.cjs +1 -2
- package/dist/util/set.cjs.map +1 -1
- package/dist/util/set.js +1 -1
- package/dist/util/sql_utils.cjs +2 -3
- package/dist/util/sql_utils.cjs.map +1 -1
- package/dist/util/sql_utils.js +1 -2
- package/dist/util/sql_utils.js.map +1 -1
- package/dist/util/time.cjs +8 -10
- package/dist/util/time.cjs.map +1 -1
- package/dist/util/time.js +1 -2
- package/dist/util/time.js.map +1 -1
- package/dist/vectorstores/memory.cjs +9 -10
- package/dist/vectorstores/memory.cjs.map +1 -1
- package/dist/vectorstores/memory.js +1 -2
- package/dist/vectorstores/memory.js.map +1 -1
- package/package.json +21 -17
- package/agents/format_scratchpad/log.cjs +0 -1
- package/agents/format_scratchpad/log.d.cts +0 -1
- package/agents/format_scratchpad/log.d.ts +0 -1
- package/agents/format_scratchpad/log.js +0 -1
- package/agents/format_scratchpad/log_to_message.cjs +0 -1
- package/agents/format_scratchpad/log_to_message.d.cts +0 -1
- package/agents/format_scratchpad/log_to_message.d.ts +0 -1
- package/agents/format_scratchpad/log_to_message.js +0 -1
- package/agents/format_scratchpad/openai_functions.cjs +0 -1
- package/agents/format_scratchpad/openai_functions.d.cts +0 -1
- package/agents/format_scratchpad/openai_functions.d.ts +0 -1
- package/agents/format_scratchpad/openai_functions.js +0 -1
- package/agents/format_scratchpad/openai_tools.cjs +0 -1
- package/agents/format_scratchpad/openai_tools.d.cts +0 -1
- package/agents/format_scratchpad/openai_tools.d.ts +0 -1
- package/agents/format_scratchpad/openai_tools.js +0 -1
- package/agents/format_scratchpad/xml.cjs +0 -1
- package/agents/format_scratchpad/xml.d.cts +0 -1
- package/agents/format_scratchpad/xml.d.ts +0 -1
- package/agents/format_scratchpad/xml.js +0 -1
- package/agents/load.cjs +0 -1
- package/agents/load.d.cts +0 -1
- package/agents/load.d.ts +0 -1
- package/agents/load.js +0 -1
- package/agents/openai/output_parser.cjs +0 -1
- package/agents/openai/output_parser.d.cts +0 -1
- package/agents/openai/output_parser.d.ts +0 -1
- package/agents/openai/output_parser.js +0 -1
- package/agents/react/output_parser.cjs +0 -1
- package/agents/react/output_parser.d.cts +0 -1
- package/agents/react/output_parser.d.ts +0 -1
- package/agents/react/output_parser.js +0 -1
- package/agents/toolkits/sql.cjs +0 -1
- package/agents/toolkits/sql.d.cts +0 -1
- package/agents/toolkits/sql.d.ts +0 -1
- package/agents/toolkits/sql.js +0 -1
- package/agents/toolkits.cjs +0 -1
- package/agents/toolkits.d.cts +0 -1
- package/agents/toolkits.d.ts +0 -1
- package/agents/toolkits.js +0 -1
- package/agents/xml/output_parser.cjs +0 -1
- package/agents/xml/output_parser.d.cts +0 -1
- package/agents/xml/output_parser.d.ts +0 -1
- package/agents/xml/output_parser.js +0 -1
- package/agents.cjs +0 -1
- package/agents.d.cts +0 -1
- package/agents.d.ts +0 -1
- package/agents.js +0 -1
- package/cache/file_system.cjs +0 -1
- package/cache/file_system.d.cts +0 -1
- package/cache/file_system.d.ts +0 -1
- package/cache/file_system.js +0 -1
- package/callbacks.cjs +0 -1
- package/callbacks.d.cts +0 -1
- package/callbacks.d.ts +0 -1
- package/callbacks.js +0 -1
- package/chains/combine_documents/reduce.cjs +0 -1
- package/chains/combine_documents/reduce.d.cts +0 -1
- package/chains/combine_documents/reduce.d.ts +0 -1
- package/chains/combine_documents/reduce.js +0 -1
- package/chains/combine_documents.cjs +0 -1
- package/chains/combine_documents.d.cts +0 -1
- package/chains/combine_documents.d.ts +0 -1
- package/chains/combine_documents.js +0 -1
- package/chains/graph_qa/cypher.cjs +0 -1
- package/chains/graph_qa/cypher.d.cts +0 -1
- package/chains/graph_qa/cypher.d.ts +0 -1
- package/chains/graph_qa/cypher.js +0 -1
- package/chains/history_aware_retriever.cjs +0 -1
- package/chains/history_aware_retriever.d.cts +0 -1
- package/chains/history_aware_retriever.d.ts +0 -1
- package/chains/history_aware_retriever.js +0 -1
- package/chains/load.cjs +0 -1
- package/chains/load.d.cts +0 -1
- package/chains/load.d.ts +0 -1
- package/chains/load.js +0 -1
- package/chains/openai_functions.cjs +0 -1
- package/chains/openai_functions.d.cts +0 -1
- package/chains/openai_functions.d.ts +0 -1
- package/chains/openai_functions.js +0 -1
- package/chains/query_constructor/ir.cjs +0 -1
- package/chains/query_constructor/ir.d.cts +0 -1
- package/chains/query_constructor/ir.d.ts +0 -1
- package/chains/query_constructor/ir.js +0 -1
- package/chains/query_constructor.cjs +0 -1
- package/chains/query_constructor.d.cts +0 -1
- package/chains/query_constructor.d.ts +0 -1
- package/chains/query_constructor.js +0 -1
- package/chains/retrieval.cjs +0 -1
- package/chains/retrieval.d.cts +0 -1
- package/chains/retrieval.d.ts +0 -1
- package/chains/retrieval.js +0 -1
- package/chains/sql_db.cjs +0 -1
- package/chains/sql_db.d.cts +0 -1
- package/chains/sql_db.d.ts +0 -1
- package/chains/sql_db.js +0 -1
- package/chains.cjs +0 -1
- package/chains.d.cts +0 -1
- package/chains.d.ts +0 -1
- package/chains.js +0 -1
- package/chat_models/universal.cjs +0 -1
- package/chat_models/universal.d.cts +0 -1
- package/chat_models/universal.d.ts +0 -1
- package/chat_models/universal.js +0 -1
- package/document.cjs +0 -1
- package/document.d.cts +0 -1
- package/document.d.ts +0 -1
- package/document.js +0 -1
- package/document_loaders/base.cjs +0 -1
- package/document_loaders/base.d.cts +0 -1
- package/document_loaders/base.d.ts +0 -1
- package/document_loaders/base.js +0 -1
- package/document_loaders/fs/buffer.cjs +0 -1
- package/document_loaders/fs/buffer.d.cts +0 -1
- package/document_loaders/fs/buffer.d.ts +0 -1
- package/document_loaders/fs/buffer.js +0 -1
- package/document_loaders/fs/directory.cjs +0 -1
- package/document_loaders/fs/directory.d.cts +0 -1
- package/document_loaders/fs/directory.d.ts +0 -1
- package/document_loaders/fs/directory.js +0 -1
- package/document_loaders/fs/json.cjs +0 -1
- package/document_loaders/fs/json.d.cts +0 -1
- package/document_loaders/fs/json.d.ts +0 -1
- package/document_loaders/fs/json.js +0 -1
- package/document_loaders/fs/multi_file.cjs +0 -1
- package/document_loaders/fs/multi_file.d.cts +0 -1
- package/document_loaders/fs/multi_file.d.ts +0 -1
- package/document_loaders/fs/multi_file.js +0 -1
- package/document_loaders/fs/text.cjs +0 -1
- package/document_loaders/fs/text.d.cts +0 -1
- package/document_loaders/fs/text.d.ts +0 -1
- package/document_loaders/fs/text.js +0 -1
- package/document_transformers/openai_functions.cjs +0 -1
- package/document_transformers/openai_functions.d.cts +0 -1
- package/document_transformers/openai_functions.d.ts +0 -1
- package/document_transformers/openai_functions.js +0 -1
- package/embeddings/cache_backed.cjs +0 -1
- package/embeddings/cache_backed.d.cts +0 -1
- package/embeddings/cache_backed.d.ts +0 -1
- package/embeddings/cache_backed.js +0 -1
- package/embeddings/fake.cjs +0 -1
- package/embeddings/fake.d.cts +0 -1
- package/embeddings/fake.d.ts +0 -1
- package/embeddings/fake.js +0 -1
- package/evaluation.cjs +0 -1
- package/evaluation.d.cts +0 -1
- package/evaluation.d.ts +0 -1
- package/evaluation.js +0 -1
- package/experimental/autogpt.cjs +0 -1
- package/experimental/autogpt.d.cts +0 -1
- package/experimental/autogpt.d.ts +0 -1
- package/experimental/autogpt.js +0 -1
- package/experimental/babyagi.cjs +0 -1
- package/experimental/babyagi.d.cts +0 -1
- package/experimental/babyagi.d.ts +0 -1
- package/experimental/babyagi.js +0 -1
- package/experimental/chains/violation_of_expectations.cjs +0 -1
- package/experimental/chains/violation_of_expectations.d.cts +0 -1
- package/experimental/chains/violation_of_expectations.d.ts +0 -1
- package/experimental/chains/violation_of_expectations.js +0 -1
- package/experimental/generative_agents.cjs +0 -1
- package/experimental/generative_agents.d.cts +0 -1
- package/experimental/generative_agents.d.ts +0 -1
- package/experimental/generative_agents.js +0 -1
- package/experimental/masking.cjs +0 -1
- package/experimental/masking.d.cts +0 -1
- package/experimental/masking.d.ts +0 -1
- package/experimental/masking.js +0 -1
- package/experimental/openai_assistant.cjs +0 -1
- package/experimental/openai_assistant.d.cts +0 -1
- package/experimental/openai_assistant.d.ts +0 -1
- package/experimental/openai_assistant.js +0 -1
- package/experimental/openai_files.cjs +0 -1
- package/experimental/openai_files.d.cts +0 -1
- package/experimental/openai_files.d.ts +0 -1
- package/experimental/openai_files.js +0 -1
- package/experimental/plan_and_execute.cjs +0 -1
- package/experimental/plan_and_execute.d.cts +0 -1
- package/experimental/plan_and_execute.d.ts +0 -1
- package/experimental/plan_and_execute.js +0 -1
- package/experimental/prompts/custom_format.cjs +0 -1
- package/experimental/prompts/custom_format.d.cts +0 -1
- package/experimental/prompts/custom_format.d.ts +0 -1
- package/experimental/prompts/custom_format.js +0 -1
- package/experimental/prompts/handlebars.cjs +0 -1
- package/experimental/prompts/handlebars.d.cts +0 -1
- package/experimental/prompts/handlebars.d.ts +0 -1
- package/experimental/prompts/handlebars.js +0 -1
- package/hub/node.cjs +0 -1
- package/hub/node.d.cts +0 -1
- package/hub/node.d.ts +0 -1
- package/hub/node.js +0 -1
- package/hub.cjs +0 -1
- package/hub.d.cts +0 -1
- package/hub.d.ts +0 -1
- package/hub.js +0 -1
- package/indexes.cjs +0 -1
- package/indexes.d.cts +0 -1
- package/indexes.d.ts +0 -1
- package/indexes.js +0 -1
- package/load/serializable.cjs +0 -1
- package/load/serializable.d.cts +0 -1
- package/load/serializable.d.ts +0 -1
- package/load/serializable.js +0 -1
- package/load.cjs +0 -1
- package/load.d.cts +0 -1
- package/load.d.ts +0 -1
- package/load.js +0 -1
- package/memory/chat_memory.cjs +0 -1
- package/memory/chat_memory.d.cts +0 -1
- package/memory/chat_memory.d.ts +0 -1
- package/memory/chat_memory.js +0 -1
- package/memory.cjs +0 -1
- package/memory.d.cts +0 -1
- package/memory.d.ts +0 -1
- package/memory.js +0 -1
- package/output_parsers/expression.cjs +0 -1
- package/output_parsers/expression.d.cts +0 -1
- package/output_parsers/expression.d.ts +0 -1
- package/output_parsers/expression.js +0 -1
- package/output_parsers.cjs +0 -1
- package/output_parsers.d.cts +0 -1
- package/output_parsers.d.ts +0 -1
- package/output_parsers.js +0 -1
- package/retrievers/contextual_compression.cjs +0 -1
- package/retrievers/contextual_compression.d.cts +0 -1
- package/retrievers/contextual_compression.d.ts +0 -1
- package/retrievers/contextual_compression.js +0 -1
- package/retrievers/document_compressors/chain_extract.cjs +0 -1
- package/retrievers/document_compressors/chain_extract.d.cts +0 -1
- package/retrievers/document_compressors/chain_extract.d.ts +0 -1
- package/retrievers/document_compressors/chain_extract.js +0 -1
- package/retrievers/document_compressors/embeddings_filter.cjs +0 -1
- package/retrievers/document_compressors/embeddings_filter.d.cts +0 -1
- package/retrievers/document_compressors/embeddings_filter.d.ts +0 -1
- package/retrievers/document_compressors/embeddings_filter.js +0 -1
- package/retrievers/document_compressors.cjs +0 -1
- package/retrievers/document_compressors.d.cts +0 -1
- package/retrievers/document_compressors.d.ts +0 -1
- package/retrievers/document_compressors.js +0 -1
- package/retrievers/ensemble.cjs +0 -1
- package/retrievers/ensemble.d.cts +0 -1
- package/retrievers/ensemble.d.ts +0 -1
- package/retrievers/ensemble.js +0 -1
- package/retrievers/hyde.cjs +0 -1
- package/retrievers/hyde.d.cts +0 -1
- package/retrievers/hyde.d.ts +0 -1
- package/retrievers/hyde.js +0 -1
- package/retrievers/matryoshka_retriever.cjs +0 -1
- package/retrievers/matryoshka_retriever.d.cts +0 -1
- package/retrievers/matryoshka_retriever.d.ts +0 -1
- package/retrievers/matryoshka_retriever.js +0 -1
- package/retrievers/multi_query.cjs +0 -1
- package/retrievers/multi_query.d.cts +0 -1
- package/retrievers/multi_query.d.ts +0 -1
- package/retrievers/multi_query.js +0 -1
- package/retrievers/multi_vector.cjs +0 -1
- package/retrievers/multi_vector.d.cts +0 -1
- package/retrievers/multi_vector.d.ts +0 -1
- package/retrievers/multi_vector.js +0 -1
- package/retrievers/parent_document.cjs +0 -1
- package/retrievers/parent_document.d.cts +0 -1
- package/retrievers/parent_document.d.ts +0 -1
- package/retrievers/parent_document.js +0 -1
- package/retrievers/score_threshold.cjs +0 -1
- package/retrievers/score_threshold.d.cts +0 -1
- package/retrievers/score_threshold.d.ts +0 -1
- package/retrievers/score_threshold.js +0 -1
- package/retrievers/self_query/functional.cjs +0 -1
- package/retrievers/self_query/functional.d.cts +0 -1
- package/retrievers/self_query/functional.d.ts +0 -1
- package/retrievers/self_query/functional.js +0 -1
- package/retrievers/self_query.cjs +0 -1
- package/retrievers/self_query.d.cts +0 -1
- package/retrievers/self_query.d.ts +0 -1
- package/retrievers/self_query.js +0 -1
- package/retrievers/time_weighted.cjs +0 -1
- package/retrievers/time_weighted.d.cts +0 -1
- package/retrievers/time_weighted.d.ts +0 -1
- package/retrievers/time_weighted.js +0 -1
- package/schema/prompt_template.cjs +0 -1
- package/schema/prompt_template.d.cts +0 -1
- package/schema/prompt_template.d.ts +0 -1
- package/schema/prompt_template.js +0 -1
- package/schema/query_constructor.cjs +0 -1
- package/schema/query_constructor.d.cts +0 -1
- package/schema/query_constructor.d.ts +0 -1
- package/schema/query_constructor.js +0 -1
- package/smith.cjs +0 -1
- package/smith.d.cts +0 -1
- package/smith.d.ts +0 -1
- package/smith.js +0 -1
- package/sql_db.cjs +0 -1
- package/sql_db.d.cts +0 -1
- package/sql_db.d.ts +0 -1
- package/sql_db.js +0 -1
- package/storage/encoder_backed.cjs +0 -1
- package/storage/encoder_backed.d.cts +0 -1
- package/storage/encoder_backed.d.ts +0 -1
- package/storage/encoder_backed.js +0 -1
- package/storage/file_system.cjs +0 -1
- package/storage/file_system.d.cts +0 -1
- package/storage/file_system.d.ts +0 -1
- package/storage/file_system.js +0 -1
- package/storage/in_memory.cjs +0 -1
- package/storage/in_memory.d.cts +0 -1
- package/storage/in_memory.d.ts +0 -1
- package/storage/in_memory.js +0 -1
- package/stores/doc/base.cjs +0 -1
- package/stores/doc/base.d.cts +0 -1
- package/stores/doc/base.d.ts +0 -1
- package/stores/doc/base.js +0 -1
- package/stores/doc/in_memory.cjs +0 -1
- package/stores/doc/in_memory.d.cts +0 -1
- package/stores/doc/in_memory.d.ts +0 -1
- package/stores/doc/in_memory.js +0 -1
- package/stores/file/in_memory.cjs +0 -1
- package/stores/file/in_memory.d.cts +0 -1
- package/stores/file/in_memory.d.ts +0 -1
- package/stores/file/in_memory.js +0 -1
- package/stores/file/node.cjs +0 -1
- package/stores/file/node.d.cts +0 -1
- package/stores/file/node.d.ts +0 -1
- package/stores/file/node.js +0 -1
- package/stores/message/in_memory.cjs +0 -1
- package/stores/message/in_memory.d.cts +0 -1
- package/stores/message/in_memory.d.ts +0 -1
- package/stores/message/in_memory.js +0 -1
- package/text_splitter.cjs +0 -1
- package/text_splitter.d.cts +0 -1
- package/text_splitter.d.ts +0 -1
- package/text_splitter.js +0 -1
- package/tools/chain.cjs +0 -1
- package/tools/chain.d.cts +0 -1
- package/tools/chain.d.ts +0 -1
- package/tools/chain.js +0 -1
- package/tools/render.cjs +0 -1
- package/tools/render.d.cts +0 -1
- package/tools/render.d.ts +0 -1
- package/tools/render.js +0 -1
- package/tools/retriever.cjs +0 -1
- package/tools/retriever.d.cts +0 -1
- package/tools/retriever.d.ts +0 -1
- package/tools/retriever.js +0 -1
- package/tools/sql.cjs +0 -1
- package/tools/sql.d.cts +0 -1
- package/tools/sql.d.ts +0 -1
- package/tools/sql.js +0 -1
- package/tools/webbrowser.cjs +0 -1
- package/tools/webbrowser.d.cts +0 -1
- package/tools/webbrowser.d.ts +0 -1
- package/tools/webbrowser.js +0 -1
- package/tools.cjs +0 -1
- package/tools.d.cts +0 -1
- package/tools.d.ts +0 -1
- package/tools.js +0 -1
- package/util/document.cjs +0 -1
- package/util/document.d.cts +0 -1
- package/util/document.d.ts +0 -1
- package/util/document.js +0 -1
- package/util/math.cjs +0 -1
- package/util/math.d.cts +0 -1
- package/util/math.d.ts +0 -1
- package/util/math.js +0 -1
- package/util/time.cjs +0 -1
- package/util/time.d.cts +0 -1
- package/util/time.d.ts +0 -1
- package/util/time.js +0 -1
- package/vectorstores/memory.cjs +0 -1
- package/vectorstores/memory.d.cts +0 -1
- package/vectorstores/memory.d.ts +0 -1
- package/vectorstores/memory.js +0 -1
package/dist/load/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n *\n * **WARNING — insecure deserialization risk.** This function instantiates\n * classes and invokes constructors based on the contents of `text`. Never\n * call this on untrusted or user-supplied input. Only deserialize data that\n * originates from a trusted source you control.\n *\n * See `@langchain/core/load` {@link LoadOptions} for detailed security\n * guidance on `secretsFromEnv`, `secretsMap`, and import maps.\n *\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n *\n * **WARNING — insecure deserialization risk.** This function instantiates\n * classes and invokes constructors based on the contents of `text`. Never\n * call this on untrusted or user-supplied input. Only deserialize data that\n * originates from a trusted source you control.\n *\n * See `@langchain/core/load` {@link LoadOptions} for detailed security\n * guidance on `secretsFromEnv`, `secretsMap`, and import maps.\n *\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,eAAsB,KACpB,MAEA,aAAkC,EAAE,EAEpC,qBAA8D,EAAE,EAEhE,uBAA4C,EAAE,EAC9C,gBACY;AACZ,SAAA,GAAA,qBAAA,MAAgB,MAAM;EACpB;EACA;EACA,2BAAA,yBAAA;EACA,WAAW;GAAE,GAAGA,mBAAAA;GAAW,GAAG;GAAsB;EACpD;EACD,CAAC"}
|
package/dist/load/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { optionalImportEntrypoints } from "./import_constants.js";
|
|
2
2
|
import { import_map_exports } from "./import_map.js";
|
|
3
3
|
import { load as load$1 } from "@langchain/core/load";
|
|
4
|
-
|
|
5
4
|
//#region src/load/index.ts
|
|
6
5
|
/**
|
|
7
6
|
* Load a LangChain module from a serialized text representation.
|
|
@@ -33,7 +32,7 @@ async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalIm
|
|
|
33
32
|
secretsFromEnv
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
//#endregion
|
|
38
36
|
export { load };
|
|
37
|
+
|
|
39
38
|
//# sourceMappingURL=index.js.map
|
package/dist/load/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["coreLoad","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n *\n * **WARNING — insecure deserialization risk.** This function instantiates\n * classes and invokes constructors based on the contents of `text`. Never\n * call this on untrusted or user-supplied input. Only deserialize data that\n * originates from a trusted source you control.\n *\n * See `@langchain/core/load` {@link LoadOptions} for detailed security\n * guidance on `secretsFromEnv`, `secretsMap`, and import maps.\n *\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["coreLoad","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n *\n * **WARNING — insecure deserialization risk.** This function instantiates\n * classes and invokes constructors based on the contents of `text`. Never\n * call this on untrusted or user-supplied input. Only deserialize data that\n * originates from a trusted source you control.\n *\n * See `@langchain/core/load` {@link LoadOptions} for detailed security\n * guidance on `secretsFromEnv`, `secretsMap`, and import maps.\n *\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,eAAsB,KACpB,MAEA,aAAkC,EAAE,EAEpC,qBAA8D,EAAE,EAEhE,uBAA4C,EAAE,EAC9C,gBACY;AACZ,QAAOA,OAAS,MAAM;EACpB;EACA;EACA;EACA,WAAW;GAAE,GAAGC;GAAW,GAAG;GAAsB;EACpD;EACD,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
4
3
|
//#region src/load/serializable.ts
|
|
5
4
|
var serializable_exports = /* @__PURE__ */ require_runtime.__exportAll({});
|
|
6
5
|
require_runtime.__reExport(serializable_exports, require("@langchain/core/load/serializable"));
|
|
7
|
-
|
|
8
6
|
//#endregion
|
|
9
|
-
Object.defineProperty(exports,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
Object.defineProperty(exports, "serializable_exports", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function() {
|
|
10
|
+
return serializable_exports;
|
|
11
|
+
}
|
|
14
12
|
});
|
|
15
13
|
var _langchain_core_load_serializable = require("@langchain/core/load/serializable");
|
|
16
|
-
Object.keys(_langchain_core_load_serializable).forEach(function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
Object.keys(_langchain_core_load_serializable).forEach(function(k) {
|
|
15
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return _langchain_core_load_serializable[k];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=serializable.cjs.map
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { __exportAll, __reExport } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
|
|
3
|
-
export * from "@langchain/core/load/serializable"
|
|
4
|
-
|
|
2
|
+
export * from "@langchain/core/load/serializable";
|
|
5
3
|
//#region src/load/serializable.ts
|
|
6
4
|
var serializable_exports = /* @__PURE__ */ __exportAll({});
|
|
7
5
|
import * as import__langchain_core_load_serializable from "@langchain/core/load/serializable";
|
|
8
6
|
__reExport(serializable_exports, import__langchain_core_load_serializable);
|
|
9
|
-
|
|
10
7
|
//#endregion
|
|
11
8
|
export { serializable_exports };
|
|
9
|
+
|
|
12
10
|
//# sourceMappingURL=serializable.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_memory_chat_memory = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_memory_chat_memory = require("./chat_memory.cjs");
|
|
3
3
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
4
|
-
|
|
5
4
|
//#region src/memory/buffer_memory.ts
|
|
6
5
|
/**
|
|
7
6
|
* The `BufferMemory` class is a type of memory component used for storing
|
|
@@ -70,7 +69,7 @@ var BufferMemory = class extends require_memory_chat_memory.BaseChatMemory {
|
|
|
70
69
|
return { [this.memoryKey]: (0, _langchain_core_messages.getBufferString)(messages, this.humanPrefix, this.aiPrefix) };
|
|
71
70
|
}
|
|
72
71
|
};
|
|
73
|
-
|
|
74
72
|
//#endregion
|
|
75
73
|
exports.BufferMemory = BufferMemory;
|
|
74
|
+
|
|
76
75
|
//# sourceMappingURL=buffer_memory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferMemory` class.\n */\nexport interface BufferMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * The `BufferMemory` class is a type of memory component used for storing\n * and managing previous chat messages. It is a wrapper around\n * `ChatMessageHistory` that extracts the messages into an input variable.\n * This class is particularly useful in applications like chatbots where\n * it is essential to remember previous interactions. Note: The memory\n * instance represents the history of a single conversation. Therefore, it\n * is not recommended to share the same history or memory instance between\n * two different chains. If you deploy your LangChain app on a serverless\n * environment, do not store memory instances in a variable, as your\n * hosting provider may reset it by the next time the function is called.\n * @example\n * ```typescript\n * // Initialize the memory to store chat history and set up the language model with a specific temperature.\n * const memory = new BufferMemory({ memoryKey: \"chat_history\" });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n *\n * // Create a prompt template for a friendly conversation between a human and an AI.\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * // Set up the chain with the language model, prompt, and memory.\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * // Example usage of the chain to continue the conversation.\n * // The `call` method sends the input to the model and returns the AI's response.\n * const res = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res });\n *\n * ```\n */\nexport class BufferMemory extends BaseChatMemory implements BufferMemoryInput {\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n constructor(fields?: BufferMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferMemory` class.\n */\nexport interface BufferMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * The `BufferMemory` class is a type of memory component used for storing\n * and managing previous chat messages. It is a wrapper around\n * `ChatMessageHistory` that extracts the messages into an input variable.\n * This class is particularly useful in applications like chatbots where\n * it is essential to remember previous interactions. Note: The memory\n * instance represents the history of a single conversation. Therefore, it\n * is not recommended to share the same history or memory instance between\n * two different chains. If you deploy your LangChain app on a serverless\n * environment, do not store memory instances in a variable, as your\n * hosting provider may reset it by the next time the function is called.\n * @example\n * ```typescript\n * // Initialize the memory to store chat history and set up the language model with a specific temperature.\n * const memory = new BufferMemory({ memoryKey: \"chat_history\" });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n *\n * // Create a prompt template for a friendly conversation between a human and an AI.\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * // Set up the chain with the language model, prompt, and memory.\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * // Example usage of the chain to continue the conversation.\n * // The `call` method sends the input to the model and returns the AI's response.\n * const res = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res });\n *\n * ```\n */\nexport class BufferMemory extends BaseChatMemory implements BufferMemoryInput {\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n constructor(fields?: BufferMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa,eAAb,cAAkCA,2BAAAA,eAA4C;CAC5E,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,YAAY,QAA4B;AACtC,QAAM;GACJ,aAAa,QAAQ;GACrB,gBAAgB,QAAQ,kBAAkB;GAC1C,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AACF,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;;CAG7C,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;CAUzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,UACnB;AAUH,SAPe,GACZ,KAAK,aAAA,GAAA,yBAAA,iBACJ,UACA,KAAK,aACL,KAAK,SACN,EACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseChatMemory } from "./chat_memory.js";
|
|
2
2
|
import { getBufferString } from "@langchain/core/messages";
|
|
3
|
-
|
|
4
3
|
//#region src/memory/buffer_memory.ts
|
|
5
4
|
/**
|
|
6
5
|
* The `BufferMemory` class is a type of memory component used for storing
|
|
@@ -69,7 +68,7 @@ var BufferMemory = class extends BaseChatMemory {
|
|
|
69
68
|
return { [this.memoryKey]: getBufferString(messages, this.humanPrefix, this.aiPrefix) };
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
export { BufferMemory };
|
|
73
|
+
|
|
75
74
|
//# sourceMappingURL=buffer_memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_memory.js","names":[],"sources":["../../src/memory/buffer_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferMemory` class.\n */\nexport interface BufferMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * The `BufferMemory` class is a type of memory component used for storing\n * and managing previous chat messages. It is a wrapper around\n * `ChatMessageHistory` that extracts the messages into an input variable.\n * This class is particularly useful in applications like chatbots where\n * it is essential to remember previous interactions. Note: The memory\n * instance represents the history of a single conversation. Therefore, it\n * is not recommended to share the same history or memory instance between\n * two different chains. If you deploy your LangChain app on a serverless\n * environment, do not store memory instances in a variable, as your\n * hosting provider may reset it by the next time the function is called.\n * @example\n * ```typescript\n * // Initialize the memory to store chat history and set up the language model with a specific temperature.\n * const memory = new BufferMemory({ memoryKey: \"chat_history\" });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n *\n * // Create a prompt template for a friendly conversation between a human and an AI.\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * // Set up the chain with the language model, prompt, and memory.\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * // Example usage of the chain to continue the conversation.\n * // The `call` method sends the input to the model and returns the AI's response.\n * const res = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res });\n *\n * ```\n */\nexport class BufferMemory extends BaseChatMemory implements BufferMemoryInput {\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n constructor(fields?: BufferMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_memory.js","names":[],"sources":["../../src/memory/buffer_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferMemory` class.\n */\nexport interface BufferMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * The `BufferMemory` class is a type of memory component used for storing\n * and managing previous chat messages. It is a wrapper around\n * `ChatMessageHistory` that extracts the messages into an input variable.\n * This class is particularly useful in applications like chatbots where\n * it is essential to remember previous interactions. Note: The memory\n * instance represents the history of a single conversation. Therefore, it\n * is not recommended to share the same history or memory instance between\n * two different chains. If you deploy your LangChain app on a serverless\n * environment, do not store memory instances in a variable, as your\n * hosting provider may reset it by the next time the function is called.\n * @example\n * ```typescript\n * // Initialize the memory to store chat history and set up the language model with a specific temperature.\n * const memory = new BufferMemory({ memoryKey: \"chat_history\" });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n *\n * // Create a prompt template for a friendly conversation between a human and an AI.\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * // Set up the chain with the language model, prompt, and memory.\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * // Example usage of the chain to continue the conversation.\n * // The `call` method sends the input to the model and returns the AI's response.\n * const res = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res });\n *\n * ```\n */\nexport class BufferMemory extends BaseChatMemory implements BufferMemoryInput {\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n constructor(fields?: BufferMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa,eAAb,cAAkC,eAA4C;CAC5E,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,YAAY,QAA4B;AACtC,QAAM;GACJ,aAAa,QAAQ;GACrB,gBAAgB,QAAQ,kBAAkB;GAC1C,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AACF,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;;CAG7C,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;CAUzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,UACnB;AAUH,SAPe,GACZ,KAAK,YAAY,gBAChB,UACA,KAAK,aACL,KAAK,SACN,EACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_memory_chat_memory = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_memory_chat_memory = require("./chat_memory.cjs");
|
|
3
3
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
4
|
-
|
|
5
4
|
//#region src/memory/buffer_token_memory.ts
|
|
6
5
|
/**
|
|
7
6
|
* Class that represents a conversation chat memory with a token buffer.
|
|
@@ -70,7 +69,7 @@ var ConversationTokenBufferMemory = class extends require_memory_chat_memory.Bas
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
};
|
|
73
|
-
|
|
74
72
|
//#endregion
|
|
75
73
|
exports.ConversationTokenBufferMemory = ConversationTokenBufferMemory;
|
|
74
|
+
|
|
76
75
|
//# sourceMappingURL=buffer_token_memory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_token_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_token_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferTokenMemory` class.\n */\n\nexport interface ConversationTokenBufferMemoryInput extends BaseChatMemoryInput {\n /* Prefix for human messages in the buffer. */\n humanPrefix?: string;\n\n /* Prefix for AI messages in the buffer. */\n aiPrefix?: string;\n\n /* The LLM for this instance. */\n llm: BaseLanguageModelInterface;\n\n /* Memory key for buffer instance. */\n memoryKey?: string;\n\n /* Maximmum number of tokens allowed in the buffer. */\n maxTokenLimit?: number;\n}\n\n/**\n * Class that represents a conversation chat memory with a token buffer.\n * It extends the `BaseChatMemory` class and implements the\n * `ConversationTokenBufferMemoryInput` interface.\n * @example\n * ```typescript\n * const memory = new ConversationTokenBufferMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * maxTokenLimit: 10,\n * });\n *\n * // Save conversation context\n * await memory.saveContext({ input: \"hi\" }, { output: \"whats up\" });\n * await memory.saveContext({ input: \"not much you\" }, { output: \"not much\" });\n *\n * // Load memory variables\n * const result = await memory.loadMemoryVariables({});\n * console.log(result);\n * ```\n */\n\nexport class ConversationTokenBufferMemory\n extends BaseChatMemory\n implements ConversationTokenBufferMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n maxTokenLimit = 2000; // Default max token limit of 2000 which can be overridden\n\n llm: BaseLanguageModelInterface;\n\n constructor(fields: ConversationTokenBufferMemoryInput) {\n super(fields);\n this.llm = fields.llm;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.maxTokenLimit = fields?.maxTokenLimit ?? this.maxTokenLimit;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n\n /**\n * Saves the context from this conversation to buffer. If the amount\n * of tokens required to save the buffer exceeds MAX_TOKEN_LIMIT,\n * prune it.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n await super.saveContext(inputValues, outputValues);\n\n // Prune buffer if it exceeds the max token limit set for this instance.\n const buffer = await this.chatHistory.getMessages();\n let currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n\n if (currBufferLength > this.maxTokenLimit) {\n const prunedMemory = [];\n while (currBufferLength > this.maxTokenLimit) {\n prunedMemory.push(buffer.shift());\n currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n }\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_token_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_token_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferTokenMemory` class.\n */\n\nexport interface ConversationTokenBufferMemoryInput extends BaseChatMemoryInput {\n /* Prefix for human messages in the buffer. */\n humanPrefix?: string;\n\n /* Prefix for AI messages in the buffer. */\n aiPrefix?: string;\n\n /* The LLM for this instance. */\n llm: BaseLanguageModelInterface;\n\n /* Memory key for buffer instance. */\n memoryKey?: string;\n\n /* Maximmum number of tokens allowed in the buffer. */\n maxTokenLimit?: number;\n}\n\n/**\n * Class that represents a conversation chat memory with a token buffer.\n * It extends the `BaseChatMemory` class and implements the\n * `ConversationTokenBufferMemoryInput` interface.\n * @example\n * ```typescript\n * const memory = new ConversationTokenBufferMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * maxTokenLimit: 10,\n * });\n *\n * // Save conversation context\n * await memory.saveContext({ input: \"hi\" }, { output: \"whats up\" });\n * await memory.saveContext({ input: \"not much you\" }, { output: \"not much\" });\n *\n * // Load memory variables\n * const result = await memory.loadMemoryVariables({});\n * console.log(result);\n * ```\n */\n\nexport class ConversationTokenBufferMemory\n extends BaseChatMemory\n implements ConversationTokenBufferMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n maxTokenLimit = 2000; // Default max token limit of 2000 which can be overridden\n\n llm: BaseLanguageModelInterface;\n\n constructor(fields: ConversationTokenBufferMemoryInput) {\n super(fields);\n this.llm = fields.llm;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.maxTokenLimit = fields?.maxTokenLimit ?? this.maxTokenLimit;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n\n /**\n * Saves the context from this conversation to buffer. If the amount\n * of tokens required to save the buffer exceeds MAX_TOKEN_LIMIT,\n * prune it.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n await super.saveContext(inputValues, outputValues);\n\n // Prune buffer if it exceeds the max token limit set for this instance.\n const buffer = await this.chatHistory.getMessages();\n let currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n\n if (currBufferLength > this.maxTokenLimit) {\n const prunedMemory = [];\n while (currBufferLength > this.maxTokenLimit) {\n prunedMemory.push(buffer.shift());\n currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,gCAAb,cACUA,2BAAAA,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,gBAAgB;CAEhB;CAEA,YAAY,QAA4C;AACtD,QAAM,OAAO;AACb,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,gBAAgB,QAAQ,iBAAiB,KAAK;;CAGrD,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;CAUzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,UACnB;AAUH,SAPe,GACZ,KAAK,aAAA,GAAA,yBAAA,iBACJ,UACA,KAAK,aACL,KAAK,SACN,EACF;;;;;;;CASH,MAAM,YAAY,aAA0B,cAA4B;AACtE,QAAM,MAAM,YAAY,aAAa,aAAa;EAGlD,MAAM,SAAS,MAAM,KAAK,YAAY,aAAa;EACnD,IAAI,mBAAmB,MAAM,KAAK,IAAI,cAAA,GAAA,yBAAA,iBACpB,QAAQ,KAAK,aAAa,KAAK,SAAS,CACzD;AAED,MAAI,mBAAmB,KAAK,eAAe;GACzC,MAAM,eAAe,EAAE;AACvB,UAAO,mBAAmB,KAAK,eAAe;AAC5C,iBAAa,KAAK,OAAO,OAAO,CAAC;AACjC,uBAAmB,MAAM,KAAK,IAAI,cAAA,GAAA,yBAAA,iBAChB,QAAQ,KAAK,aAAa,KAAK,SAAS,CACzD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseChatMemory } from "./chat_memory.js";
|
|
2
2
|
import { getBufferString } from "@langchain/core/messages";
|
|
3
|
-
|
|
4
3
|
//#region src/memory/buffer_token_memory.ts
|
|
5
4
|
/**
|
|
6
5
|
* Class that represents a conversation chat memory with a token buffer.
|
|
@@ -69,7 +68,7 @@ var ConversationTokenBufferMemory = class extends BaseChatMemory {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
export { ConversationTokenBufferMemory };
|
|
73
|
+
|
|
75
74
|
//# sourceMappingURL=buffer_token_memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_token_memory.js","names":[],"sources":["../../src/memory/buffer_token_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferTokenMemory` class.\n */\n\nexport interface ConversationTokenBufferMemoryInput extends BaseChatMemoryInput {\n /* Prefix for human messages in the buffer. */\n humanPrefix?: string;\n\n /* Prefix for AI messages in the buffer. */\n aiPrefix?: string;\n\n /* The LLM for this instance. */\n llm: BaseLanguageModelInterface;\n\n /* Memory key for buffer instance. */\n memoryKey?: string;\n\n /* Maximmum number of tokens allowed in the buffer. */\n maxTokenLimit?: number;\n}\n\n/**\n * Class that represents a conversation chat memory with a token buffer.\n * It extends the `BaseChatMemory` class and implements the\n * `ConversationTokenBufferMemoryInput` interface.\n * @example\n * ```typescript\n * const memory = new ConversationTokenBufferMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * maxTokenLimit: 10,\n * });\n *\n * // Save conversation context\n * await memory.saveContext({ input: \"hi\" }, { output: \"whats up\" });\n * await memory.saveContext({ input: \"not much you\" }, { output: \"not much\" });\n *\n * // Load memory variables\n * const result = await memory.loadMemoryVariables({});\n * console.log(result);\n * ```\n */\n\nexport class ConversationTokenBufferMemory\n extends BaseChatMemory\n implements ConversationTokenBufferMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n maxTokenLimit = 2000; // Default max token limit of 2000 which can be overridden\n\n llm: BaseLanguageModelInterface;\n\n constructor(fields: ConversationTokenBufferMemoryInput) {\n super(fields);\n this.llm = fields.llm;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.maxTokenLimit = fields?.maxTokenLimit ?? this.maxTokenLimit;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n\n /**\n * Saves the context from this conversation to buffer. If the amount\n * of tokens required to save the buffer exceeds MAX_TOKEN_LIMIT,\n * prune it.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n await super.saveContext(inputValues, outputValues);\n\n // Prune buffer if it exceeds the max token limit set for this instance.\n const buffer = await this.chatHistory.getMessages();\n let currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n\n if (currBufferLength > this.maxTokenLimit) {\n const prunedMemory = [];\n while (currBufferLength > this.maxTokenLimit) {\n prunedMemory.push(buffer.shift());\n currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n }\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_token_memory.js","names":[],"sources":["../../src/memory/buffer_token_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the `BufferTokenMemory` class.\n */\n\nexport interface ConversationTokenBufferMemoryInput extends BaseChatMemoryInput {\n /* Prefix for human messages in the buffer. */\n humanPrefix?: string;\n\n /* Prefix for AI messages in the buffer. */\n aiPrefix?: string;\n\n /* The LLM for this instance. */\n llm: BaseLanguageModelInterface;\n\n /* Memory key for buffer instance. */\n memoryKey?: string;\n\n /* Maximmum number of tokens allowed in the buffer. */\n maxTokenLimit?: number;\n}\n\n/**\n * Class that represents a conversation chat memory with a token buffer.\n * It extends the `BaseChatMemory` class and implements the\n * `ConversationTokenBufferMemoryInput` interface.\n * @example\n * ```typescript\n * const memory = new ConversationTokenBufferMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * maxTokenLimit: 10,\n * });\n *\n * // Save conversation context\n * await memory.saveContext({ input: \"hi\" }, { output: \"whats up\" });\n * await memory.saveContext({ input: \"not much you\" }, { output: \"not much\" });\n *\n * // Load memory variables\n * const result = await memory.loadMemoryVariables({});\n * console.log(result);\n * ```\n */\n\nexport class ConversationTokenBufferMemory\n extends BaseChatMemory\n implements ConversationTokenBufferMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n maxTokenLimit = 2000; // Default max token limit of 2000 which can be overridden\n\n llm: BaseLanguageModelInterface;\n\n constructor(fields: ConversationTokenBufferMemoryInput) {\n super(fields);\n this.llm = fields.llm;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.maxTokenLimit = fields?.maxTokenLimit ?? this.maxTokenLimit;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables. It takes an `InputValues` object as a\n * parameter and returns a `Promise` that resolves with a\n * `MemoryVariables` object.\n * @param _values `InputValues` object.\n * @returns A `Promise` that resolves with a `MemoryVariables` object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages,\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages,\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n\n /**\n * Saves the context from this conversation to buffer. If the amount\n * of tokens required to save the buffer exceeds MAX_TOKEN_LIMIT,\n * prune it.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n await super.saveContext(inputValues, outputValues);\n\n // Prune buffer if it exceeds the max token limit set for this instance.\n const buffer = await this.chatHistory.getMessages();\n let currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n\n if (currBufferLength > this.maxTokenLimit) {\n const prunedMemory = [];\n while (currBufferLength > this.maxTokenLimit) {\n prunedMemory.push(buffer.shift());\n currBufferLength = await this.llm.getNumTokens(\n getBufferString(buffer, this.humanPrefix, this.aiPrefix)\n );\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,gCAAb,cACU,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,gBAAgB;CAEhB;CAEA,YAAY,QAA4C;AACtD,QAAM,OAAO;AACb,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,gBAAgB,QAAQ,iBAAiB,KAAK;;CAGrD,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;CAUzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,UACnB;AAUH,SAPe,GACZ,KAAK,YAAY,gBAChB,UACA,KAAK,aACL,KAAK,SACN,EACF;;;;;;;CASH,MAAM,YAAY,aAA0B,cAA4B;AACtE,QAAM,MAAM,YAAY,aAAa,aAAa;EAGlD,MAAM,SAAS,MAAM,KAAK,YAAY,aAAa;EACnD,IAAI,mBAAmB,MAAM,KAAK,IAAI,aACpC,gBAAgB,QAAQ,KAAK,aAAa,KAAK,SAAS,CACzD;AAED,MAAI,mBAAmB,KAAK,eAAe;GACzC,MAAM,eAAe,EAAE;AACvB,UAAO,mBAAmB,KAAK,eAAe;AAC5C,iBAAa,KAAK,OAAO,OAAO,CAAC;AACjC,uBAAmB,MAAM,KAAK,IAAI,aAChC,gBAAgB,QAAQ,KAAK,aAAa,KAAK,SAAS,CACzD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_memory_chat_memory = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_memory_chat_memory = require("./chat_memory.cjs");
|
|
3
3
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
4
|
-
|
|
5
4
|
//#region src/memory/buffer_window_memory.ts
|
|
6
5
|
/**
|
|
7
6
|
* Class for managing and storing previous chat messages. It extends the
|
|
@@ -67,7 +66,7 @@ var BufferWindowMemory = class extends require_memory_chat_memory.BaseChatMemory
|
|
|
67
66
|
return { [this.memoryKey]: (0, _langchain_core_messages.getBufferString)(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix) };
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
|
-
|
|
71
69
|
//#endregion
|
|
72
70
|
exports.BufferWindowMemory = BufferWindowMemory;
|
|
71
|
+
|
|
73
72
|
//# sourceMappingURL=buffer_window_memory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_window_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_window_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the BufferWindowMemory class.\n */\nexport interface BufferWindowMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n k?: number;\n}\n\n/**\n * Class for managing and storing previous chat messages. It extends the\n * BaseChatMemory class and implements the BufferWindowMemoryInput\n * interface. This class is stateful and stores messages in a buffer. When\n * called in a chain, it returns all of the messages it has stored.\n * @example\n * ```typescript\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * const chain = new LLMChain({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 }),\n * prompt,\n * memory: new BufferWindowMemory({ memoryKey: \"chat_history\", k: 1 }),\n * });\n *\n * // Example of initiating a conversation with the AI\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1 });\n *\n * // Example of following up with another question\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2 });\n * ```\n */\nexport class BufferWindowMemory\n extends BaseChatMemory\n implements BufferWindowMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n k = 5;\n\n constructor(fields?: BufferWindowMemoryInput) {\n super({\n returnMessages: fields?.returnMessages ?? false,\n chatHistory: fields?.chatHistory,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.k = fields?.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Method to load the memory variables. Retrieves the chat messages from\n * the history, slices the last 'k' messages, and stores them in the\n * memory under the memoryKey. If the returnMessages property is set to\n * true, the method returns the messages as they are. Otherwise, it\n * returns a string representation of the messages.\n * @param _values InputValues object.\n * @returns Promise that resolves to a MemoryVariables object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages.slice(-this.k * 2),\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_window_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/buffer_window_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the BufferWindowMemory class.\n */\nexport interface BufferWindowMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n k?: number;\n}\n\n/**\n * Class for managing and storing previous chat messages. It extends the\n * BaseChatMemory class and implements the BufferWindowMemoryInput\n * interface. This class is stateful and stores messages in a buffer. When\n * called in a chain, it returns all of the messages it has stored.\n * @example\n * ```typescript\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * const chain = new LLMChain({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 }),\n * prompt,\n * memory: new BufferWindowMemory({ memoryKey: \"chat_history\", k: 1 }),\n * });\n *\n * // Example of initiating a conversation with the AI\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1 });\n *\n * // Example of following up with another question\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2 });\n * ```\n */\nexport class BufferWindowMemory\n extends BaseChatMemory\n implements BufferWindowMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n k = 5;\n\n constructor(fields?: BufferWindowMemoryInput) {\n super({\n returnMessages: fields?.returnMessages ?? false,\n chatHistory: fields?.chatHistory,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.k = fields?.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Method to load the memory variables. Retrieves the chat messages from\n * the history, slices the last 'k' messages, and stores them in the\n * memory under the memoryKey. If the returnMessages property is set to\n * true, the method returns the messages as they are. Otherwise, it\n * returns a string representation of the messages.\n * @param _values InputValues object.\n * @returns Promise that resolves to a MemoryVariables object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages.slice(-this.k * 2),\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,qBAAb,cACUA,2BAAAA,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,IAAI;CAEJ,YAAY,QAAkC;AAC5C,QAAM;GACJ,gBAAgB,QAAQ,kBAAkB;GAC1C,aAAa,QAAQ;GACrB,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AACF,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,IAAI,QAAQ,KAAK,KAAK;;CAG7B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;;;CAYzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC9C;AAUH,SAPe,GACZ,KAAK,aAAA,GAAA,yBAAA,iBACJ,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN,EACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseChatMemory } from "./chat_memory.js";
|
|
2
2
|
import { getBufferString } from "@langchain/core/messages";
|
|
3
|
-
|
|
4
3
|
//#region src/memory/buffer_window_memory.ts
|
|
5
4
|
/**
|
|
6
5
|
* Class for managing and storing previous chat messages. It extends the
|
|
@@ -66,7 +65,7 @@ var BufferWindowMemory = class extends BaseChatMemory {
|
|
|
66
65
|
return { [this.memoryKey]: getBufferString(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix) };
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
69
|
export { BufferWindowMemory };
|
|
70
|
+
|
|
72
71
|
//# sourceMappingURL=buffer_window_memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_window_memory.js","names":[],"sources":["../../src/memory/buffer_window_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the BufferWindowMemory class.\n */\nexport interface BufferWindowMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n k?: number;\n}\n\n/**\n * Class for managing and storing previous chat messages. It extends the\n * BaseChatMemory class and implements the BufferWindowMemoryInput\n * interface. This class is stateful and stores messages in a buffer. When\n * called in a chain, it returns all of the messages it has stored.\n * @example\n * ```typescript\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * const chain = new LLMChain({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 }),\n * prompt,\n * memory: new BufferWindowMemory({ memoryKey: \"chat_history\", k: 1 }),\n * });\n *\n * // Example of initiating a conversation with the AI\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1 });\n *\n * // Example of following up with another question\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2 });\n * ```\n */\nexport class BufferWindowMemory\n extends BaseChatMemory\n implements BufferWindowMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n k = 5;\n\n constructor(fields?: BufferWindowMemoryInput) {\n super({\n returnMessages: fields?.returnMessages ?? false,\n chatHistory: fields?.chatHistory,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.k = fields?.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Method to load the memory variables. Retrieves the chat messages from\n * the history, slices the last 'k' messages, and stores them in the\n * memory under the memoryKey. If the returnMessages property is set to\n * true, the method returns the messages as they are. Otherwise, it\n * returns a string representation of the messages.\n * @param _values InputValues object.\n * @returns Promise that resolves to a MemoryVariables object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages.slice(-this.k * 2),\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer_window_memory.js","names":[],"sources":["../../src/memory/buffer_window_memory.ts"],"sourcesContent":["import { InputValues, MemoryVariables } from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the BufferWindowMemory class.\n */\nexport interface BufferWindowMemoryInput extends BaseChatMemoryInput {\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n k?: number;\n}\n\n/**\n * Class for managing and storing previous chat messages. It extends the\n * BaseChatMemory class and implements the BufferWindowMemoryInput\n * interface. This class is stateful and stores messages in a buffer. When\n * called in a chain, it returns all of the messages it has stored.\n * @example\n * ```typescript\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n *\n * const chain = new LLMChain({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 }),\n * prompt,\n * memory: new BufferWindowMemory({ memoryKey: \"chat_history\", k: 1 }),\n * });\n *\n * // Example of initiating a conversation with the AI\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1 });\n *\n * // Example of following up with another question\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2 });\n * ```\n */\nexport class BufferWindowMemory\n extends BaseChatMemory\n implements BufferWindowMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n k = 5;\n\n constructor(fields?: BufferWindowMemoryInput) {\n super({\n returnMessages: fields?.returnMessages ?? false,\n chatHistory: fields?.chatHistory,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.k = fields?.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Method to load the memory variables. Retrieves the chat messages from\n * the history, slices the last 'k' messages, and stores them in the\n * memory under the memoryKey. If the returnMessages property is set to\n * true, the method returns the messages as they are. Otherwise, it\n * returns a string representation of the messages.\n * @param _values InputValues object.\n * @returns Promise that resolves to a MemoryVariables object.\n */\n async loadMemoryVariables(_values: InputValues): Promise<MemoryVariables> {\n const messages = await this.chatHistory.getMessages();\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: messages.slice(-this.k * 2),\n };\n return result;\n }\n const result = {\n [this.memoryKey]: getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n ),\n };\n return result;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,qBAAb,cACU,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,IAAI;CAEJ,YAAY,QAAkC;AAC5C,QAAM;GACJ,gBAAgB,QAAQ,kBAAkB;GAC1C,aAAa,QAAQ;GACrB,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AACF,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,IAAI,QAAQ,KAAK,KAAK;;CAG7B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;;;;;;CAYzB,MAAM,oBAAoB,SAAgD;EACxE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC9C;AAUH,SAPe,GACZ,KAAK,YAAY,gBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN,EACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_runtime = require(
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
let _langchain_core_chat_history = require("@langchain/core/chat_history");
|
|
4
4
|
let _langchain_core_memory = require("@langchain/core/memory");
|
|
5
|
-
|
|
6
5
|
//#region src/memory/chat_memory.ts
|
|
7
6
|
var chat_memory_exports = /* @__PURE__ */ require_runtime.__exportAll({ BaseChatMemory: () => BaseChatMemory });
|
|
8
7
|
/**
|
|
@@ -41,13 +40,13 @@ var BaseChatMemory = class extends _langchain_core_memory.BaseMemory {
|
|
|
41
40
|
await this.chatHistory.clear();
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
//#endregion
|
|
46
44
|
exports.BaseChatMemory = BaseChatMemory;
|
|
47
|
-
Object.defineProperty(exports,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
Object.defineProperty(exports, "chat_memory_exports", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function() {
|
|
48
|
+
return chat_memory_exports;
|
|
49
|
+
}
|
|
52
50
|
});
|
|
51
|
+
|
|
53
52
|
//# sourceMappingURL=chat_memory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_memory.cjs","names":["BaseMemory","ChatMessageHistory"],"sources":["../../src/memory/chat_memory.ts"],"sourcesContent":["import {\n BaseChatMessageHistory,\n InMemoryChatMessageHistory as ChatMessageHistory,\n} from \"@langchain/core/chat_history\";\nimport {\n BaseMemory,\n InputValues,\n OutputValues,\n getInputValue,\n getOutputValue,\n} from \"@langchain/core/memory\";\n\n/**\n * Interface for the input parameters of the BaseChatMemory class.\n */\nexport interface BaseChatMemoryInput {\n chatHistory?: BaseChatMessageHistory;\n returnMessages?: boolean;\n inputKey?: string;\n outputKey?: string;\n}\n\n/**\n * Abstract class that provides a base for implementing different types of\n * memory systems. It is designed to maintain the state of an application,\n * specifically the history of a conversation. This class is typically\n * extended by other classes to create specific types of memory systems.\n */\nexport abstract class BaseChatMemory extends BaseMemory {\n chatHistory: BaseChatMessageHistory;\n\n returnMessages = false;\n\n inputKey?: string;\n\n outputKey?: string;\n\n constructor(fields?: BaseChatMemoryInput) {\n super();\n this.chatHistory = fields?.chatHistory ?? new ChatMessageHistory();\n this.returnMessages = fields?.returnMessages ?? this.returnMessages;\n this.inputKey = fields?.inputKey ?? this.inputKey;\n this.outputKey = fields?.outputKey ?? this.outputKey;\n }\n\n /**\n * Method to add user and AI messages to the chat history in sequence.\n * @param inputValues The input values from the user.\n * @param outputValues The output values from the AI.\n * @returns Promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n // this is purposefully done in sequence so they're saved in order\n await this.chatHistory.addUserMessage(\n getInputValue(inputValues, this.inputKey)\n );\n await this.chatHistory.addAIMessage(\n getOutputValue(outputValues, this.outputKey)\n );\n }\n\n /**\n * Method to clear the chat history.\n * @returns Promise that resolves when the chat history has been cleared.\n */\n async clear(): Promise<void> {\n await this.chatHistory.clear();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat_memory.cjs","names":["BaseMemory","ChatMessageHistory"],"sources":["../../src/memory/chat_memory.ts"],"sourcesContent":["import {\n BaseChatMessageHistory,\n InMemoryChatMessageHistory as ChatMessageHistory,\n} from \"@langchain/core/chat_history\";\nimport {\n BaseMemory,\n InputValues,\n OutputValues,\n getInputValue,\n getOutputValue,\n} from \"@langchain/core/memory\";\n\n/**\n * Interface for the input parameters of the BaseChatMemory class.\n */\nexport interface BaseChatMemoryInput {\n chatHistory?: BaseChatMessageHistory;\n returnMessages?: boolean;\n inputKey?: string;\n outputKey?: string;\n}\n\n/**\n * Abstract class that provides a base for implementing different types of\n * memory systems. It is designed to maintain the state of an application,\n * specifically the history of a conversation. This class is typically\n * extended by other classes to create specific types of memory systems.\n */\nexport abstract class BaseChatMemory extends BaseMemory {\n chatHistory: BaseChatMessageHistory;\n\n returnMessages = false;\n\n inputKey?: string;\n\n outputKey?: string;\n\n constructor(fields?: BaseChatMemoryInput) {\n super();\n this.chatHistory = fields?.chatHistory ?? new ChatMessageHistory();\n this.returnMessages = fields?.returnMessages ?? this.returnMessages;\n this.inputKey = fields?.inputKey ?? this.inputKey;\n this.outputKey = fields?.outputKey ?? this.outputKey;\n }\n\n /**\n * Method to add user and AI messages to the chat history in sequence.\n * @param inputValues The input values from the user.\n * @param outputValues The output values from the AI.\n * @returns Promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n // this is purposefully done in sequence so they're saved in order\n await this.chatHistory.addUserMessage(\n getInputValue(inputValues, this.inputKey)\n );\n await this.chatHistory.addAIMessage(\n getOutputValue(outputValues, this.outputKey)\n );\n }\n\n /**\n * Method to clear the chat history.\n * @returns Promise that resolves when the chat history has been cleared.\n */\n async clear(): Promise<void> {\n await this.chatHistory.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4BA,IAAsB,iBAAtB,cAA6CA,uBAAAA,WAAW;CACtD;CAEA,iBAAiB;CAEjB;CAEA;CAEA,YAAY,QAA8B;AACxC,SAAO;AACP,OAAK,cAAc,QAAQ,eAAe,IAAIC,6BAAAA,4BAAoB;AAClE,OAAK,iBAAiB,QAAQ,kBAAkB,KAAK;AACrD,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;;;;;;;;CAS7C,MAAM,YACJ,aACA,cACe;AAEf,QAAM,KAAK,YAAY,gBAAA,GAAA,uBAAA,eACP,aAAa,KAAK,SAAS,CAC1C;AACD,QAAM,KAAK,YAAY,cAAA,GAAA,uBAAA,gBACN,cAAc,KAAK,UAAU,CAC7C;;;;;;CAOH,MAAM,QAAuB;AAC3B,QAAM,KAAK,YAAY,OAAO"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { InMemoryChatMessageHistory } from "@langchain/core/chat_history";
|
|
3
3
|
import { BaseMemory, getInputValue, getOutputValue } from "@langchain/core/memory";
|
|
4
|
-
|
|
5
4
|
//#region src/memory/chat_memory.ts
|
|
6
5
|
var chat_memory_exports = /* @__PURE__ */ __exportAll({ BaseChatMemory: () => BaseChatMemory });
|
|
7
6
|
/**
|
|
@@ -40,7 +39,7 @@ var BaseChatMemory = class extends BaseMemory {
|
|
|
40
39
|
await this.chatHistory.clear();
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
|
-
|
|
44
42
|
//#endregion
|
|
45
43
|
export { BaseChatMemory, chat_memory_exports };
|
|
44
|
+
|
|
46
45
|
//# sourceMappingURL=chat_memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_memory.js","names":["ChatMessageHistory"],"sources":["../../src/memory/chat_memory.ts"],"sourcesContent":["import {\n BaseChatMessageHistory,\n InMemoryChatMessageHistory as ChatMessageHistory,\n} from \"@langchain/core/chat_history\";\nimport {\n BaseMemory,\n InputValues,\n OutputValues,\n getInputValue,\n getOutputValue,\n} from \"@langchain/core/memory\";\n\n/**\n * Interface for the input parameters of the BaseChatMemory class.\n */\nexport interface BaseChatMemoryInput {\n chatHistory?: BaseChatMessageHistory;\n returnMessages?: boolean;\n inputKey?: string;\n outputKey?: string;\n}\n\n/**\n * Abstract class that provides a base for implementing different types of\n * memory systems. It is designed to maintain the state of an application,\n * specifically the history of a conversation. This class is typically\n * extended by other classes to create specific types of memory systems.\n */\nexport abstract class BaseChatMemory extends BaseMemory {\n chatHistory: BaseChatMessageHistory;\n\n returnMessages = false;\n\n inputKey?: string;\n\n outputKey?: string;\n\n constructor(fields?: BaseChatMemoryInput) {\n super();\n this.chatHistory = fields?.chatHistory ?? new ChatMessageHistory();\n this.returnMessages = fields?.returnMessages ?? this.returnMessages;\n this.inputKey = fields?.inputKey ?? this.inputKey;\n this.outputKey = fields?.outputKey ?? this.outputKey;\n }\n\n /**\n * Method to add user and AI messages to the chat history in sequence.\n * @param inputValues The input values from the user.\n * @param outputValues The output values from the AI.\n * @returns Promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n // this is purposefully done in sequence so they're saved in order\n await this.chatHistory.addUserMessage(\n getInputValue(inputValues, this.inputKey)\n );\n await this.chatHistory.addAIMessage(\n getOutputValue(outputValues, this.outputKey)\n );\n }\n\n /**\n * Method to clear the chat history.\n * @returns Promise that resolves when the chat history has been cleared.\n */\n async clear(): Promise<void> {\n await this.chatHistory.clear();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat_memory.js","names":["ChatMessageHistory"],"sources":["../../src/memory/chat_memory.ts"],"sourcesContent":["import {\n BaseChatMessageHistory,\n InMemoryChatMessageHistory as ChatMessageHistory,\n} from \"@langchain/core/chat_history\";\nimport {\n BaseMemory,\n InputValues,\n OutputValues,\n getInputValue,\n getOutputValue,\n} from \"@langchain/core/memory\";\n\n/**\n * Interface for the input parameters of the BaseChatMemory class.\n */\nexport interface BaseChatMemoryInput {\n chatHistory?: BaseChatMessageHistory;\n returnMessages?: boolean;\n inputKey?: string;\n outputKey?: string;\n}\n\n/**\n * Abstract class that provides a base for implementing different types of\n * memory systems. It is designed to maintain the state of an application,\n * specifically the history of a conversation. This class is typically\n * extended by other classes to create specific types of memory systems.\n */\nexport abstract class BaseChatMemory extends BaseMemory {\n chatHistory: BaseChatMessageHistory;\n\n returnMessages = false;\n\n inputKey?: string;\n\n outputKey?: string;\n\n constructor(fields?: BaseChatMemoryInput) {\n super();\n this.chatHistory = fields?.chatHistory ?? new ChatMessageHistory();\n this.returnMessages = fields?.returnMessages ?? this.returnMessages;\n this.inputKey = fields?.inputKey ?? this.inputKey;\n this.outputKey = fields?.outputKey ?? this.outputKey;\n }\n\n /**\n * Method to add user and AI messages to the chat history in sequence.\n * @param inputValues The input values from the user.\n * @param outputValues The output values from the AI.\n * @returns Promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n // this is purposefully done in sequence so they're saved in order\n await this.chatHistory.addUserMessage(\n getInputValue(inputValues, this.inputKey)\n );\n await this.chatHistory.addAIMessage(\n getOutputValue(outputValues, this.outputKey)\n );\n }\n\n /**\n * Method to clear the chat history.\n * @returns Promise that resolves when the chat history has been cleared.\n */\n async clear(): Promise<void> {\n await this.chatHistory.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAsB,iBAAtB,cAA6C,WAAW;CACtD;CAEA,iBAAiB;CAEjB;CAEA;CAEA,YAAY,QAA8B;AACxC,SAAO;AACP,OAAK,cAAc,QAAQ,eAAe,IAAIA,4BAAoB;AAClE,OAAK,iBAAiB,QAAQ,kBAAkB,KAAK;AACrD,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;;;;;;;;CAS7C,MAAM,YACJ,aACA,cACe;AAEf,QAAM,KAAK,YAAY,eACrB,cAAc,aAAa,KAAK,SAAS,CAC1C;AACD,QAAM,KAAK,YAAY,aACrB,eAAe,cAAc,KAAK,UAAU,CAC7C;;;;;;CAOH,MAAM,QAAuB;AAC3B,QAAM,KAAK,YAAY,OAAO"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_memory_chat_memory = require(
|
|
2
|
-
|
|
1
|
+
const require_memory_chat_memory = require("./chat_memory.cjs");
|
|
3
2
|
//#region src/memory/combined_memory.ts
|
|
4
3
|
/**
|
|
5
4
|
* Class that manages and manipulates previous chat messages. It extends
|
|
@@ -82,7 +81,7 @@ var CombinedMemory = class extends require_memory_chat_memory.BaseChatMemory {
|
|
|
82
81
|
return memoryKeys;
|
|
83
82
|
}
|
|
84
83
|
};
|
|
85
|
-
|
|
86
84
|
//#endregion
|
|
87
85
|
exports.CombinedMemory = CombinedMemory;
|
|
86
|
+
|
|
88
87
|
//# sourceMappingURL=combined_memory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combined_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/combined_memory.ts"],"sourcesContent":["import {\n InputValues,\n MemoryVariables,\n BaseMemory,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface that defines the shape of the input object that the\n * CombinedMemory constructor accepts. It extends the BaseChatMemoryInput\n * interface and adds additional properties.\n */\nexport interface CombinedMemoryInput extends BaseChatMemoryInput {\n memories: BaseMemory[];\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * Class that manages and manipulates previous chat messages. It extends\n * from the BaseChatMemory class and implements the CombinedMemoryInput\n * interface.\n */\nexport class CombinedMemory\n extends BaseChatMemory\n implements CombinedMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n memories: BaseMemory[] = [];\n\n constructor(fields?: CombinedMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n\n this.memories = fields?.memories ?? this.memories;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.checkRepeatedMemoryVariable();\n this.checkInputKey();\n }\n\n /**\n * Checks for repeated memory variables across all memory objects. Throws\n * an error if any are found.\n */\n checkRepeatedMemoryVariable() {\n const allVariables: string[] = [];\n for (const memory of this.memories) {\n const overlap = allVariables.filter((x) => memory.memoryKeys.includes(x));\n if (overlap.length > 0) {\n throw new Error(\n `The same variables ${[\n ...overlap,\n ]} are found in multiple memory objects, which is not allowed by CombinedMemory.`\n );\n }\n allVariables.push(...memory.memoryKeys);\n }\n }\n\n /**\n * Checks if input keys are set for all memory objects. Logs a warning if\n * any are missing.\n */\n checkInputKey() {\n for (const memory of this.memories) {\n if (\n (memory as BaseChatMemory).chatHistory !== undefined &&\n (memory as BaseChatMemory).inputKey === undefined\n ) {\n console.warn(\n `When using CombinedMemory, input keys should be set so the input is known. Was not set on ${memory}.`\n );\n }\n }\n }\n\n /**\n * Loads memory variables from all memory objects.\n * @param inputValues Input values to load memory variables from.\n * @returns Promise that resolves with an object containing the loaded memory variables.\n */\n async loadMemoryVariables(\n inputValues: InputValues\n ): Promise<MemoryVariables> {\n let memoryData: Record<string, unknown> = {};\n\n for (const memory of this.memories) {\n const data = await memory.loadMemoryVariables(inputValues);\n memoryData = {\n ...memoryData,\n ...data,\n };\n }\n return memoryData;\n }\n\n /**\n * Saves the context to all memory objects.\n * @param inputValues Input values to save.\n * @param outputValues Output values to save.\n * @returns Promise that resolves when the context has been saved to all memory objects.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n for (const memory of this.memories) {\n await memory.saveContext(inputValues, outputValues);\n }\n }\n\n /**\n * Clears all memory objects.\n * @returns Promise that resolves when all memory objects have been cleared.\n */\n async clear() {\n for (const memory of this.memories) {\n if (typeof (memory as BaseChatMemory).clear === \"function\") {\n await (memory as BaseChatMemory).clear();\n }\n }\n }\n\n get memoryKeys() {\n const memoryKeys: string[] = [];\n for (const memory of this.memories) {\n memoryKeys.push(...memory.memoryKeys);\n }\n return memoryKeys;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"combined_memory.cjs","names":["BaseChatMemory"],"sources":["../../src/memory/combined_memory.ts"],"sourcesContent":["import {\n InputValues,\n MemoryVariables,\n BaseMemory,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface that defines the shape of the input object that the\n * CombinedMemory constructor accepts. It extends the BaseChatMemoryInput\n * interface and adds additional properties.\n */\nexport interface CombinedMemoryInput extends BaseChatMemoryInput {\n memories: BaseMemory[];\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * Class that manages and manipulates previous chat messages. It extends\n * from the BaseChatMemory class and implements the CombinedMemoryInput\n * interface.\n */\nexport class CombinedMemory\n extends BaseChatMemory\n implements CombinedMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n memories: BaseMemory[] = [];\n\n constructor(fields?: CombinedMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n\n this.memories = fields?.memories ?? this.memories;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.checkRepeatedMemoryVariable();\n this.checkInputKey();\n }\n\n /**\n * Checks for repeated memory variables across all memory objects. Throws\n * an error if any are found.\n */\n checkRepeatedMemoryVariable() {\n const allVariables: string[] = [];\n for (const memory of this.memories) {\n const overlap = allVariables.filter((x) => memory.memoryKeys.includes(x));\n if (overlap.length > 0) {\n throw new Error(\n `The same variables ${[\n ...overlap,\n ]} are found in multiple memory objects, which is not allowed by CombinedMemory.`\n );\n }\n allVariables.push(...memory.memoryKeys);\n }\n }\n\n /**\n * Checks if input keys are set for all memory objects. Logs a warning if\n * any are missing.\n */\n checkInputKey() {\n for (const memory of this.memories) {\n if (\n (memory as BaseChatMemory).chatHistory !== undefined &&\n (memory as BaseChatMemory).inputKey === undefined\n ) {\n console.warn(\n `When using CombinedMemory, input keys should be set so the input is known. Was not set on ${memory}.`\n );\n }\n }\n }\n\n /**\n * Loads memory variables from all memory objects.\n * @param inputValues Input values to load memory variables from.\n * @returns Promise that resolves with an object containing the loaded memory variables.\n */\n async loadMemoryVariables(\n inputValues: InputValues\n ): Promise<MemoryVariables> {\n let memoryData: Record<string, unknown> = {};\n\n for (const memory of this.memories) {\n const data = await memory.loadMemoryVariables(inputValues);\n memoryData = {\n ...memoryData,\n ...data,\n };\n }\n return memoryData;\n }\n\n /**\n * Saves the context to all memory objects.\n * @param inputValues Input values to save.\n * @param outputValues Output values to save.\n * @returns Promise that resolves when the context has been saved to all memory objects.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n for (const memory of this.memories) {\n await memory.saveContext(inputValues, outputValues);\n }\n }\n\n /**\n * Clears all memory objects.\n * @returns Promise that resolves when all memory objects have been cleared.\n */\n async clear() {\n for (const memory of this.memories) {\n if (typeof (memory as BaseChatMemory).clear === \"function\") {\n await (memory as BaseChatMemory).clear();\n }\n }\n }\n\n get memoryKeys() {\n const memoryKeys: string[] = [];\n for (const memory of this.memories) {\n memoryKeys.push(...memory.memoryKeys);\n }\n return memoryKeys;\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,iBAAb,cACUA,2BAAAA,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,WAAyB,EAAE;CAE3B,YAAY,QAA8B;AACxC,QAAM;GACJ,aAAa,QAAQ;GACrB,gBAAgB,QAAQ,kBAAkB;GAC1C,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AAEF,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,6BAA6B;AAClC,OAAK,eAAe;;;;;;CAOtB,8BAA8B;EAC5B,MAAM,eAAyB,EAAE;AACjC,OAAK,MAAM,UAAU,KAAK,UAAU;GAClC,MAAM,UAAU,aAAa,QAAQ,MAAM,OAAO,WAAW,SAAS,EAAE,CAAC;AACzE,OAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MACR,sBAAsB,CACpB,GAAG,QACJ,CAAC,gFACH;AAEH,gBAAa,KAAK,GAAG,OAAO,WAAW;;;;;;;CAQ3C,gBAAgB;AACd,OAAK,MAAM,UAAU,KAAK,SACxB,KACG,OAA0B,gBAAgB,KAAA,KAC1C,OAA0B,aAAa,KAAA,EAExC,SAAQ,KACN,6FAA6F,OAAO,GACrG;;;;;;;CAUP,MAAM,oBACJ,aAC0B;EAC1B,IAAI,aAAsC,EAAE;AAE5C,OAAK,MAAM,UAAU,KAAK,UAAU;GAClC,MAAM,OAAO,MAAM,OAAO,oBAAoB,YAAY;AAC1D,gBAAa;IACX,GAAG;IACH,GAAG;IACJ;;AAEH,SAAO;;;;;;;;CAST,MAAM,YAAY,aAA0B,cAA4B;AACtE,OAAK,MAAM,UAAU,KAAK,SACxB,OAAM,OAAO,YAAY,aAAa,aAAa;;;;;;CAQvD,MAAM,QAAQ;AACZ,OAAK,MAAM,UAAU,KAAK,SACxB,KAAI,OAAQ,OAA0B,UAAU,WAC9C,OAAO,OAA0B,OAAO;;CAK9C,IAAI,aAAa;EACf,MAAM,aAAuB,EAAE;AAC/B,OAAK,MAAM,UAAU,KAAK,SACxB,YAAW,KAAK,GAAG,OAAO,WAAW;AAEvC,SAAO"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseChatMemory } from "./chat_memory.js";
|
|
2
|
-
|
|
3
2
|
//#region src/memory/combined_memory.ts
|
|
4
3
|
/**
|
|
5
4
|
* Class that manages and manipulates previous chat messages. It extends
|
|
@@ -82,7 +81,7 @@ var CombinedMemory = class extends BaseChatMemory {
|
|
|
82
81
|
return memoryKeys;
|
|
83
82
|
}
|
|
84
83
|
};
|
|
85
|
-
|
|
86
84
|
//#endregion
|
|
87
85
|
export { CombinedMemory };
|
|
86
|
+
|
|
88
87
|
//# sourceMappingURL=combined_memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combined_memory.js","names":[],"sources":["../../src/memory/combined_memory.ts"],"sourcesContent":["import {\n InputValues,\n MemoryVariables,\n BaseMemory,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface that defines the shape of the input object that the\n * CombinedMemory constructor accepts. It extends the BaseChatMemoryInput\n * interface and adds additional properties.\n */\nexport interface CombinedMemoryInput extends BaseChatMemoryInput {\n memories: BaseMemory[];\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * Class that manages and manipulates previous chat messages. It extends\n * from the BaseChatMemory class and implements the CombinedMemoryInput\n * interface.\n */\nexport class CombinedMemory\n extends BaseChatMemory\n implements CombinedMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n memories: BaseMemory[] = [];\n\n constructor(fields?: CombinedMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n\n this.memories = fields?.memories ?? this.memories;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.checkRepeatedMemoryVariable();\n this.checkInputKey();\n }\n\n /**\n * Checks for repeated memory variables across all memory objects. Throws\n * an error if any are found.\n */\n checkRepeatedMemoryVariable() {\n const allVariables: string[] = [];\n for (const memory of this.memories) {\n const overlap = allVariables.filter((x) => memory.memoryKeys.includes(x));\n if (overlap.length > 0) {\n throw new Error(\n `The same variables ${[\n ...overlap,\n ]} are found in multiple memory objects, which is not allowed by CombinedMemory.`\n );\n }\n allVariables.push(...memory.memoryKeys);\n }\n }\n\n /**\n * Checks if input keys are set for all memory objects. Logs a warning if\n * any are missing.\n */\n checkInputKey() {\n for (const memory of this.memories) {\n if (\n (memory as BaseChatMemory).chatHistory !== undefined &&\n (memory as BaseChatMemory).inputKey === undefined\n ) {\n console.warn(\n `When using CombinedMemory, input keys should be set so the input is known. Was not set on ${memory}.`\n );\n }\n }\n }\n\n /**\n * Loads memory variables from all memory objects.\n * @param inputValues Input values to load memory variables from.\n * @returns Promise that resolves with an object containing the loaded memory variables.\n */\n async loadMemoryVariables(\n inputValues: InputValues\n ): Promise<MemoryVariables> {\n let memoryData: Record<string, unknown> = {};\n\n for (const memory of this.memories) {\n const data = await memory.loadMemoryVariables(inputValues);\n memoryData = {\n ...memoryData,\n ...data,\n };\n }\n return memoryData;\n }\n\n /**\n * Saves the context to all memory objects.\n * @param inputValues Input values to save.\n * @param outputValues Output values to save.\n * @returns Promise that resolves when the context has been saved to all memory objects.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n for (const memory of this.memories) {\n await memory.saveContext(inputValues, outputValues);\n }\n }\n\n /**\n * Clears all memory objects.\n * @returns Promise that resolves when all memory objects have been cleared.\n */\n async clear() {\n for (const memory of this.memories) {\n if (typeof (memory as BaseChatMemory).clear === \"function\") {\n await (memory as BaseChatMemory).clear();\n }\n }\n }\n\n get memoryKeys() {\n const memoryKeys: string[] = [];\n for (const memory of this.memories) {\n memoryKeys.push(...memory.memoryKeys);\n }\n return memoryKeys;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"combined_memory.js","names":[],"sources":["../../src/memory/combined_memory.ts"],"sourcesContent":["import {\n InputValues,\n MemoryVariables,\n BaseMemory,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface that defines the shape of the input object that the\n * CombinedMemory constructor accepts. It extends the BaseChatMemoryInput\n * interface and adds additional properties.\n */\nexport interface CombinedMemoryInput extends BaseChatMemoryInput {\n memories: BaseMemory[];\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n}\n\n/**\n * Class that manages and manipulates previous chat messages. It extends\n * from the BaseChatMemory class and implements the CombinedMemoryInput\n * interface.\n */\nexport class CombinedMemory\n extends BaseChatMemory\n implements CombinedMemoryInput\n{\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n memoryKey = \"history\";\n\n memories: BaseMemory[] = [];\n\n constructor(fields?: CombinedMemoryInput) {\n super({\n chatHistory: fields?.chatHistory,\n returnMessages: fields?.returnMessages ?? false,\n inputKey: fields?.inputKey,\n outputKey: fields?.outputKey,\n });\n\n this.memories = fields?.memories ?? this.memories;\n this.humanPrefix = fields?.humanPrefix ?? this.humanPrefix;\n this.aiPrefix = fields?.aiPrefix ?? this.aiPrefix;\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.checkRepeatedMemoryVariable();\n this.checkInputKey();\n }\n\n /**\n * Checks for repeated memory variables across all memory objects. Throws\n * an error if any are found.\n */\n checkRepeatedMemoryVariable() {\n const allVariables: string[] = [];\n for (const memory of this.memories) {\n const overlap = allVariables.filter((x) => memory.memoryKeys.includes(x));\n if (overlap.length > 0) {\n throw new Error(\n `The same variables ${[\n ...overlap,\n ]} are found in multiple memory objects, which is not allowed by CombinedMemory.`\n );\n }\n allVariables.push(...memory.memoryKeys);\n }\n }\n\n /**\n * Checks if input keys are set for all memory objects. Logs a warning if\n * any are missing.\n */\n checkInputKey() {\n for (const memory of this.memories) {\n if (\n (memory as BaseChatMemory).chatHistory !== undefined &&\n (memory as BaseChatMemory).inputKey === undefined\n ) {\n console.warn(\n `When using CombinedMemory, input keys should be set so the input is known. Was not set on ${memory}.`\n );\n }\n }\n }\n\n /**\n * Loads memory variables from all memory objects.\n * @param inputValues Input values to load memory variables from.\n * @returns Promise that resolves with an object containing the loaded memory variables.\n */\n async loadMemoryVariables(\n inputValues: InputValues\n ): Promise<MemoryVariables> {\n let memoryData: Record<string, unknown> = {};\n\n for (const memory of this.memories) {\n const data = await memory.loadMemoryVariables(inputValues);\n memoryData = {\n ...memoryData,\n ...data,\n };\n }\n return memoryData;\n }\n\n /**\n * Saves the context to all memory objects.\n * @param inputValues Input values to save.\n * @param outputValues Output values to save.\n * @returns Promise that resolves when the context has been saved to all memory objects.\n */\n async saveContext(inputValues: InputValues, outputValues: OutputValues) {\n for (const memory of this.memories) {\n await memory.saveContext(inputValues, outputValues);\n }\n }\n\n /**\n * Clears all memory objects.\n * @returns Promise that resolves when all memory objects have been cleared.\n */\n async clear() {\n for (const memory of this.memories) {\n if (typeof (memory as BaseChatMemory).clear === \"function\") {\n await (memory as BaseChatMemory).clear();\n }\n }\n }\n\n get memoryKeys() {\n const memoryKeys: string[] = [];\n for (const memory of this.memories) {\n memoryKeys.push(...memory.memoryKeys);\n }\n return memoryKeys;\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,iBAAb,cACU,eAEV;CACE,cAAc;CAEd,WAAW;CAEX,YAAY;CAEZ,WAAyB,EAAE;CAE3B,YAAY,QAA8B;AACxC,QAAM;GACJ,aAAa,QAAQ;GACrB,gBAAgB,QAAQ,kBAAkB;GAC1C,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACpB,CAAC;AAEF,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,cAAc,QAAQ,eAAe,KAAK;AAC/C,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,6BAA6B;AAClC,OAAK,eAAe;;;;;;CAOtB,8BAA8B;EAC5B,MAAM,eAAyB,EAAE;AACjC,OAAK,MAAM,UAAU,KAAK,UAAU;GAClC,MAAM,UAAU,aAAa,QAAQ,MAAM,OAAO,WAAW,SAAS,EAAE,CAAC;AACzE,OAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MACR,sBAAsB,CACpB,GAAG,QACJ,CAAC,gFACH;AAEH,gBAAa,KAAK,GAAG,OAAO,WAAW;;;;;;;CAQ3C,gBAAgB;AACd,OAAK,MAAM,UAAU,KAAK,SACxB,KACG,OAA0B,gBAAgB,KAAA,KAC1C,OAA0B,aAAa,KAAA,EAExC,SAAQ,KACN,6FAA6F,OAAO,GACrG;;;;;;;CAUP,MAAM,oBACJ,aAC0B;EAC1B,IAAI,aAAsC,EAAE;AAE5C,OAAK,MAAM,UAAU,KAAK,UAAU;GAClC,MAAM,OAAO,MAAM,OAAO,oBAAoB,YAAY;AAC1D,gBAAa;IACX,GAAG;IACH,GAAG;IACJ;;AAEH,SAAO;;;;;;;;CAST,MAAM,YAAY,aAA0B,cAA4B;AACtE,OAAK,MAAM,UAAU,KAAK,SACxB,OAAM,OAAO,YAAY,aAAa,aAAa;;;;;;CAQvD,MAAM,QAAQ;AACZ,OAAK,MAAM,UAAU,KAAK,SACxB,KAAI,OAAQ,OAA0B,UAAU,WAC9C,OAAO,OAA0B,OAAO;;CAK9C,IAAI,aAAa;EACf,MAAM,aAAuB,EAAE;AAC/B,OAAK,MAAM,UAAU,KAAK,SACxB,YAAW,KAAK,GAAG,OAAO,WAAW;AAEvC,SAAO"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const require_llm_chain = require(
|
|
3
|
-
const require_prompt = require(
|
|
4
|
-
const require_memory_chat_memory = require(
|
|
5
|
-
const require_in_memory = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_llm_chain = require("../chains/llm_chain.cjs");
|
|
3
|
+
const require_prompt = require("./prompt.cjs");
|
|
4
|
+
const require_memory_chat_memory = require("./chat_memory.cjs");
|
|
5
|
+
const require_in_memory = require("./stores/entity/in_memory.cjs");
|
|
6
6
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
7
7
|
let _langchain_core_memory = require("@langchain/core/memory");
|
|
8
|
-
|
|
9
8
|
//#region src/memory/entity_memory.ts
|
|
10
9
|
/**
|
|
11
10
|
* Class for managing entity extraction and summarization to memory in
|
|
@@ -137,7 +136,7 @@ var EntityMemory = class extends require_memory_chat_memory.BaseChatMemory {
|
|
|
137
136
|
await this.entityStore.clear();
|
|
138
137
|
}
|
|
139
138
|
};
|
|
140
|
-
|
|
141
139
|
//#endregion
|
|
142
140
|
exports.EntityMemory = EntityMemory;
|
|
141
|
+
|
|
143
142
|
//# sourceMappingURL=entity_memory.cjs.map
|