@langchain/core 1.2.0-dev-1765937705265 → 1.2.0-dev-1775763803878
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/CHANGELOG.md +309 -0
- package/README.md +1 -1
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +7 -6
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/agents.cjs +8 -8
- package/dist/agents.cjs.map +1 -1
- package/dist/agents.d.cts.map +1 -1
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +3 -2
- package/dist/agents.js.map +1 -1
- package/dist/caches/index.cjs +12 -13
- package/dist/caches/index.cjs.map +1 -1
- package/dist/caches/index.d.cts.map +1 -1
- package/dist/caches/index.d.ts.map +1 -1
- package/dist/caches/index.js +4 -6
- package/dist/caches/index.js.map +1 -1
- package/dist/callbacks/base.cjs +17 -25
- package/dist/callbacks/base.cjs.map +1 -1
- package/dist/callbacks/base.d.cts +80 -38
- package/dist/callbacks/base.d.cts.map +1 -1
- package/dist/callbacks/base.d.ts +80 -38
- package/dist/callbacks/base.d.ts.map +1 -1
- package/dist/callbacks/base.js +7 -17
- package/dist/callbacks/base.js.map +1 -1
- package/dist/callbacks/dispatch/index.cjs +11 -12
- package/dist/callbacks/dispatch/index.cjs.map +1 -1
- package/dist/callbacks/dispatch/index.d.cts +0 -2
- package/dist/callbacks/dispatch/index.d.cts.map +1 -1
- package/dist/callbacks/dispatch/index.d.ts +0 -3
- package/dist/callbacks/dispatch/index.d.ts.map +1 -1
- package/dist/callbacks/dispatch/index.js +5 -7
- package/dist/callbacks/dispatch/index.js.map +1 -1
- package/dist/callbacks/dispatch/web.cjs +3 -3
- package/dist/callbacks/dispatch/web.cjs.map +1 -1
- package/dist/callbacks/dispatch/web.d.cts +0 -2
- package/dist/callbacks/dispatch/web.d.cts.map +1 -1
- package/dist/callbacks/dispatch/web.d.ts +0 -3
- package/dist/callbacks/dispatch/web.d.ts.map +1 -1
- package/dist/callbacks/dispatch/web.js +1 -2
- package/dist/callbacks/dispatch/web.js.map +1 -1
- package/dist/callbacks/manager.cjs +68 -76
- package/dist/callbacks/manager.cjs.map +1 -1
- package/dist/callbacks/manager.d.cts +3 -2
- package/dist/callbacks/manager.d.cts.map +1 -1
- package/dist/callbacks/manager.d.ts +3 -2
- package/dist/callbacks/manager.d.ts.map +1 -1
- package/dist/callbacks/manager.js +51 -60
- package/dist/callbacks/manager.js.map +1 -1
- package/dist/callbacks/promises.cjs +10 -11
- package/dist/callbacks/promises.js +3 -5
- package/dist/chat_history.cjs +13 -14
- package/dist/chat_history.cjs.map +1 -1
- package/dist/chat_history.d.cts +0 -2
- package/dist/chat_history.d.cts.map +1 -1
- package/dist/chat_history.d.ts +0 -3
- package/dist/chat_history.d.ts.map +1 -1
- package/dist/chat_history.js +4 -6
- package/dist/chat_history.js.map +1 -1
- package/dist/context.cjs +14 -7
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +8 -2
- package/dist/context.js.map +1 -1
- package/dist/document_loaders/base.cjs +8 -10
- package/dist/document_loaders/base.cjs.map +1 -1
- package/dist/document_loaders/base.d.cts +0 -1
- package/dist/document_loaders/base.d.cts.map +1 -1
- package/dist/document_loaders/base.d.ts +0 -1
- package/dist/document_loaders/base.d.ts.map +1 -1
- package/dist/document_loaders/base.js +3 -5
- package/dist/document_loaders/base.js.map +1 -1
- package/dist/document_loaders/langsmith.cjs +11 -12
- package/dist/document_loaders/langsmith.cjs.map +1 -1
- package/dist/document_loaders/langsmith.d.cts.map +1 -1
- package/dist/document_loaders/langsmith.d.ts.map +1 -1
- package/dist/document_loaders/langsmith.js +3 -5
- package/dist/document_loaders/langsmith.js.map +1 -1
- package/dist/documents/document.cjs +1 -2
- package/dist/documents/document.cjs.map +1 -1
- package/dist/documents/document.d.cts.map +1 -1
- package/dist/documents/document.d.ts.map +1 -1
- package/dist/documents/document.js +1 -1
- package/dist/documents/document.js.map +1 -1
- package/dist/documents/index.cjs +11 -12
- package/dist/documents/index.js +3 -5
- package/dist/documents/transformers.cjs +2 -3
- package/dist/documents/transformers.cjs.map +1 -1
- package/dist/documents/transformers.d.cts +0 -1
- package/dist/documents/transformers.d.cts.map +1 -1
- package/dist/documents/transformers.d.ts +0 -1
- package/dist/documents/transformers.d.ts.map +1 -1
- package/dist/documents/transformers.js +1 -2
- package/dist/documents/transformers.js.map +1 -1
- package/dist/embeddings.cjs +10 -11
- package/dist/embeddings.cjs.map +1 -1
- package/dist/embeddings.d.cts +0 -1
- package/dist/embeddings.d.cts.map +1 -1
- package/dist/embeddings.d.ts +0 -1
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/embeddings.js +3 -5
- package/dist/embeddings.js.map +1 -1
- package/dist/errors/index.cjs +165 -2
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +150 -0
- package/dist/errors/index.d.cts.map +1 -0
- package/dist/errors/index.d.ts +150 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +155 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/example_selectors/base.cjs +2 -3
- package/dist/example_selectors/base.cjs.map +1 -1
- package/dist/example_selectors/base.d.cts +0 -1
- package/dist/example_selectors/base.d.cts.map +1 -1
- package/dist/example_selectors/base.d.ts +0 -1
- package/dist/example_selectors/base.d.ts.map +1 -1
- package/dist/example_selectors/base.js +1 -2
- package/dist/example_selectors/base.js.map +1 -1
- package/dist/example_selectors/conditional.cjs +2 -4
- package/dist/example_selectors/conditional.cjs.map +1 -1
- package/dist/example_selectors/conditional.d.cts.map +1 -1
- package/dist/example_selectors/conditional.d.ts.map +1 -1
- package/dist/example_selectors/conditional.js +2 -3
- package/dist/example_selectors/conditional.js.map +1 -1
- package/dist/example_selectors/index.cjs +13 -14
- package/dist/example_selectors/index.js +3 -5
- package/dist/example_selectors/length_based.cjs +3 -5
- package/dist/example_selectors/length_based.cjs.map +1 -1
- package/dist/example_selectors/length_based.d.cts +0 -1
- package/dist/example_selectors/length_based.d.cts.map +1 -1
- package/dist/example_selectors/length_based.d.ts +0 -1
- package/dist/example_selectors/length_based.d.ts.map +1 -1
- package/dist/example_selectors/length_based.js +2 -4
- package/dist/example_selectors/length_based.js.map +1 -1
- package/dist/example_selectors/semantic_similarity.cjs +7 -12
- package/dist/example_selectors/semantic_similarity.cjs.map +1 -1
- package/dist/example_selectors/semantic_similarity.d.cts +0 -1
- package/dist/example_selectors/semantic_similarity.d.cts.map +1 -1
- package/dist/example_selectors/semantic_similarity.d.ts +0 -1
- package/dist/example_selectors/semantic_similarity.d.ts.map +1 -1
- package/dist/example_selectors/semantic_similarity.js +5 -10
- package/dist/example_selectors/semantic_similarity.js.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +3 -2
- package/dist/indexing/base.cjs +12 -17
- package/dist/indexing/base.cjs.map +1 -1
- package/dist/indexing/base.d.cts.map +1 -1
- package/dist/indexing/base.d.ts.map +1 -1
- package/dist/indexing/base.js +6 -11
- package/dist/indexing/base.js.map +1 -1
- package/dist/indexing/index.cjs +11 -12
- package/dist/indexing/index.js +3 -5
- package/dist/indexing/record_manager.cjs +2 -3
- package/dist/indexing/record_manager.cjs.map +1 -1
- package/dist/indexing/record_manager.d.cts.map +1 -1
- package/dist/indexing/record_manager.d.ts.map +1 -1
- package/dist/indexing/record_manager.js +1 -2
- package/dist/indexing/record_manager.js.map +1 -1
- package/dist/language_models/base.cjs +32 -26
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +17 -14
- package/dist/language_models/base.d.cts.map +1 -1
- package/dist/language_models/base.d.ts +17 -16
- package/dist/language_models/base.d.ts.map +1 -1
- package/dist/language_models/base.js +21 -16
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs +130 -70
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.cts +76 -10
- package/dist/language_models/chat_models.d.cts.map +1 -1
- package/dist/language_models/chat_models.d.ts +76 -13
- package/dist/language_models/chat_models.d.ts.map +1 -1
- package/dist/language_models/chat_models.js +111 -52
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/compat.cjs +235 -0
- package/dist/language_models/compat.cjs.map +1 -0
- package/dist/language_models/compat.d.cts +34 -0
- package/dist/language_models/compat.d.cts.map +1 -0
- package/dist/language_models/compat.d.ts +34 -0
- package/dist/language_models/compat.d.ts.map +1 -0
- package/dist/language_models/compat.js +226 -0
- package/dist/language_models/compat.js.map +1 -0
- package/dist/language_models/event.cjs +12 -0
- package/dist/language_models/event.cjs.map +1 -0
- package/dist/language_models/event.d.cts +193 -0
- package/dist/language_models/event.d.cts.map +1 -0
- package/dist/language_models/event.d.ts +193 -0
- package/dist/language_models/event.d.ts.map +1 -0
- package/dist/language_models/event.js +7 -0
- package/dist/language_models/event.js.map +1 -0
- package/dist/language_models/llms.cjs +23 -27
- package/dist/language_models/llms.cjs.map +1 -1
- package/dist/language_models/llms.d.cts +4 -4
- package/dist/language_models/llms.d.cts.map +1 -1
- package/dist/language_models/llms.d.ts +4 -5
- package/dist/language_models/llms.d.ts.map +1 -1
- package/dist/language_models/llms.js +12 -17
- package/dist/language_models/llms.js.map +1 -1
- package/dist/language_models/profile.cjs +8 -8
- package/dist/language_models/profile.d.cts.map +1 -1
- package/dist/language_models/profile.d.ts.map +1 -1
- package/dist/language_models/profile.js +3 -2
- package/dist/language_models/stream.cjs +376 -0
- package/dist/language_models/stream.cjs.map +1 -0
- package/dist/language_models/stream.d.cts +129 -0
- package/dist/language_models/stream.d.cts.map +1 -0
- package/dist/language_models/stream.d.ts +129 -0
- package/dist/language_models/stream.d.ts.map +1 -0
- package/dist/language_models/stream.js +365 -0
- package/dist/language_models/stream.js.map +1 -0
- package/dist/language_models/structured_output.cjs +87 -0
- package/dist/language_models/structured_output.cjs.map +1 -0
- package/dist/language_models/structured_output.d.cts +45 -0
- package/dist/language_models/structured_output.d.cts.map +1 -0
- package/dist/language_models/structured_output.d.ts +45 -0
- package/dist/language_models/structured_output.d.ts.map +1 -0
- package/dist/language_models/structured_output.js +78 -0
- package/dist/language_models/structured_output.js.map +1 -0
- package/dist/language_models/utils.cjs +1 -2
- package/dist/language_models/utils.cjs.map +1 -1
- package/dist/language_models/utils.js +1 -1
- package/dist/language_models/utils.js.map +1 -1
- 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_constants.js.map +1 -1
- package/dist/load/import_map.cjs +82 -66
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +45 -29
- package/dist/load/import_map.js.map +1 -1
- package/dist/load/import_type.d.cts.map +1 -1
- package/dist/load/import_type.d.ts.map +1 -1
- package/dist/load/index.cjs +160 -41
- package/dist/load/index.cjs.map +1 -1
- package/dist/load/index.d.cts +122 -3
- package/dist/load/index.d.cts.map +1 -1
- package/dist/load/index.d.ts +122 -3
- package/dist/load/index.d.ts.map +1 -1
- package/dist/load/index.js +149 -31
- package/dist/load/index.js.map +1 -1
- package/dist/load/map_keys.cjs +6 -5
- package/dist/load/map_keys.cjs.map +1 -1
- package/dist/load/map_keys.d.cts.map +1 -1
- package/dist/load/map_keys.d.ts.map +1 -1
- package/dist/load/map_keys.js +1 -2
- package/dist/load/map_keys.js.map +1 -1
- package/dist/load/serializable.cjs +22 -26
- package/dist/load/serializable.cjs.map +1 -1
- package/dist/load/serializable.d.cts +15 -1
- package/dist/load/serializable.d.cts.map +1 -1
- package/dist/load/serializable.d.ts +15 -1
- package/dist/load/serializable.d.ts.map +1 -1
- package/dist/load/serializable.js +15 -20
- package/dist/load/serializable.js.map +1 -1
- package/dist/load/validation.cjs +120 -0
- package/dist/load/validation.cjs.map +1 -0
- package/dist/load/validation.js +118 -0
- package/dist/load/validation.js.map +1 -0
- package/dist/memory.cjs +10 -18
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.d.cts +2 -2
- package/dist/memory.d.cts.map +1 -1
- package/dist/memory.d.ts +2 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +5 -13
- package/dist/memory.js.map +1 -1
- package/dist/messages/ai.cjs +15 -9
- package/dist/messages/ai.cjs.map +1 -1
- package/dist/messages/ai.d.cts +2 -2
- package/dist/messages/ai.d.cts.map +1 -1
- package/dist/messages/ai.d.ts +2 -2
- package/dist/messages/ai.d.ts.map +1 -1
- package/dist/messages/ai.js +10 -4
- package/dist/messages/ai.js.map +1 -1
- package/dist/messages/base.cjs +111 -44
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.d.cts +49 -12
- package/dist/messages/base.d.cts.map +1 -1
- package/dist/messages/base.d.ts +49 -12
- package/dist/messages/base.d.ts.map +1 -1
- package/dist/messages/base.js +104 -38
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/block_translators/anthropic.cjs +32 -38
- package/dist/messages/block_translators/anthropic.cjs.map +1 -1
- package/dist/messages/block_translators/anthropic.js +31 -37
- package/dist/messages/block_translators/anthropic.js.map +1 -1
- package/dist/messages/block_translators/bedrock_converse.cjs +40 -49
- package/dist/messages/block_translators/bedrock_converse.cjs.map +1 -1
- package/dist/messages/block_translators/bedrock_converse.js +39 -48
- package/dist/messages/block_translators/bedrock_converse.js.map +1 -1
- package/dist/messages/block_translators/data.cjs +3 -4
- package/dist/messages/block_translators/data.cjs.map +1 -1
- package/dist/messages/block_translators/data.js +1 -2
- package/dist/messages/block_translators/data.js.map +1 -1
- package/dist/messages/block_translators/deepseek.cjs +58 -0
- package/dist/messages/block_translators/deepseek.cjs.map +1 -0
- package/dist/messages/block_translators/deepseek.js +58 -0
- package/dist/messages/block_translators/deepseek.js.map +1 -0
- package/dist/messages/block_translators/google.cjs +97 -0
- package/dist/messages/block_translators/google.cjs.map +1 -0
- package/dist/messages/block_translators/google.js +97 -0
- package/dist/messages/block_translators/google.js.map +1 -0
- package/dist/messages/block_translators/google_genai.cjs +9 -3
- package/dist/messages/block_translators/google_genai.cjs.map +1 -1
- package/dist/messages/block_translators/google_genai.js +8 -2
- package/dist/messages/block_translators/google_genai.js.map +1 -1
- package/dist/messages/block_translators/google_vertexai.cjs +10 -6
- package/dist/messages/block_translators/google_vertexai.cjs.map +1 -1
- package/dist/messages/block_translators/google_vertexai.js +9 -5
- package/dist/messages/block_translators/google_vertexai.js.map +1 -1
- package/dist/messages/block_translators/groq.cjs +96 -0
- package/dist/messages/block_translators/groq.cjs.map +1 -0
- package/dist/messages/block_translators/groq.js +96 -0
- package/dist/messages/block_translators/groq.js.map +1 -0
- package/dist/messages/block_translators/index.cjs +17 -8
- package/dist/messages/block_translators/index.cjs.map +1 -1
- package/dist/messages/block_translators/index.js +12 -3
- package/dist/messages/block_translators/index.js.map +1 -1
- package/dist/messages/block_translators/ollama.cjs +58 -0
- package/dist/messages/block_translators/ollama.cjs.map +1 -0
- package/dist/messages/block_translators/ollama.js +58 -0
- package/dist/messages/block_translators/ollama.js.map +1 -0
- package/dist/messages/block_translators/openai.cjs +85 -26
- package/dist/messages/block_translators/openai.cjs.map +1 -1
- package/dist/messages/block_translators/openai.js +83 -24
- package/dist/messages/block_translators/openai.js.map +1 -1
- package/dist/messages/block_translators/utils.cjs +2 -3
- package/dist/messages/block_translators/utils.cjs.map +1 -1
- package/dist/messages/block_translators/utils.js +2 -2
- package/dist/messages/block_translators/utils.js.map +1 -1
- package/dist/messages/block_translators/xai.cjs +94 -0
- package/dist/messages/block_translators/xai.cjs.map +1 -0
- package/dist/messages/block_translators/xai.js +94 -0
- package/dist/messages/block_translators/xai.js.map +1 -0
- package/dist/messages/chat.cjs +2 -3
- package/dist/messages/chat.cjs.map +1 -1
- package/dist/messages/chat.d.cts.map +1 -1
- package/dist/messages/chat.d.ts.map +1 -1
- package/dist/messages/chat.js +1 -2
- package/dist/messages/chat.js.map +1 -1
- package/dist/messages/content/base.d.cts.map +1 -1
- package/dist/messages/content/base.d.ts.map +1 -1
- package/dist/messages/content/data.cjs +2 -5
- package/dist/messages/content/data.cjs.map +1 -1
- package/dist/messages/content/data.d.cts +0 -1
- package/dist/messages/content/data.d.cts.map +1 -1
- package/dist/messages/content/data.d.ts +0 -1
- package/dist/messages/content/data.d.ts.map +1 -1
- package/dist/messages/content/data.js +2 -4
- package/dist/messages/content/data.js.map +1 -1
- package/dist/messages/content/index.cjs +5 -6
- package/dist/messages/content/index.cjs.map +1 -1
- package/dist/messages/content/index.d.cts +7 -3
- package/dist/messages/content/index.d.cts.map +1 -1
- package/dist/messages/content/index.d.ts +7 -3
- package/dist/messages/content/index.d.ts.map +1 -1
- package/dist/messages/content/index.js +7 -8
- package/dist/messages/content/index.js.map +1 -1
- package/dist/messages/content/multimodal.cjs +1 -2
- package/dist/messages/content/multimodal.cjs.map +1 -1
- package/dist/messages/content/multimodal.d.cts +4 -8
- package/dist/messages/content/multimodal.d.cts.map +1 -1
- package/dist/messages/content/multimodal.d.ts +4 -8
- package/dist/messages/content/multimodal.d.ts.map +1 -1
- package/dist/messages/content/multimodal.js +1 -1
- package/dist/messages/content/multimodal.js.map +1 -1
- package/dist/messages/content/tools.cjs +1 -2
- package/dist/messages/content/tools.cjs.map +1 -1
- package/dist/messages/content/tools.d.cts +1 -1
- package/dist/messages/content/tools.d.cts.map +1 -1
- package/dist/messages/content/tools.d.ts +1 -1
- package/dist/messages/content/tools.d.ts.map +1 -1
- package/dist/messages/content/tools.js +1 -1
- package/dist/messages/content/tools.js.map +1 -1
- package/dist/messages/format.cjs +1 -2
- package/dist/messages/format.cjs.map +1 -1
- package/dist/messages/format.d.cts.map +1 -1
- package/dist/messages/format.d.ts.map +1 -1
- package/dist/messages/format.js +1 -1
- package/dist/messages/format.js.map +1 -1
- package/dist/messages/function.cjs +2 -3
- package/dist/messages/function.cjs.map +1 -1
- package/dist/messages/function.d.cts.map +1 -1
- package/dist/messages/function.d.ts.map +1 -1
- package/dist/messages/function.js +1 -2
- package/dist/messages/function.js.map +1 -1
- package/dist/messages/human.cjs +2 -3
- package/dist/messages/human.cjs.map +1 -1
- package/dist/messages/human.d.cts.map +1 -1
- package/dist/messages/human.d.ts.map +1 -1
- package/dist/messages/human.js +1 -2
- package/dist/messages/human.js.map +1 -1
- package/dist/messages/index.cjs +25 -24
- package/dist/messages/index.d.cts +3 -3
- package/dist/messages/index.d.ts +3 -3
- package/dist/messages/index.js +7 -8
- package/dist/messages/message.cjs +1 -2
- package/dist/messages/message.cjs.map +1 -1
- package/dist/messages/message.d.cts +50 -27
- package/dist/messages/message.d.cts.map +1 -1
- package/dist/messages/message.d.ts +50 -27
- package/dist/messages/message.d.ts.map +1 -1
- package/dist/messages/message.js +1 -1
- package/dist/messages/message.js.map +1 -1
- package/dist/messages/metadata.cjs +3 -5
- package/dist/messages/metadata.cjs.map +1 -1
- package/dist/messages/metadata.d.cts.map +1 -1
- package/dist/messages/metadata.d.ts.map +1 -1
- package/dist/messages/metadata.js +2 -4
- package/dist/messages/metadata.js.map +1 -1
- package/dist/messages/modifier.cjs +2 -3
- package/dist/messages/modifier.cjs.map +1 -1
- package/dist/messages/modifier.d.cts.map +1 -1
- package/dist/messages/modifier.d.ts.map +1 -1
- package/dist/messages/modifier.js +1 -2
- package/dist/messages/modifier.js.map +1 -1
- package/dist/messages/system.cjs +10 -7
- package/dist/messages/system.cjs.map +1 -1
- package/dist/messages/system.d.cts.map +1 -1
- package/dist/messages/system.d.ts.map +1 -1
- package/dist/messages/system.js +9 -6
- package/dist/messages/system.js.map +1 -1
- package/dist/messages/tool.cjs +10 -11
- package/dist/messages/tool.cjs.map +1 -1
- package/dist/messages/tool.d.cts +1 -1
- package/dist/messages/tool.d.cts.map +1 -1
- package/dist/messages/tool.d.ts +1 -1
- package/dist/messages/tool.d.ts.map +1 -1
- package/dist/messages/tool.js +3 -5
- package/dist/messages/tool.js.map +1 -1
- package/dist/messages/transformers.cjs +18 -25
- package/dist/messages/transformers.cjs.map +1 -1
- package/dist/messages/transformers.d.cts.map +1 -1
- package/dist/messages/transformers.d.ts.map +1 -1
- package/dist/messages/transformers.js +9 -16
- package/dist/messages/transformers.js.map +1 -1
- package/dist/messages/utils.cjs +71 -32
- package/dist/messages/utils.cjs.map +1 -1
- package/dist/messages/utils.d.cts +16 -7
- package/dist/messages/utils.d.cts.map +1 -1
- package/dist/messages/utils.d.ts +16 -7
- package/dist/messages/utils.d.ts.map +1 -1
- package/dist/messages/utils.js +63 -24
- package/dist/messages/utils.js.map +1 -1
- package/dist/output_parsers/base.cjs +10 -11
- package/dist/output_parsers/base.cjs.map +1 -1
- package/dist/output_parsers/base.d.cts +0 -1
- package/dist/output_parsers/base.d.cts.map +1 -1
- package/dist/output_parsers/base.d.ts +0 -4
- package/dist/output_parsers/base.d.ts.map +1 -1
- package/dist/output_parsers/base.js +6 -7
- package/dist/output_parsers/base.js.map +1 -1
- package/dist/output_parsers/bytes.cjs +2 -3
- package/dist/output_parsers/bytes.cjs.map +1 -1
- package/dist/output_parsers/bytes.d.cts +0 -1
- package/dist/output_parsers/bytes.d.cts.map +1 -1
- package/dist/output_parsers/bytes.d.ts +0 -1
- package/dist/output_parsers/bytes.d.ts.map +1 -1
- package/dist/output_parsers/bytes.js +1 -2
- package/dist/output_parsers/bytes.js.map +1 -1
- package/dist/output_parsers/index.cjs +21 -19
- package/dist/output_parsers/index.cjs.map +1 -1
- package/dist/output_parsers/index.d.cts +2 -1
- package/dist/output_parsers/index.d.ts +2 -1
- package/dist/output_parsers/index.js +7 -7
- package/dist/output_parsers/index.js.map +1 -1
- package/dist/output_parsers/json.cjs +16 -7
- package/dist/output_parsers/json.cjs.map +1 -1
- package/dist/output_parsers/json.d.cts +9 -1
- package/dist/output_parsers/json.d.cts.map +1 -1
- package/dist/output_parsers/json.d.ts +9 -1
- package/dist/output_parsers/json.d.ts.map +1 -1
- package/dist/output_parsers/json.js +13 -4
- package/dist/output_parsers/json.js.map +1 -1
- package/dist/output_parsers/list.cjs +3 -4
- package/dist/output_parsers/list.cjs.map +1 -1
- package/dist/output_parsers/list.d.cts +0 -1
- package/dist/output_parsers/list.d.cts.map +1 -1
- package/dist/output_parsers/list.d.ts +0 -2
- package/dist/output_parsers/list.d.ts.map +1 -1
- package/dist/output_parsers/list.js +1 -2
- package/dist/output_parsers/list.js.map +1 -1
- package/dist/output_parsers/openai_functions/index.cjs +10 -11
- package/dist/output_parsers/openai_functions/index.js +3 -5
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs +13 -17
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +1 -2
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -2
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.js +7 -11
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.js.map +1 -1
- package/dist/output_parsers/openai_tools/index.cjs +10 -11
- package/dist/output_parsers/openai_tools/index.d.cts +2 -2
- package/dist/output_parsers/openai_tools/index.d.ts +2 -2
- package/dist/output_parsers/openai_tools/index.js +3 -5
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +29 -30
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +10 -8
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +10 -8
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js +23 -24
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js.map +1 -1
- package/dist/output_parsers/standard_schema.cjs +39 -0
- package/dist/output_parsers/standard_schema.cjs.map +1 -0
- package/dist/output_parsers/standard_schema.d.cts +16 -0
- package/dist/output_parsers/standard_schema.d.cts.map +1 -0
- package/dist/output_parsers/standard_schema.d.ts +16 -0
- package/dist/output_parsers/standard_schema.d.ts.map +1 -0
- package/dist/output_parsers/standard_schema.js +39 -0
- package/dist/output_parsers/standard_schema.js.map +1 -0
- package/dist/output_parsers/string.cjs +5 -3
- package/dist/output_parsers/string.cjs.map +1 -1
- package/dist/output_parsers/string.d.cts +0 -1
- package/dist/output_parsers/string.d.cts.map +1 -1
- package/dist/output_parsers/string.d.ts +0 -2
- package/dist/output_parsers/string.d.ts.map +1 -1
- package/dist/output_parsers/string.js +4 -2
- package/dist/output_parsers/string.js.map +1 -1
- package/dist/output_parsers/structured.cjs +14 -18
- package/dist/output_parsers/structured.cjs.map +1 -1
- package/dist/output_parsers/structured.d.cts.map +1 -1
- package/dist/output_parsers/structured.d.ts.map +1 -1
- package/dist/output_parsers/structured.js +9 -13
- package/dist/output_parsers/structured.js.map +1 -1
- package/dist/output_parsers/transform.cjs +8 -9
- package/dist/output_parsers/transform.cjs.map +1 -1
- package/dist/output_parsers/transform.d.cts +0 -1
- package/dist/output_parsers/transform.d.cts.map +1 -1
- package/dist/output_parsers/transform.d.ts +0 -1
- package/dist/output_parsers/transform.d.ts.map +1 -1
- package/dist/output_parsers/transform.js +1 -2
- package/dist/output_parsers/transform.js.map +1 -1
- package/dist/output_parsers/xml.cjs +11 -15
- package/dist/output_parsers/xml.cjs.map +1 -1
- package/dist/output_parsers/xml.d.cts +1 -1
- package/dist/output_parsers/xml.d.cts.map +1 -1
- package/dist/output_parsers/xml.d.ts +1 -1
- package/dist/output_parsers/xml.d.ts.map +1 -1
- package/dist/output_parsers/xml.js +7 -11
- package/dist/output_parsers/xml.js.map +1 -1
- package/dist/outputs.cjs +8 -10
- package/dist/outputs.cjs.map +1 -1
- package/dist/outputs.d.cts.map +1 -1
- package/dist/outputs.d.ts.map +1 -1
- package/dist/outputs.js +3 -5
- package/dist/outputs.js.map +1 -1
- package/dist/prompt_values.cjs +12 -13
- package/dist/prompt_values.cjs.map +1 -1
- package/dist/prompt_values.d.cts +1 -3
- package/dist/prompt_values.d.cts.map +1 -1
- package/dist/prompt_values.d.ts +1 -3
- package/dist/prompt_values.d.ts.map +1 -1
- package/dist/prompt_values.js +3 -5
- package/dist/prompt_values.js.map +1 -1
- package/dist/prompts/base.cjs +4 -6
- package/dist/prompts/base.cjs.map +1 -1
- package/dist/prompts/base.d.cts +0 -1
- package/dist/prompts/base.d.cts.map +1 -1
- package/dist/prompts/base.d.ts +0 -2
- package/dist/prompts/base.d.ts.map +1 -1
- package/dist/prompts/base.js +3 -5
- package/dist/prompts/base.js.map +1 -1
- package/dist/prompts/chat.cjs +37 -53
- package/dist/prompts/chat.cjs.map +1 -1
- package/dist/prompts/chat.d.cts +1 -0
- package/dist/prompts/chat.d.cts.map +1 -1
- package/dist/prompts/chat.d.ts +1 -1
- package/dist/prompts/chat.d.ts.map +1 -1
- package/dist/prompts/chat.js +23 -39
- package/dist/prompts/chat.js.map +1 -1
- package/dist/prompts/dict.cjs +3 -4
- package/dist/prompts/dict.cjs.map +1 -1
- package/dist/prompts/dict.d.cts.map +1 -1
- package/dist/prompts/dict.d.ts.map +1 -1
- package/dist/prompts/dict.js +1 -2
- package/dist/prompts/dict.js.map +1 -1
- package/dist/prompts/few_shot.cjs +14 -20
- package/dist/prompts/few_shot.cjs.map +1 -1
- package/dist/prompts/few_shot.d.cts.map +1 -1
- package/dist/prompts/few_shot.d.ts +0 -1
- package/dist/prompts/few_shot.d.ts.map +1 -1
- package/dist/prompts/few_shot.js +10 -16
- package/dist/prompts/few_shot.js.map +1 -1
- package/dist/prompts/image.cjs +7 -10
- package/dist/prompts/image.cjs.map +1 -1
- package/dist/prompts/image.d.cts +0 -1
- package/dist/prompts/image.d.cts.map +1 -1
- package/dist/prompts/image.d.ts +0 -2
- package/dist/prompts/image.d.ts.map +1 -1
- package/dist/prompts/image.js +4 -7
- package/dist/prompts/image.js.map +1 -1
- package/dist/prompts/index.cjs +19 -20
- package/dist/prompts/index.js +3 -5
- package/dist/prompts/pipeline.cjs +3 -4
- package/dist/prompts/pipeline.cjs.map +1 -1
- package/dist/prompts/pipeline.d.cts +0 -1
- package/dist/prompts/pipeline.d.cts.map +1 -1
- package/dist/prompts/pipeline.d.ts +0 -1
- package/dist/prompts/pipeline.d.ts.map +1 -1
- package/dist/prompts/pipeline.js +1 -2
- package/dist/prompts/pipeline.js.map +1 -1
- package/dist/prompts/prompt.cjs +12 -16
- package/dist/prompts/prompt.cjs.map +1 -1
- package/dist/prompts/prompt.d.cts +0 -1
- package/dist/prompts/prompt.d.cts.map +1 -1
- package/dist/prompts/prompt.d.ts +0 -1
- package/dist/prompts/prompt.d.ts.map +1 -1
- package/dist/prompts/prompt.js +10 -14
- package/dist/prompts/prompt.js.map +1 -1
- package/dist/prompts/serde.d.cts +0 -1
- package/dist/prompts/serde.d.cts.map +1 -1
- package/dist/prompts/serde.d.ts +0 -2
- package/dist/prompts/serde.d.ts.map +1 -1
- package/dist/prompts/string.cjs +4 -6
- package/dist/prompts/string.cjs.map +1 -1
- package/dist/prompts/string.d.cts +0 -1
- package/dist/prompts/string.d.cts.map +1 -1
- package/dist/prompts/string.d.ts +0 -1
- package/dist/prompts/string.d.ts.map +1 -1
- package/dist/prompts/string.js +2 -4
- package/dist/prompts/string.js.map +1 -1
- package/dist/prompts/structured.cjs +3 -4
- package/dist/prompts/structured.cjs.map +1 -1
- package/dist/prompts/structured.d.cts +0 -1
- package/dist/prompts/structured.d.cts.map +1 -1
- package/dist/prompts/structured.d.ts +0 -1
- package/dist/prompts/structured.d.ts.map +1 -1
- package/dist/prompts/structured.js +1 -2
- package/dist/prompts/structured.js.map +1 -1
- package/dist/prompts/template.cjs +12 -23
- package/dist/prompts/template.cjs.map +1 -1
- package/dist/prompts/template.d.cts +0 -2
- package/dist/prompts/template.d.cts.map +1 -1
- package/dist/prompts/template.d.ts +0 -2
- package/dist/prompts/template.d.ts.map +1 -1
- package/dist/prompts/template.js +8 -20
- package/dist/prompts/template.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.d.cts +0 -1
- package/dist/retrievers/document_compressors/index.d.cts.map +1 -1
- package/dist/retrievers/document_compressors/index.d.ts +0 -1
- package/dist/retrievers/document_compressors/index.d.ts.map +1 -1
- package/dist/retrievers/document_compressors/index.js +3 -5
- package/dist/retrievers/document_compressors/index.js.map +1 -1
- package/dist/retrievers/index.cjs +13 -15
- package/dist/retrievers/index.cjs.map +1 -1
- package/dist/retrievers/index.d.cts +0 -1
- package/dist/retrievers/index.d.cts.map +1 -1
- package/dist/retrievers/index.d.ts +0 -2
- package/dist/retrievers/index.d.ts.map +1 -1
- package/dist/retrievers/index.js +4 -7
- package/dist/retrievers/index.js.map +1 -1
- package/dist/runnables/base.cjs +73 -100
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +3 -4
- package/dist/runnables/base.d.cts.map +1 -1
- package/dist/runnables/base.d.ts +3 -4
- package/dist/runnables/base.d.ts.map +1 -1
- package/dist/runnables/base.js +55 -82
- package/dist/runnables/base.js.map +1 -1
- package/dist/runnables/branch.cjs +8 -13
- package/dist/runnables/branch.cjs.map +1 -1
- package/dist/runnables/branch.d.cts +0 -1
- package/dist/runnables/branch.d.cts.map +1 -1
- package/dist/runnables/branch.d.ts +0 -2
- package/dist/runnables/branch.d.ts.map +1 -1
- package/dist/runnables/branch.js +5 -10
- package/dist/runnables/branch.js.map +1 -1
- package/dist/runnables/config.cjs +5 -8
- package/dist/runnables/config.cjs.map +1 -1
- package/dist/runnables/config.d.cts.map +1 -1
- package/dist/runnables/config.d.ts.map +1 -1
- package/dist/runnables/config.js +3 -5
- package/dist/runnables/config.js.map +1 -1
- package/dist/runnables/graph.cjs +15 -18
- package/dist/runnables/graph.cjs.map +1 -1
- package/dist/runnables/graph.d.cts.map +1 -1
- package/dist/runnables/graph.d.ts.map +1 -1
- package/dist/runnables/graph.js +5 -9
- package/dist/runnables/graph.js.map +1 -1
- package/dist/runnables/graph_mermaid.cjs +8 -12
- package/dist/runnables/graph_mermaid.cjs.map +1 -1
- package/dist/runnables/graph_mermaid.js +7 -11
- package/dist/runnables/graph_mermaid.js.map +1 -1
- package/dist/runnables/history.cjs +12 -17
- package/dist/runnables/history.cjs.map +1 -1
- package/dist/runnables/history.d.cts +2 -4
- package/dist/runnables/history.d.cts.map +1 -1
- package/dist/runnables/history.d.ts +2 -6
- package/dist/runnables/history.d.ts.map +1 -1
- package/dist/runnables/history.js +7 -12
- package/dist/runnables/history.js.map +1 -1
- package/dist/runnables/index.cjs +16 -17
- package/dist/runnables/index.js +3 -5
- package/dist/runnables/iter.cjs +21 -5
- package/dist/runnables/iter.cjs.map +1 -1
- package/dist/runnables/iter.js +17 -3
- package/dist/runnables/iter.js.map +1 -1
- package/dist/runnables/passthrough.cjs +5 -6
- package/dist/runnables/passthrough.cjs.map +1 -1
- package/dist/runnables/passthrough.d.cts.map +1 -1
- package/dist/runnables/passthrough.d.ts +0 -1
- package/dist/runnables/passthrough.d.ts.map +1 -1
- package/dist/runnables/passthrough.js +2 -3
- package/dist/runnables/passthrough.js.map +1 -1
- package/dist/runnables/router.cjs +5 -7
- package/dist/runnables/router.cjs.map +1 -1
- package/dist/runnables/router.d.cts.map +1 -1
- package/dist/runnables/router.d.ts +0 -1
- package/dist/runnables/router.d.ts.map +1 -1
- package/dist/runnables/router.js +3 -5
- package/dist/runnables/router.js.map +1 -1
- package/dist/runnables/types.d.cts +1 -2
- package/dist/runnables/types.d.cts.map +1 -1
- package/dist/runnables/types.d.ts +1 -2
- package/dist/runnables/types.d.ts.map +1 -1
- package/dist/runnables/utils.cjs +2 -4
- package/dist/runnables/utils.cjs.map +1 -1
- package/dist/runnables/utils.js +2 -3
- package/dist/runnables/utils.js.map +1 -1
- package/dist/runnables/wrappers.cjs +2 -3
- package/dist/runnables/wrappers.cjs.map +1 -1
- package/dist/runnables/wrappers.js +1 -2
- package/dist/runnables/wrappers.js.map +1 -1
- package/dist/singletons/async_local_storage/context.cjs +6 -8
- package/dist/singletons/async_local_storage/context.cjs.map +1 -1
- package/dist/singletons/async_local_storage/context.d.cts +0 -1
- package/dist/singletons/async_local_storage/context.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/context.d.ts +0 -1
- package/dist/singletons/async_local_storage/context.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/context.js +3 -5
- package/dist/singletons/async_local_storage/context.js.map +1 -1
- package/dist/singletons/async_local_storage/globals.cjs +1 -2
- package/dist/singletons/async_local_storage/globals.cjs.map +1 -1
- package/dist/singletons/async_local_storage/globals.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/globals.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/globals.js +1 -1
- package/dist/singletons/async_local_storage/globals.js.map +1 -1
- package/dist/singletons/async_local_storage/index.cjs +8 -14
- package/dist/singletons/async_local_storage/index.cjs.map +1 -1
- package/dist/singletons/async_local_storage/index.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/index.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/index.js +4 -10
- package/dist/singletons/async_local_storage/index.js.map +1 -1
- package/dist/singletons/callbacks.cjs +7 -8
- package/dist/singletons/callbacks.cjs.map +1 -1
- package/dist/singletons/callbacks.d.cts +0 -1
- package/dist/singletons/callbacks.d.cts.map +1 -1
- package/dist/singletons/callbacks.d.ts +0 -1
- package/dist/singletons/callbacks.d.ts.map +1 -1
- package/dist/singletons/callbacks.js +2 -4
- package/dist/singletons/callbacks.js.map +1 -1
- package/dist/singletons/index.cjs +11 -12
- package/dist/singletons/index.js +3 -5
- package/dist/singletons/tracer.cjs +5 -9
- package/dist/singletons/tracer.cjs.map +1 -1
- package/dist/singletons/tracer.js +2 -6
- package/dist/singletons/tracer.js.map +1 -1
- package/dist/stores.cjs +10 -11
- package/dist/stores.cjs.map +1 -1
- package/dist/stores.d.cts +0 -1
- package/dist/stores.d.cts.map +1 -1
- package/dist/stores.d.ts +0 -1
- package/dist/stores.d.ts.map +1 -1
- package/dist/stores.js +3 -5
- package/dist/stores.js.map +1 -1
- package/dist/structured_query/base.cjs +6 -7
- package/dist/structured_query/base.cjs.map +1 -1
- package/dist/structured_query/base.d.cts +0 -1
- package/dist/structured_query/base.d.cts.map +1 -1
- package/dist/structured_query/base.d.ts +0 -1
- package/dist/structured_query/base.d.ts.map +1 -1
- package/dist/structured_query/base.js +4 -5
- package/dist/structured_query/base.js.map +1 -1
- package/dist/structured_query/functional.cjs +7 -8
- package/dist/structured_query/functional.cjs.map +1 -1
- package/dist/structured_query/functional.d.cts +0 -1
- package/dist/structured_query/functional.d.cts.map +1 -1
- package/dist/structured_query/functional.d.ts +0 -1
- package/dist/structured_query/functional.d.ts.map +1 -1
- package/dist/structured_query/functional.js +4 -5
- package/dist/structured_query/functional.js.map +1 -1
- package/dist/structured_query/index.cjs +13 -14
- package/dist/structured_query/index.js +3 -5
- package/dist/structured_query/ir.cjs +1 -2
- package/dist/structured_query/ir.cjs.map +1 -1
- package/dist/structured_query/ir.d.cts +0 -1
- package/dist/structured_query/ir.d.cts.map +1 -1
- package/dist/structured_query/ir.d.ts +0 -1
- package/dist/structured_query/ir.d.ts.map +1 -1
- package/dist/structured_query/ir.js +1 -1
- package/dist/structured_query/ir.js.map +1 -1
- package/dist/structured_query/utils.cjs +1 -2
- package/dist/structured_query/utils.cjs.map +1 -1
- package/dist/structured_query/utils.d.cts.map +1 -1
- package/dist/structured_query/utils.d.ts.map +1 -1
- package/dist/structured_query/utils.js +1 -1
- package/dist/structured_query/utils.js.map +1 -1
- package/dist/testing/fake_model_builder.cjs +225 -0
- package/dist/testing/fake_model_builder.cjs.map +1 -0
- package/dist/testing/fake_model_builder.d.cts +138 -0
- package/dist/testing/fake_model_builder.d.cts.map +1 -0
- package/dist/testing/fake_model_builder.d.ts +138 -0
- package/dist/testing/fake_model_builder.d.ts.map +1 -0
- package/dist/testing/fake_model_builder.js +224 -0
- package/dist/testing/fake_model_builder.js.map +1 -0
- package/dist/testing/index.cjs +42 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +3 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.js +23 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/matchers.cjs +212 -0
- package/dist/testing/matchers.cjs.map +1 -0
- package/dist/testing/matchers.d.cts +94 -0
- package/dist/testing/matchers.d.cts.map +1 -0
- package/dist/testing/matchers.d.ts +94 -0
- package/dist/testing/matchers.d.ts.map +1 -0
- package/dist/testing/matchers.js +202 -0
- package/dist/testing/matchers.js.map +1 -0
- package/dist/tools/index.cjs +51 -36
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +31 -24
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +31 -26
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +32 -18
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.cjs +3 -4
- package/dist/tools/types.cjs.map +1 -1
- package/dist/tools/types.d.cts +26 -11
- package/dist/tools/types.d.cts.map +1 -1
- package/dist/tools/types.d.ts +26 -13
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +1 -2
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/utils.cjs +1 -2
- package/dist/tools/utils.cjs.map +1 -1
- package/dist/tools/utils.d.cts +0 -1
- package/dist/tools/utils.d.cts.map +1 -1
- package/dist/tools/utils.d.ts +0 -1
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +1 -1
- package/dist/tools/utils.js.map +1 -1
- package/dist/tracers/base.cjs +20 -18
- package/dist/tracers/base.cjs.map +1 -1
- package/dist/tracers/base.d.cts +92 -98
- package/dist/tracers/base.d.cts.map +1 -1
- package/dist/tracers/base.d.ts +92 -98
- package/dist/tracers/base.d.ts.map +1 -1
- package/dist/tracers/base.js +11 -10
- package/dist/tracers/base.js.map +1 -1
- package/dist/tracers/console.cjs +16 -17
- package/dist/tracers/console.cjs.map +1 -1
- package/dist/tracers/console.d.cts +0 -1
- package/dist/tracers/console.d.cts.map +1 -1
- package/dist/tracers/console.d.ts +0 -1
- package/dist/tracers/console.d.ts.map +1 -1
- package/dist/tracers/console.js +7 -10
- package/dist/tracers/console.js.map +1 -1
- package/dist/tracers/event_stream.cjs +24 -10
- package/dist/tracers/event_stream.cjs.map +1 -1
- package/dist/tracers/event_stream.d.cts +7 -6
- package/dist/tracers/event_stream.d.cts.map +1 -1
- package/dist/tracers/event_stream.d.ts +7 -7
- package/dist/tracers/event_stream.d.ts.map +1 -1
- package/dist/tracers/event_stream.js +20 -6
- package/dist/tracers/event_stream.js.map +1 -1
- package/dist/tracers/log_stream.cjs +15 -16
- package/dist/tracers/log_stream.cjs.map +1 -1
- package/dist/tracers/log_stream.d.cts +14 -31
- package/dist/tracers/log_stream.d.cts.map +1 -1
- package/dist/tracers/log_stream.d.ts +14 -31
- package/dist/tracers/log_stream.d.ts.map +1 -1
- package/dist/tracers/log_stream.js +5 -7
- package/dist/tracers/log_stream.js.map +1 -1
- package/dist/tracers/root_listener.cjs +2 -3
- package/dist/tracers/root_listener.cjs.map +1 -1
- package/dist/tracers/root_listener.js +1 -2
- package/dist/tracers/root_listener.js.map +1 -1
- package/dist/tracers/run_collector.cjs +10 -11
- package/dist/tracers/run_collector.cjs.map +1 -1
- package/dist/tracers/run_collector.d.cts +0 -1
- package/dist/tracers/run_collector.d.cts.map +1 -1
- package/dist/tracers/run_collector.d.ts +0 -1
- package/dist/tracers/run_collector.d.ts.map +1 -1
- package/dist/tracers/run_collector.js +3 -5
- package/dist/tracers/run_collector.js.map +1 -1
- package/dist/tracers/tracer_langchain.cjs +43 -19
- package/dist/tracers/tracer_langchain.cjs.map +1 -1
- package/dist/tracers/tracer_langchain.d.cts +2 -1
- package/dist/tracers/tracer_langchain.d.cts.map +1 -1
- package/dist/tracers/tracer_langchain.d.ts +2 -1
- package/dist/tracers/tracer_langchain.d.ts.map +1 -1
- package/dist/tracers/tracer_langchain.js +33 -10
- package/dist/tracers/tracer_langchain.js.map +1 -1
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.ts.map +1 -1
- package/dist/types/stream.cjs +8 -8
- package/dist/types/stream.js +3 -2
- package/dist/types/type-utils.d.cts +2 -1
- package/dist/types/type-utils.d.cts.map +1 -1
- package/dist/types/type-utils.d.ts +2 -1
- package/dist/types/type-utils.d.ts.map +1 -1
- package/dist/utils/async_caller.cjs +29 -22
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.d.cts.map +1 -1
- package/dist/utils/async_caller.d.ts.map +1 -1
- package/dist/utils/async_caller.js +19 -14
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/callbacks.cjs +4 -6
- package/dist/utils/callbacks.cjs.map +1 -1
- package/dist/utils/callbacks.js +3 -5
- package/dist/utils/callbacks.js.map +1 -1
- package/dist/utils/chunk_array.cjs +9 -12
- package/dist/utils/chunk_array.cjs.map +1 -1
- package/dist/utils/chunk_array.d.cts.map +1 -1
- package/dist/utils/chunk_array.d.ts.map +1 -1
- package/dist/utils/chunk_array.js +4 -7
- package/dist/utils/chunk_array.js.map +1 -1
- package/dist/utils/context.cjs +104 -0
- package/dist/utils/context.cjs.map +1 -0
- package/dist/utils/context.d.cts +44 -0
- package/dist/utils/context.d.cts.map +1 -0
- package/dist/utils/context.d.ts +44 -0
- package/dist/utils/context.d.ts.map +1 -0
- package/dist/utils/context.js +98 -0
- package/dist/utils/context.js.map +1 -0
- package/dist/utils/env.cjs +14 -19
- package/dist/utils/env.cjs.map +1 -1
- package/dist/utils/env.d.cts.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +9 -14
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/event_source_parse.cjs +16 -17
- package/dist/utils/event_source_parse.cjs.map +1 -1
- package/dist/utils/event_source_parse.d.cts +2 -2
- package/dist/utils/event_source_parse.d.cts.map +1 -1
- package/dist/utils/event_source_parse.d.ts +2 -2
- package/dist/utils/event_source_parse.d.ts.map +1 -1
- package/dist/utils/event_source_parse.js +9 -11
- package/dist/utils/event_source_parse.js.map +1 -1
- package/dist/utils/fast-json-patch/index.cjs +5 -13
- package/dist/utils/fast-json-patch/index.cjs.map +1 -1
- package/dist/utils/fast-json-patch/index.js +6 -13
- package/dist/utils/fast-json-patch/index.js.map +1 -1
- package/dist/utils/fast-json-patch/src/core.cjs +16 -28
- package/dist/utils/fast-json-patch/src/core.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.cts +0 -1
- package/dist/utils/fast-json-patch/src/core.d.cts.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.ts +0 -1
- package/dist/utils/fast-json-patch/src/core.d.ts.map +1 -1
- package/dist/utils/fast-json-patch/src/core.js +10 -22
- package/dist/utils/fast-json-patch/src/core.js.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.cjs +8 -7
- package/dist/utils/fast-json-patch/src/duplex.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.d.cts +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.cts.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.d.ts +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.ts.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.js +6 -5
- package/dist/utils/fast-json-patch/src/duplex.js.map +1 -1
- package/dist/utils/fast-json-patch/src/helpers.cjs +5 -6
- package/dist/utils/fast-json-patch/src/helpers.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/helpers.js +5 -5
- package/dist/utils/fast-json-patch/src/helpers.js.map +1 -1
- package/dist/utils/format.cjs +8 -8
- package/dist/utils/format.d.cts.map +1 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +3 -2
- package/dist/utils/function_calling.cjs +11 -12
- package/dist/utils/function_calling.cjs.map +1 -1
- package/dist/utils/function_calling.d.cts +0 -1
- package/dist/utils/function_calling.d.cts.map +1 -1
- package/dist/utils/function_calling.d.ts +0 -1
- package/dist/utils/function_calling.d.ts.map +1 -1
- package/dist/utils/function_calling.js +3 -5
- package/dist/utils/function_calling.js.map +1 -1
- package/dist/utils/hash.cjs +10 -11
- package/dist/utils/hash.d.cts +0 -1
- package/dist/utils/hash.d.cts.map +1 -1
- package/dist/utils/hash.d.ts +0 -1
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/hash.js +3 -5
- package/dist/utils/is-network-error/index.cjs +3 -5
- package/dist/utils/is-network-error/index.cjs.map +1 -1
- package/dist/utils/is-network-error/index.js +3 -4
- package/dist/utils/is-network-error/index.js.map +1 -1
- package/dist/utils/js-sha256/hash.cjs +42 -37
- package/dist/utils/js-sha256/hash.cjs.map +1 -1
- package/dist/utils/js-sha256/hash.d.cts.map +1 -1
- package/dist/utils/js-sha256/hash.d.ts.map +1 -1
- package/dist/utils/js-sha256/hash.js +42 -36
- package/dist/utils/js-sha256/hash.js.map +1 -1
- package/dist/utils/json.cjs +1 -2
- package/dist/utils/json.cjs.map +1 -1
- package/dist/utils/json.d.cts.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js +1 -1
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/json_patch.cjs +12 -13
- package/dist/utils/json_patch.js +3 -5
- package/dist/utils/json_schema.cjs +60 -37
- package/dist/utils/json_schema.cjs.map +1 -1
- package/dist/utils/json_schema.d.cts +4 -2
- package/dist/utils/json_schema.d.cts.map +1 -1
- package/dist/utils/json_schema.d.ts +4 -3
- package/dist/utils/json_schema.d.ts.map +1 -1
- package/dist/utils/json_schema.js +36 -14
- package/dist/utils/json_schema.js.map +1 -1
- package/dist/utils/math.cjs +16 -18
- package/dist/utils/math.cjs.map +1 -1
- package/dist/utils/math.d.cts.map +1 -1
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/math.js +9 -12
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/ml-distance/distances.cjs +1 -2
- package/dist/utils/ml-distance/distances.cjs.map +1 -1
- package/dist/utils/ml-distance/distances.js +1 -1
- package/dist/utils/ml-distance/distances.js.map +1 -1
- package/dist/utils/ml-distance/similarities.cjs +1 -2
- package/dist/utils/ml-distance/similarities.cjs.map +1 -1
- package/dist/utils/ml-distance/similarities.d.cts.map +1 -1
- package/dist/utils/ml-distance/similarities.d.ts.map +1 -1
- package/dist/utils/ml-distance/similarities.js +1 -1
- package/dist/utils/ml-distance/similarities.js.map +1 -1
- package/dist/utils/ml-distance-euclidean/euclidean.cjs +1 -2
- package/dist/utils/ml-distance-euclidean/euclidean.cjs.map +1 -1
- package/dist/utils/ml-distance-euclidean/euclidean.js +1 -1
- package/dist/utils/ml-distance-euclidean/euclidean.js.map +1 -1
- package/dist/utils/namespace.cjs +62 -0
- package/dist/utils/namespace.cjs.map +1 -0
- package/dist/utils/namespace.d.cts +73 -0
- package/dist/utils/namespace.d.cts.map +1 -0
- package/dist/utils/namespace.d.ts +73 -0
- package/dist/utils/namespace.d.ts.map +1 -0
- package/dist/utils/namespace.js +62 -0
- package/dist/utils/namespace.js.map +1 -0
- package/dist/utils/p-retry/index.cjs +4 -5
- package/dist/utils/p-retry/index.cjs.map +1 -1
- package/dist/utils/p-retry/index.js +3 -4
- package/dist/utils/p-retry/index.js.map +1 -1
- package/dist/utils/sax-js/sax.cjs +29 -36
- package/dist/utils/sax-js/sax.cjs.map +1 -1
- package/dist/utils/sax-js/sax.js +29 -35
- package/dist/utils/sax-js/sax.js.map +1 -1
- package/dist/utils/signal.cjs +3 -4
- package/dist/utils/signal.cjs.map +1 -1
- package/dist/utils/signal.d.cts.map +1 -1
- package/dist/utils/signal.d.ts.map +1 -1
- package/dist/utils/signal.js +3 -3
- package/dist/utils/signal.js.map +1 -1
- package/dist/utils/ssrf.cjs +267 -0
- package/dist/utils/ssrf.cjs.map +1 -0
- package/dist/utils/ssrf.d.cts +52 -0
- package/dist/utils/ssrf.d.cts.map +1 -0
- package/dist/utils/ssrf.d.ts +52 -0
- package/dist/utils/ssrf.d.ts.map +1 -0
- package/dist/utils/ssrf.js +256 -0
- package/dist/utils/ssrf.js.map +1 -0
- package/dist/utils/standard_schema.cjs +41 -0
- package/dist/utils/standard_schema.cjs.map +1 -0
- package/dist/utils/standard_schema.d.cts +27 -0
- package/dist/utils/standard_schema.d.cts.map +1 -0
- package/dist/utils/standard_schema.d.ts +27 -0
- package/dist/utils/standard_schema.d.ts.map +1 -0
- package/dist/utils/standard_schema.js +33 -0
- package/dist/utils/standard_schema.js.map +1 -0
- package/dist/utils/stream.cjs +15 -16
- package/dist/utils/stream.cjs.map +1 -1
- package/dist/utils/stream.d.cts +2 -2
- package/dist/utils/stream.d.cts.map +1 -1
- package/dist/utils/stream.d.ts +2 -2
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/stream.js +5 -7
- package/dist/utils/stream.js.map +1 -1
- package/dist/utils/testing/chat_models.cjs +10 -13
- package/dist/utils/testing/chat_models.cjs.map +1 -1
- package/dist/utils/testing/chat_models.d.cts.map +1 -1
- package/dist/utils/testing/chat_models.d.ts +0 -1
- package/dist/utils/testing/chat_models.d.ts.map +1 -1
- package/dist/utils/testing/chat_models.js +4 -7
- package/dist/utils/testing/chat_models.js.map +1 -1
- package/dist/utils/testing/embeddings.cjs +4 -7
- package/dist/utils/testing/embeddings.cjs.map +1 -1
- package/dist/utils/testing/embeddings.d.cts +0 -1
- package/dist/utils/testing/embeddings.d.cts.map +1 -1
- package/dist/utils/testing/embeddings.d.ts +0 -1
- package/dist/utils/testing/embeddings.d.ts.map +1 -1
- package/dist/utils/testing/embeddings.js +3 -6
- package/dist/utils/testing/embeddings.js.map +1 -1
- package/dist/utils/testing/index.cjs +19 -20
- package/dist/utils/testing/index.js +3 -5
- package/dist/utils/testing/llms.cjs +2 -3
- package/dist/utils/testing/llms.cjs.map +1 -1
- package/dist/utils/testing/llms.d.cts.map +1 -1
- package/dist/utils/testing/llms.d.ts.map +1 -1
- package/dist/utils/testing/llms.js +1 -2
- package/dist/utils/testing/llms.js.map +1 -1
- package/dist/utils/testing/message_history.cjs +6 -7
- package/dist/utils/testing/message_history.cjs.map +1 -1
- package/dist/utils/testing/message_history.d.cts.map +1 -1
- package/dist/utils/testing/message_history.d.ts +0 -1
- package/dist/utils/testing/message_history.d.ts.map +1 -1
- package/dist/utils/testing/message_history.js +2 -3
- package/dist/utils/testing/message_history.js.map +1 -1
- package/dist/utils/testing/output_parsers.cjs +2 -3
- package/dist/utils/testing/output_parsers.cjs.map +1 -1
- package/dist/utils/testing/output_parsers.d.cts +0 -1
- package/dist/utils/testing/output_parsers.d.cts.map +1 -1
- package/dist/utils/testing/output_parsers.d.ts +0 -1
- package/dist/utils/testing/output_parsers.d.ts.map +1 -1
- package/dist/utils/testing/output_parsers.js +1 -2
- package/dist/utils/testing/output_parsers.js.map +1 -1
- package/dist/utils/testing/retrievers.cjs +3 -4
- package/dist/utils/testing/retrievers.cjs.map +1 -1
- package/dist/utils/testing/retrievers.d.cts.map +1 -1
- package/dist/utils/testing/retrievers.d.ts.map +1 -1
- package/dist/utils/testing/retrievers.js +2 -3
- package/dist/utils/testing/retrievers.js.map +1 -1
- package/dist/utils/testing/runnables.cjs +2 -3
- package/dist/utils/testing/runnables.cjs.map +1 -1
- package/dist/utils/testing/runnables.d.cts.map +1 -1
- package/dist/utils/testing/runnables.d.ts.map +1 -1
- package/dist/utils/testing/runnables.js +1 -2
- package/dist/utils/testing/runnables.js.map +1 -1
- package/dist/utils/testing/tools.cjs +2 -3
- package/dist/utils/testing/tools.cjs.map +1 -1
- package/dist/utils/testing/tools.d.cts.map +1 -1
- package/dist/utils/testing/tools.d.ts.map +1 -1
- package/dist/utils/testing/tools.js +1 -2
- package/dist/utils/testing/tools.js.map +1 -1
- package/dist/utils/testing/tracers.cjs +2 -3
- package/dist/utils/testing/tracers.cjs.map +1 -1
- package/dist/utils/testing/tracers.d.cts.map +1 -1
- package/dist/utils/testing/tracers.d.ts.map +1 -1
- package/dist/utils/testing/tracers.js +1 -2
- package/dist/utils/testing/tracers.js.map +1 -1
- package/dist/utils/testing/vectorstores.cjs +10 -15
- package/dist/utils/testing/vectorstores.cjs.map +1 -1
- package/dist/utils/testing/vectorstores.d.cts +0 -1
- package/dist/utils/testing/vectorstores.d.cts.map +1 -1
- package/dist/utils/testing/vectorstores.d.ts +0 -1
- package/dist/utils/testing/vectorstores.d.ts.map +1 -1
- package/dist/utils/testing/vectorstores.js +8 -13
- package/dist/utils/testing/vectorstores.js.map +1 -1
- package/dist/utils/tiktoken.cjs +11 -12
- package/dist/utils/tiktoken.cjs.map +1 -1
- package/dist/utils/tiktoken.d.cts.map +1 -1
- package/dist/utils/tiktoken.d.ts.map +1 -1
- package/dist/utils/tiktoken.js +3 -5
- package/dist/utils/tiktoken.js.map +1 -1
- package/dist/utils/types/index.cjs +10 -11
- package/dist/utils/types/index.cjs.map +1 -1
- package/dist/utils/types/index.d.cts +2 -3
- package/dist/utils/types/index.d.cts.map +1 -1
- package/dist/utils/types/index.d.ts +2 -3
- package/dist/utils/types/index.d.ts.map +1 -1
- package/dist/utils/types/index.js +3 -5
- package/dist/utils/types/index.js.map +1 -1
- package/dist/utils/types/zod.cjs +20 -36
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +144 -33
- package/dist/utils/types/zod.d.cts.map +1 -1
- package/dist/utils/types/zod.d.ts +144 -33
- package/dist/utils/types/zod.d.ts.map +1 -1
- package/dist/utils/types/zod.js +18 -34
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.cjs +1 -2
- package/dist/utils/zod-to-json-schema/Options.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/Options.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/Options.js +1 -1
- package/dist/utils/zod-to-json-schema/Options.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Refs.cjs +2 -3
- package/dist/utils/zod-to-json-schema/Refs.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/Refs.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/Refs.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/Refs.js +1 -2
- package/dist/utils/zod-to-json-schema/Refs.js.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.cjs +1 -2
- package/dist/utils/zod-to-json-schema/errorMessages.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.js +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.js.map +1 -1
- package/dist/utils/zod-to-json-schema/getRelativePath.cjs +1 -2
- package/dist/utils/zod-to-json-schema/getRelativePath.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/getRelativePath.js +1 -1
- package/dist/utils/zod-to-json-schema/getRelativePath.js.map +1 -1
- package/dist/utils/zod-to-json-schema/index.cjs +37 -37
- package/dist/utils/zod-to-json-schema/index.d.cts +24 -0
- package/dist/utils/zod-to-json-schema/index.d.ts +1 -14
- package/dist/utils/zod-to-json-schema/index.js +38 -37
- package/dist/utils/zod-to-json-schema/parseDef.cjs +5 -6
- package/dist/utils/zod-to-json-schema/parseDef.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parseDef.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parseDef.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parseDef.js +1 -2
- package/dist/utils/zod-to-json-schema/parseDef.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/any.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/any.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.cjs +5 -6
- package/dist/utils/zod-to-json-schema/parsers/array.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/array.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/bigint.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/bigint.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/boolean.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/branded.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/branded.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/branded.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/branded.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/branded.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/catch.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/catch.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/catch.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/catch.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/catch.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/date.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.cts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts +0 -4
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/date.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/default.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/default.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/default.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/default.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/default.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/default.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/effects.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/effects.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/effects.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/effects.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/effects.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/enum.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/intersection.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.js +2 -3
- package/dist/utils/zod-to-json-schema/parsers/intersection.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/literal.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.cjs +21 -24
- package/dist/utils/zod-to-json-schema/parsers/map.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.cts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts +0 -4
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.js +18 -21
- package/dist/utils/zod-to-json-schema/parsers/map.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs +3 -5
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js +3 -4
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/never.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/never.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/null.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.cjs +8 -9
- package/dist/utils/zod-to-json-schema/parsers/nullable.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.js +6 -7
- package/dist/utils/zod-to-json-schema/parsers/nullable.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/number.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/number.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/object.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/object.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/optional.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/optional.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/optional.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/optional.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/optional.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs +4 -6
- package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/pipeline.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +1 -4
- package/dist/utils/zod-to-json-schema/parsers/pipeline.js +3 -5
- package/dist/utils/zod-to-json-schema/parsers/pipeline.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/promise.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/promise.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/promise.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/promise.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/promise.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/readonly.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/readonly.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/readonly.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/readonly.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/readonly.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.cjs +9 -10
- package/dist/utils/zod-to-json-schema/parsers/record.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.js +3 -4
- package/dist/utils/zod-to-json-schema/parsers/record.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.cjs +7 -9
- package/dist/utils/zod-to-json-schema/parsers/set.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.js +5 -7
- package/dist/utils/zod-to-json-schema/parsers/set.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/string.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.cts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts +0 -4
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/string.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/tuple.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/tuple.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/undefined.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/undefined.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.cjs +5 -9
- package/dist/utils/zod-to-json-schema/parsers/union.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.cts +1 -2
- package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.js +4 -8
- package/dist/utils/zod-to-json-schema/parsers/union.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/unknown.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts +0 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/unknown.js.map +1 -1
- package/dist/utils/zod-to-json-schema/selectParser.cjs +34 -35
- package/dist/utils/zod-to-json-schema/selectParser.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/selectParser.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/selectParser.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/selectParser.js +2 -3
- package/dist/utils/zod-to-json-schema/selectParser.js.map +1 -1
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs +7 -8
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.cts +1 -0
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.js +4 -5
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.js.map +1 -1
- package/dist/vectorstores.cjs +12 -14
- package/dist/vectorstores.cjs.map +1 -1
- package/dist/vectorstores.d.cts +0 -1
- package/dist/vectorstores.d.cts.map +1 -1
- package/dist/vectorstores.d.ts +0 -1
- package/dist/vectorstores.d.ts.map +1 -1
- package/dist/vectorstores.js +4 -7
- package/dist/vectorstores.js.map +1 -1
- package/package.json +116 -19
- package/dist/_virtual/rolldown_runtime.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,314 @@
|
|
|
1
1
|
# @langchain/core
|
|
2
2
|
|
|
3
|
+
## 1.1.39
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#10430](https://github.com/langchain-ai/langchainjs/pull/10430) [`d3d0922`](https://github.com/langchain-ai/langchainjs/commit/d3d0922c24afcd3006fb94dcadd3ebe08fbf2383) Thanks [@christian-bromann](https://github.com/christian-bromann)! - feat(langchain): support for browser tools
|
|
8
|
+
|
|
9
|
+
## 1.1.38
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#10552](https://github.com/langchain-ai/langchainjs/pull/10552) [`589ab9b`](https://github.com/langchain-ai/langchainjs/commit/589ab9be391a5d6c104f34877fc1b3e2a32fa449) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(langchain): accept cross-version runnable models in createAgent
|
|
14
|
+
|
|
15
|
+
## 1.1.37
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#10511](https://github.com/langchain-ai/langchainjs/pull/10511) [`6933769`](https://github.com/langchain-ai/langchainjs/commit/6933769836fe3cec835588e5f8db9883200865f6) Thanks [@hntrl](https://github.com/hntrl)! - cache Zod-to-JSON-Schema conversions in toJsonSchema()
|
|
20
|
+
|
|
21
|
+
- [#10541](https://github.com/langchain-ai/langchainjs/pull/10541) [`50d5f32`](https://github.com/langchain-ai/langchainjs/commit/50d5f32fd30cabebf058b1c13255c1daadde6107) Thanks [@jacoblee93](https://github.com/jacoblee93)! - revert: Revert "feat(core): Add all chat model/llm invocation params to metadata"
|
|
22
|
+
|
|
23
|
+
- [#10509](https://github.com/langchain-ai/langchainjs/pull/10509) [`5552999`](https://github.com/langchain-ai/langchainjs/commit/555299917c90322e25d7671bad2e20c9b104bad6) Thanks [@hntrl](https://github.com/hntrl)! - feat(openai): add support for phase parameter on Responses API messages
|
|
24
|
+
- Extract `phase` from message output items and surface it on text content blocks
|
|
25
|
+
- Support phase in streaming via `response.output_item.added` events
|
|
26
|
+
- Round-trip phase through both raw provider and standard content paths
|
|
27
|
+
- Move phase into `extras` dict in the core standard content translator
|
|
28
|
+
|
|
29
|
+
- [#10528](https://github.com/langchain-ai/langchainjs/pull/10528) [`8331833`](https://github.com/langchain-ai/langchainjs/commit/8331833c93ba907063c9fe28e9f935ed5dfec11c) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): normalize single-block content in mergeContent
|
|
30
|
+
|
|
31
|
+
## 1.1.36
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [#10512](https://github.com/langchain-ai/langchainjs/pull/10512) [`bbbfea1`](https://github.com/langchain-ai/langchainjs/commit/bbbfea185c0777ae06df2b24a1a84f941d499c2a) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): fix streaming chunk merge for providers without `index` on tool call deltas
|
|
36
|
+
|
|
37
|
+
`_mergeLists` now falls back to `id`-based matching when items don't have an `index` field. Previously, providers routing through the OpenAI-compatible API without `index` on streaming tool call deltas (e.g. Anthropic models via `ChatOpenAI`) would accumulate hundreds of individual raw deltas in `tool_call_chunks` and `additional_kwargs.tool_calls` instead of merging them into a single entry per tool call. In a real trace with 3 concurrent subagents, this caused a single AI message to balloon from ~4KB to 146KB -- with 826 uncollapsed streaming fragments carrying a few bytes each.
|
|
38
|
+
|
|
39
|
+
Also fixes `SystemMessage.concat()` which used `...this` to spread all instance properties (including `lc_kwargs`) into the new constructor, causing each chained `concat()` call to nest one level deeper. After 7 middleware `concat()` calls (typical in deepagents), a 7KB system prompt would serialize to 81KB due to content being duplicated at every nesting level.
|
|
40
|
+
|
|
41
|
+
## 1.1.35
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [#10327](https://github.com/langchain-ai/langchainjs/pull/10327) [`5dc11b5`](https://github.com/langchain-ai/langchainjs/commit/5dc11b55cccfe35e4dad910a33e904cf49b3088a) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): replace exported zod type references with structural duck-type interfaces to fix TypeScript OOM
|
|
46
|
+
|
|
47
|
+
Replaces all exported Zod type references (`z3.ZodType`, `z4.$ZodType`, etc.) in `@langchain/core`'s public API with minimal structural ("duck-type") interfaces. This prevents TypeScript from performing expensive deep structural comparisons (~3,400+ lines of mutually recursive generics) when downstream packages resolve a different Zod version than `@langchain/core`, which was causing OOM crashes and unresponsive language servers in monorepo setups.
|
|
48
|
+
|
|
49
|
+
- [#10433](https://github.com/langchain-ai/langchainjs/pull/10433) [`7af0b65`](https://github.com/langchain-ai/langchainjs/commit/7af0b65d5ab9a173b528d6a821d269a79fbabdc6) Thanks [@tanushree-sharma](https://github.com/tanushree-sharma)! - feat: Add LangSmith integration metadata to createAgent and initChatModel
|
|
50
|
+
|
|
51
|
+
## 1.1.34
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- [#10312](https://github.com/langchain-ai/langchainjs/pull/10312) [`bfb7944`](https://github.com/langchain-ai/langchainjs/commit/bfb7944a105470eee98fe4a0eef91e586600e1de) Thanks [@jacoblee93](https://github.com/jacoblee93)! - feat(core): Add all invocation params as part of metadata
|
|
56
|
+
|
|
57
|
+
## 1.1.33
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- [#10412](https://github.com/langchain-ai/langchainjs/pull/10412) [`6db417b`](https://github.com/langchain-ai/langchainjs/commit/6db417b03ecb5e2ace413389d982294e0ac88433) Thanks [@pawel-twardziak](https://github.com/pawel-twardziak)! - fix(core): respect timeout option in streamEvents v2
|
|
62
|
+
|
|
63
|
+
- [#10424](https://github.com/langchain-ai/langchainjs/pull/10424) [`d69dfcc`](https://github.com/langchain-ai/langchainjs/commit/d69dfcca97503cf1c0b7e70ccf5fb7d507c60982) Thanks [@pawel-twardziak](https://github.com/pawel-twardziak)! - fix(core): preserve multimodal content in getBufferString as placeholders
|
|
64
|
+
|
|
65
|
+
## 1.1.32
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- [#10330](https://github.com/langchain-ai/langchainjs/pull/10330) [`26488b5`](https://github.com/langchain-ai/langchainjs/commit/26488b596f01b7b7fe2f1d97d07164e52365ade5) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): treat empty string tool call chunk IDs as missing during merge
|
|
70
|
+
|
|
71
|
+
Fixed `_mergeLists` in message base to treat empty string `""` IDs the same as `null`/`undefined` when merging tool call chunks. This fixes old completions-style streaming where follow-up chunks carry `id: ""` instead of `undefined`, which previously prevented chunks from being merged by index.
|
|
72
|
+
|
|
73
|
+
- [#10167](https://github.com/langchain-ai/langchainjs/pull/10167) [`ca826f6`](https://github.com/langchain-ai/langchainjs/commit/ca826f6fecae6087bf0dee7781ee80b587396ec1) Thanks [@colifran](https://github.com/colifran)! - feat: implement type inference for tool streams
|
|
74
|
+
|
|
75
|
+
- [#10334](https://github.com/langchain-ai/langchainjs/pull/10334) [`a602c42`](https://github.com/langchain-ai/langchainjs/commit/a602c42db75d7e7e01cab38b12e0b65b9c0cce95) Thanks [@maahir30](https://github.com/maahir30)! - fix(core): add JSDoc docstrings to fakeModel builder API and export FakeBuiltModel
|
|
76
|
+
|
|
77
|
+
- [#10254](https://github.com/langchain-ai/langchainjs/pull/10254) [`db7d017`](https://github.com/langchain-ai/langchainjs/commit/db7d017f7ce13cb937147aabcbfa3847d80bde9d) Thanks [@pawel-twardziak](https://github.com/pawel-twardziak)! - fix(core): preserve thoughtSignature in array content during streaming with thinking models
|
|
78
|
+
|
|
79
|
+
## 1.1.31
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- [#10271](https://github.com/langchain-ai/langchainjs/pull/10271) [`7373b4c`](https://github.com/langchain-ai/langchainjs/commit/7373b4cd6a78bee105a952a11838c573fd1aafae) Thanks [@jacoblee93](https://github.com/jacoblee93)! - feat(core): Use uuid7 instead of v4 for generating run ids
|
|
84
|
+
|
|
85
|
+
- [#10262](https://github.com/langchain-ai/langchainjs/pull/10262) [`b0175a5`](https://github.com/langchain-ai/langchainjs/commit/b0175a5d3b68e8fba44a85bc23879bd06def2f52) Thanks [@maahir30](https://github.com/maahir30)! - fix: Move fakeModel from utils/testing to testing namespace
|
|
86
|
+
move to updated namespace
|
|
87
|
+
|
|
88
|
+
- [#10185](https://github.com/langchain-ai/langchainjs/pull/10185) [`414f6ed`](https://github.com/langchain-ai/langchainjs/commit/414f6ed402ac6f1c0fd6cce4bed64fa3708eea3d) Thanks [@maahir30](https://github.com/maahir30)! - feat: add custom Vitest matchers for LangChain message and tool call assertions
|
|
89
|
+
|
|
90
|
+
Adds a new `@langchain/core/testing/matchers` export containing custom Vitest matchers (`toBeHumanMessage`, `toBeAIMessage`, `toBeSystemMessage`, `toBeToolMessage`, `toHaveToolCalls`, `toHaveToolCallCount`, `toContainToolCall`, `toHaveToolMessages`, `toHaveBeenInterrupted`, `toHaveStructuredResponse`) that external users can register via `expect.extend(langchainMatchers)` in their Vitest setup files. Re-exported from `langchain` for convenience.
|
|
91
|
+
|
|
92
|
+
## 1.1.30
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- [#10243](https://github.com/langchain-ai/langchainjs/pull/10243) [`96c630d`](https://github.com/langchain-ai/langchainjs/commit/96c630dfd009f2546d5bc36f5067ff868bb4067f) Thanks [@hntrl](https://github.com/hntrl)! - fix: add explicit `: symbol` type annotations to Symbol.for() declarations for cross-version compatibility
|
|
97
|
+
|
|
98
|
+
TypeScript infers `unique symbol` type when Symbol.for() is used without an explicit type annotation, causing type incompatibility when multiple versions of the same package are present in a dependency tree. By adding explicit `: symbol` annotations, all declarations now use the general symbol type, making them compatible across versions while maintaining identical runtime behavior.
|
|
99
|
+
|
|
100
|
+
Changes:
|
|
101
|
+
- Added `: symbol` to `MESSAGE_SYMBOL` in messages/base.ts
|
|
102
|
+
- Added `: symbol` to `MIDDLEWARE_BRAND` in agents/middleware/types.ts (also changed from Symbol() to Symbol.for() for cross-realm compatibility)
|
|
103
|
+
|
|
104
|
+
- [#10256](https://github.com/langchain-ai/langchainjs/pull/10256) [`a8b9ccc`](https://github.com/langchain-ai/langchainjs/commit/a8b9ccca5a85984a5a30008acd09f9991e591638) Thanks [@colifran](https://github.com/colifran)! - fix(core): standard schema type guards don't support callable schemas
|
|
105
|
+
|
|
106
|
+
- [#10204](https://github.com/langchain-ai/langchainjs/pull/10204) [`a1f22bb`](https://github.com/langchain-ai/langchainjs/commit/a1f22bba907731a18dca23c31cec5333444a3f55) Thanks [@colifran](https://github.com/colifran)! - feat(core): implement standard schema support for structured output
|
|
107
|
+
|
|
108
|
+
## 1.1.29
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- [#10106](https://github.com/langchain-ai/langchainjs/pull/10106) [`9f30267`](https://github.com/langchain-ai/langchainjs/commit/9f30267e95a2a42fac71f1d3674b84c5a190dbbc) Thanks [@hntrl](https://github.com/hntrl)! - Add package version metadata to runnable traces. Each package now stamps its version in `this.metadata.versions` at construction time, making version info available in LangSmith trace metadata.
|
|
113
|
+
|
|
114
|
+
- [#10154](https://github.com/langchain-ai/langchainjs/pull/10154) [`403a99f`](https://github.com/langchain-ai/langchainjs/commit/403a99fd826383f30300809ae077e1c967023520) Thanks [@kanweiwei](https://github.com/kanweiwei)! - fix(core): add usage_metadata to AIMessage lc_aliases
|
|
115
|
+
|
|
116
|
+
- [#10169](https://github.com/langchain-ai/langchainjs/pull/10169) [`3b1fd54`](https://github.com/langchain-ai/langchainjs/commit/3b1fd5458a4aa29c398122829f383f21b5ac39da) Thanks [@hntrl](https://github.com/hntrl)! - fix(core, langchain): bump uuid dependency from ^10.0.0 to ^11.0.0 to fix Metro bundler error
|
|
117
|
+
|
|
118
|
+
The `uuid` v10 package has ambiguous `exports` in its `package.json` which causes Metro (used by Expo/React Native) to resolve the wrong entry point, resulting in `Cannot read properties of undefined (reading 'v1')`. The `uuid` v11 package fixes its exports map to work correctly with Metro's package exports resolution.
|
|
119
|
+
|
|
120
|
+
- [#10044](https://github.com/langchain-ai/langchainjs/pull/10044) [`77bd982`](https://github.com/langchain-ai/langchainjs/commit/77bd98274a885e947d76f7a9c6dd0b3763453218) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): remove inherited LangChainTracer handlers when tracingEnabled is false
|
|
121
|
+
|
|
122
|
+
When a RunTree explicitly disables tracing via `tracingEnabled: false`, `CallbackManager._configureSync` now strips any inherited `LangChainTracer` handlers so child runs don't produce traces.
|
|
123
|
+
|
|
124
|
+
## 1.1.28
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- [#10140](https://github.com/langchain-ai/langchainjs/pull/10140) [`10a876c`](https://github.com/langchain-ai/langchainjs/commit/10a876c7d5ff27d8f2889761ee20e95f76a50518) Thanks [@hntrl](https://github.com/hntrl)! - Merge content blocks by string index during streaming.
|
|
129
|
+
|
|
130
|
+
- [#10102](https://github.com/langchain-ai/langchainjs/pull/10102) [`b46d96a`](https://github.com/langchain-ai/langchainjs/commit/b46d96a508a8bf212561dbb6f025e35c75f16257) Thanks [@colifran](https://github.com/colifran)! - feat: implement aynchronous generator tool calling for streaming partial tool results
|
|
131
|
+
|
|
132
|
+
## 1.1.27
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- [#10104](https://github.com/langchain-ai/langchainjs/pull/10104) [`fb2226e`](https://github.com/langchain-ai/langchainjs/commit/fb2226e6decdaba21e78b3f01877b45fa1eed6d3) Thanks [@hntrl](https://github.com/hntrl)! - Revert "chore(deps): bump ansi-styles from 5.2.0 to 6.2.3"
|
|
137
|
+
|
|
138
|
+
## 1.1.26
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- [#10085](https://github.com/langchain-ai/langchainjs/pull/10085) [`ed6ea53`](https://github.com/langchain-ai/langchainjs/commit/ed6ea53c38a004b65e30c0f5888a0ac7d8ee7028) Thanks [@colifran](https://github.com/colifran)! - fix(google): tool_calls are not preserved when concatenating AIMessageChunks
|
|
143
|
+
|
|
144
|
+
## 1.1.25
|
|
145
|
+
|
|
146
|
+
### Patch Changes
|
|
147
|
+
|
|
148
|
+
- [#10002](https://github.com/langchain-ai/langchainjs/pull/10002) [`27186c5`](https://github.com/langchain-ai/langchainjs/commit/27186c54884cfe7c2522fa50b42c3ca0ccaefdba) Thanks [@aditya-gg04](https://github.com/aditya-gg04)! - fix(core): support reasoning/thinking blocks in StringOutputParser
|
|
149
|
+
|
|
150
|
+
- [#10077](https://github.com/langchain-ai/langchainjs/pull/10077) [`05396f7`](https://github.com/langchain-ai/langchainjs/commit/05396f7ce0a91c49a3bae4bbcd3dbdd6cbd18089) Thanks [@christian-bromann](https://github.com/christian-bromann)! - feat(core): add ContextOverflowError, raise in anthropic and openai
|
|
151
|
+
|
|
152
|
+
- [#10081](https://github.com/langchain-ai/langchainjs/pull/10081) [`5a6f26b`](https://github.com/langchain-ai/langchainjs/commit/5a6f26bbaed80195dc538c538b96219a8b03f38f) Thanks [@hntrl](https://github.com/hntrl)! - feat(core): add namespace-based symbol branding for error class hierarchies
|
|
153
|
+
|
|
154
|
+
Introduces `createNamespace` utility for hierarchical symbol-based branding of class hierarchies.
|
|
155
|
+
All LangChain error classes now use this pattern, replacing hand-rolled duck-type `isInstance` checks
|
|
156
|
+
with reliable cross-realm `Symbol.for`-based identity.
|
|
157
|
+
- New `LangChainError` base class that all LangChain errors extend
|
|
158
|
+
- New `createNamespace` / `Namespace` API in `@langchain/core/utils/namespace`
|
|
159
|
+
- Refactored `ModelAbortError`, `ContextOverflowError` to use namespace branding
|
|
160
|
+
- Added `ContextOverflowError.fromError()` static factory method
|
|
161
|
+
- Deprecated `addLangChainErrorFields` in favor of `LangChainError` subclasses
|
|
162
|
+
- Migrated Google provider errors (`GoogleError`, `ConfigurationError`, etc.) to namespace branding
|
|
163
|
+
- Updated Anthropic and OpenAI providers to use `ContextOverflowError.fromError()`
|
|
164
|
+
|
|
165
|
+
## 1.1.24
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- [#9978](https://github.com/langchain-ai/langchainjs/pull/9978) [`70a4400`](https://github.com/langchain-ai/langchainjs/commit/70a440085b4bc2d036726ed12d9dc7841e914061) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): fix web_search_call and file_search_call contentBlocks for OpenAI Responses API
|
|
170
|
+
|
|
171
|
+
## 1.1.23
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- [#10000](https://github.com/langchain-ai/langchainjs/pull/10000) [`71d08c0`](https://github.com/langchain-ai/langchainjs/commit/71d08c0a3a2597bd5a084eb35a7830e5ea1a2b29) Thanks [@hntrl](https://github.com/hntrl)! - feat(google): add `@langchain/google` -- unified Google/Gemini integration
|
|
176
|
+
|
|
177
|
+
New package that replaces the fragmented `@langchain/google-genai` / `@langchain/google-common` / Vertex AI package stack with a single integration.
|
|
178
|
+
|
|
179
|
+
Published as 0.1.0 (early release). Existing Google packages will continue to receive maintenance updates.
|
|
180
|
+
|
|
181
|
+
## 1.1.22
|
|
182
|
+
|
|
183
|
+
### Patch Changes
|
|
184
|
+
|
|
185
|
+
- [#9995](https://github.com/langchain-ai/langchainjs/pull/9995) [`8f166b1`](https://github.com/langchain-ai/langchainjs/commit/8f166b159343ae6fd0d6d44c0835ab56c0b153f4) Thanks [@kaigritun](https://github.com/kaigritun)! - fix(core): skip empty text blocks in ChatOpenAI contentBlocks
|
|
186
|
+
|
|
187
|
+
## 1.1.21
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- [#9990](https://github.com/langchain-ai/langchainjs/pull/9990) [`d5e3db0`](https://github.com/langchain-ai/langchainjs/commit/d5e3db0d01ab321ec70a875805b2f74aefdadf9d) Thanks [@hntrl](https://github.com/hntrl)! - feat(core): Add SSRF protection module (`@langchain/core/utils/ssrf`) with utilities for validating URLs against private IPs, cloud metadata endpoints, and localhost.
|
|
192
|
+
|
|
193
|
+
fix(community): Harden `RecursiveUrlLoader` against SSRF attacks by integrating `validateSafeUrl` and replacing string-based URL comparison with origin-based `isSameOrigin` from the shared SSRF module.
|
|
194
|
+
|
|
195
|
+
## 1.1.20
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- [#9957](https://github.com/langchain-ai/langchainjs/pull/9957) [`71c3cba`](https://github.com/langchain-ai/langchainjs/commit/71c3cba843ab16d877299d158a1de0c7d22f3fb9) Thanks [@jacoblee93](https://github.com/jacoblee93)! - feat(langchain,core): Update prompt pulling params, LangSmith version
|
|
200
|
+
|
|
201
|
+
## 1.1.19
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- [#9905](https://github.com/langchain-ai/langchainjs/pull/9905) [`41bfea5`](https://github.com/langchain-ai/langchainjs/commit/41bfea51cf119573a3b956ee782d2731fe71c681) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(classic/community/core): avoid long lived abort signals
|
|
206
|
+
|
|
207
|
+
## 1.1.18
|
|
208
|
+
|
|
209
|
+
### Patch Changes
|
|
210
|
+
|
|
211
|
+
- [#9900](https://github.com/langchain-ai/langchainjs/pull/9900) [`a9b5059`](https://github.com/langchain-ai/langchainjs/commit/a9b50597186002221aaa4585246e569fa44c27c8) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): update method signatures to use `Partial<CallOptions>` for options parameters
|
|
212
|
+
|
|
213
|
+
Updated `invoke`, `stream`, `generate`, and `generatePrompt` method signatures across `Runnable`, `BaseChatModel`, and `BaseLLM` to correctly accept `Partial<CallOptions>` instead of full `CallOptions`. This aligns the implementation with the `RunnableInterface` specification and allows users to pass partial options (e.g., `{ signal: abortedSignal }`) without TypeScript errors.
|
|
214
|
+
|
|
215
|
+
- [#9900](https://github.com/langchain-ai/langchainjs/pull/9900) [`a9b5059`](https://github.com/langchain-ai/langchainjs/commit/a9b50597186002221aaa4585246e569fa44c27c8) Thanks [@hntrl](https://github.com/hntrl)! - Improved abort signal handling for chat models:
|
|
216
|
+
- Added `ModelAbortError` class in `@langchain/core/errors` that contains partial output when a model invocation is aborted mid-stream
|
|
217
|
+
- `invoke()` now throws `ModelAbortError` with accumulated `partialOutput` when aborted during streaming (when using streaming callback handlers)
|
|
218
|
+
- `stream()` throws a regular `AbortError` when aborted (since chunks are already yielded to the caller)
|
|
219
|
+
- All provider implementations now properly check and propagate abort signals in both `_generate()` and `_streamResponseChunks()` methods
|
|
220
|
+
- Added standard tests for abort signal behavior
|
|
221
|
+
|
|
222
|
+
## 1.1.17
|
|
223
|
+
|
|
224
|
+
### Patch Changes
|
|
225
|
+
|
|
226
|
+
- [#9842](https://github.com/langchain-ai/langchainjs/pull/9842) [`05a9733`](https://github.com/langchain-ai/langchainjs/commit/05a9733448a10764c0bfd070af859c33e623b998) Thanks [@encodedz](https://github.com/encodedz)! - Adding `on_tool_error` event into EventStreamCallbackHandler
|
|
227
|
+
|
|
228
|
+
## 1.1.16
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- [#9830](https://github.com/langchain-ai/langchainjs/pull/9830) [`70387a1`](https://github.com/langchain-ai/langchainjs/commit/70387a144464539d65a546c8130cf51dfad025a1) Thanks [@bracesproul](https://github.com/bracesproul)! - fix: More undefined null errors and tests
|
|
233
|
+
|
|
234
|
+
- [#9679](https://github.com/langchain-ai/langchainjs/pull/9679) [`a7c6ec5`](https://github.com/langchain-ai/langchainjs/commit/a7c6ec51ab9baa186ab5ebf815599c08f5c7e8ab) Thanks [@christian-bromann](https://github.com/christian-bromann)! - feat(openai): elevate OpenAI image generation outputs to proper image content blocks
|
|
235
|
+
|
|
236
|
+
- [#9817](https://github.com/langchain-ai/langchainjs/pull/9817) [`5e04543`](https://github.com/langchain-ai/langchainjs/commit/5e045435a783fdae44bc9a43e01a8e5eb7100db2) Thanks [@Ashx098](https://github.com/Ashx098)! - read error.status when response.status is absent to avoid retrying OpenAI SDK 4xx
|
|
237
|
+
|
|
238
|
+
- [#9819](https://github.com/langchain-ai/langchainjs/pull/9819) [`40b4467`](https://github.com/langchain-ai/langchainjs/commit/40b446762445575844610ee528abc77c247b2c43) Thanks [@MrDockal](https://github.com/MrDockal)! - Tool call content returns compacted json
|
|
239
|
+
|
|
240
|
+
- [#9815](https://github.com/langchain-ai/langchainjs/pull/9815) [`17e30bd`](https://github.com/langchain-ai/langchainjs/commit/17e30bd7f4c7bdf87c9c30304b3b9e121cc1fbbc) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): respect tracingEnabled=false from RunTree when env tracing is enabled
|
|
241
|
+
|
|
242
|
+
## 1.1.15
|
|
243
|
+
|
|
244
|
+
### Patch Changes
|
|
245
|
+
|
|
246
|
+
- [#9781](https://github.com/langchain-ai/langchainjs/pull/9781) [`230462d`](https://github.com/langchain-ai/langchainjs/commit/230462d28c3a8b5ccadf433ea2f523eb6e658de6) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): preserve index and timestamp fields in \_mergeDicts
|
|
247
|
+
|
|
248
|
+
## 1.1.14
|
|
249
|
+
|
|
250
|
+
### Patch Changes
|
|
251
|
+
|
|
252
|
+
- [#9797](https://github.com/langchain-ai/langchainjs/pull/9797) [`bd1ab45`](https://github.com/langchain-ai/langchainjs/commit/bd1ab45364391f69ce93ecba36a4a15dafca2b76) Thanks [@christian-bromann](https://github.com/christian-bromann)! - handle undefined error objects in async-caller
|
|
253
|
+
|
|
254
|
+
## 1.1.13
|
|
255
|
+
|
|
256
|
+
### Patch Changes
|
|
257
|
+
|
|
258
|
+
- [#9777](https://github.com/langchain-ai/langchainjs/pull/9777) [`3efe79c`](https://github.com/langchain-ai/langchainjs/commit/3efe79c62ff2ffe0ada562f7eecd85be074b649a) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): properly elevate reasoning tokens
|
|
259
|
+
|
|
260
|
+
- [#9789](https://github.com/langchain-ai/langchainjs/pull/9789) [`b8561c1`](https://github.com/langchain-ai/langchainjs/commit/b8561c17556bdf7a3ff8d70bc307422642a9172e) Thanks [@hntrl](https://github.com/hntrl)! - source JsonOutputParser content from text accessor
|
|
261
|
+
|
|
262
|
+
## 1.1.12
|
|
263
|
+
|
|
264
|
+
### Patch Changes
|
|
265
|
+
|
|
266
|
+
- [#9517](https://github.com/langchain-ai/langchainjs/pull/9517) [`23be5af`](https://github.com/langchain-ai/langchainjs/commit/23be5afd59b5f4806edef11937ce5e2ba300f7ee) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(@langchain/core): add literal name type inference to tool()
|
|
267
|
+
|
|
268
|
+
## 1.1.11
|
|
269
|
+
|
|
270
|
+
### Patch Changes
|
|
271
|
+
|
|
272
|
+
- [#9753](https://github.com/langchain-ai/langchainjs/pull/9753) [`a46a249`](https://github.com/langchain-ai/langchainjs/commit/a46a24983fd0fea649d950725a2673b3c435275f) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): allow shared object references in serialization
|
|
273
|
+
|
|
274
|
+
## 1.1.10
|
|
275
|
+
|
|
276
|
+
### Patch Changes
|
|
277
|
+
|
|
278
|
+
- [#9746](https://github.com/langchain-ai/langchainjs/pull/9746) [`817fc9a`](https://github.com/langchain-ai/langchainjs/commit/817fc9a56d4699f3563a6e153b13eadf7bcc661b) Thanks [@bracesproul](https://github.com/bracesproul)! - fix: `_mergeDicts` error when merging undefined values
|
|
279
|
+
|
|
280
|
+
## 1.1.9
|
|
281
|
+
|
|
282
|
+
### Patch Changes
|
|
283
|
+
|
|
284
|
+
- [#9725](https://github.com/langchain-ai/langchainjs/pull/9725) [`56600b9`](https://github.com/langchain-ai/langchainjs/commit/56600b94f8e185f44d4288b7a9b66c55778938dd) Thanks [@Orenoid](https://github.com/Orenoid)! - fix(langchain): update merge logic for numeric values in `mergeDicts`
|
|
285
|
+
|
|
286
|
+
- [#9736](https://github.com/langchain-ai/langchainjs/pull/9736) [`dc5c2ac`](https://github.com/langchain-ai/langchainjs/commit/dc5c2ac00f86dd2feeba9843d708926a5f38202e) Thanks [@hntrl](https://github.com/hntrl)! - fix(core): handle circular references in `load`
|
|
287
|
+
|
|
288
|
+
- [#9739](https://github.com/langchain-ai/langchainjs/pull/9739) [`c28d24a`](https://github.com/langchain-ai/langchainjs/commit/c28d24a8770f6d0e543cde116b0e38b3baf21301) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): use getBufferString for message summarization
|
|
289
|
+
|
|
290
|
+
- [#9702](https://github.com/langchain-ai/langchainjs/pull/9702) [`bfcb87d`](https://github.com/langchain-ai/langchainjs/commit/bfcb87d23c580c7881f650960a448fe2e54a30b3) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): improve interop with Zod
|
|
291
|
+
|
|
292
|
+
## 1.1.8
|
|
293
|
+
|
|
294
|
+
### Patch Changes
|
|
295
|
+
|
|
296
|
+
- [#9707](https://github.com/langchain-ai/langchainjs/pull/9707) [`e5063f9`](https://github.com/langchain-ai/langchainjs/commit/e5063f9c6e9989ea067dfdff39262b9e7b6aba62) Thanks [@hntrl](https://github.com/hntrl)! - add security hardening for `load`
|
|
297
|
+
|
|
298
|
+
- [#9684](https://github.com/langchain-ai/langchainjs/pull/9684) [`8996647`](https://github.com/langchain-ai/langchainjs/commit/89966470e8c0b112ce4f9a326004af6a4173f9e6) Thanks [@christian-bromann](https://github.com/christian-bromann)! - fix(core): document purpose of name in base message
|
|
299
|
+
|
|
300
|
+
## 1.1.7
|
|
301
|
+
|
|
302
|
+
### Patch Changes
|
|
303
|
+
|
|
304
|
+
- [#9686](https://github.com/langchain-ai/langchainjs/pull/9686) [`df9c42b`](https://github.com/langchain-ai/langchainjs/commit/df9c42b3ab61b85309ab47256e1d93c3188435ee) Thanks [@hntrl](https://github.com/hntrl)! - add usage_metadata to metadata in LangChainTracer
|
|
305
|
+
|
|
306
|
+
- [#9665](https://github.com/langchain-ai/langchainjs/pull/9665) [`8d2982b`](https://github.com/langchain-ai/langchainjs/commit/8d2982bb94c0f4e4314ace3cc98a1ae87571b1ed) Thanks [@jacoblee93](https://github.com/jacoblee93)! - feat(core): Make runnable transform trace in a single payload in LangChainTracer
|
|
307
|
+
|
|
308
|
+
- [#9675](https://github.com/langchain-ai/langchainjs/pull/9675) [`af664be`](https://github.com/langchain-ai/langchainjs/commit/af664becc0245b2315ea2f784c9a6c1d7622dbb4) Thanks [@jacoblee93](https://github.com/jacoblee93)! - Bump LangSmith dep to 0.4.0
|
|
309
|
+
|
|
310
|
+
- [#9673](https://github.com/langchain-ai/langchainjs/pull/9673) [`ffb2402`](https://github.com/langchain-ai/langchainjs/commit/ffb24026cd93e58219519ee24c6e23ea57cb5bde) Thanks [@hntrl](https://github.com/hntrl)! - add `context` utility
|
|
311
|
+
|
|
3
312
|
## 1.1.6
|
|
4
313
|
|
|
5
314
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🦜🍎️ @langchain/core
|
|
2
2
|
|
|
3
|
-
 [](https://opensource.org/licenses/MIT) [ [](https://opensource.org/licenses/MIT) [](https://x.com/langchain)
|
|
4
4
|
|
|
5
5
|
`@langchain/core` contains the core abstractions and schemas of LangChain.js, including base classes for language models,
|
|
6
6
|
chat models, vectorstores, retrievers, and runnables.
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
9
10
|
for (var name in all) __defProp(target, name, {
|
|
10
11
|
get: all[name],
|
|
11
12
|
enumerable: true
|
|
12
13
|
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
13
16
|
};
|
|
14
17
|
var __copyProps = (to, from, except, desc) => {
|
|
15
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -25,8 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
28
|
value: mod,
|
|
26
29
|
enumerable: true
|
|
27
30
|
}) : target, mod));
|
|
28
|
-
|
|
29
31
|
//#endregion
|
|
30
|
-
|
|
31
|
-
exports.
|
|
32
|
-
exports.__toESM = __toESM;
|
|
32
|
+
exports.__exportAll = __exportAll;
|
|
33
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
package/dist/agents.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/agents.ts
|
|
3
|
-
var agents_exports = {};
|
|
4
|
-
|
|
3
|
+
var agents_exports = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.cjs").__exportAll({});
|
|
5
4
|
//#endregion
|
|
6
|
-
Object.defineProperty(exports,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
Object.defineProperty(exports, "agents_exports", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return agents_exports;
|
|
9
|
+
}
|
|
11
10
|
});
|
|
11
|
+
|
|
12
12
|
//# sourceMappingURL=agents.cjs.map
|
package/dist/agents.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.cjs","names":[],"sources":["../src/agents.ts"],"sourcesContent":["export type AgentAction = {\n tool: string;\n //
|
|
1
|
+
{"version":3,"file":"agents.cjs","names":[],"sources":["../src/agents.ts"],"sourcesContent":["export type AgentAction = {\n tool: string;\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n toolInput: string | Record<string, any>;\n log: string;\n};\n\nexport type AgentFinish = {\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n returnValues: Record<string, any>;\n log: string;\n};\n\nexport type AgentStep = {\n action: AgentAction;\n observation: string;\n};\n"],"mappings":""}
|
package/dist/agents.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"agents.d.cts","names":[],"sources":["../src/agents.ts"],"mappings":";KAAY,WAAA;EACV,IAAA;EAEA,SAAA,WAAoB,MAAA;EACpB,GAAA;AAAA;AAAA,KAGU,WAAA;EAEV,YAAA,EAAc,MAAA;EACd,GAAA;AAAA;AAAA,KAGU,SAAA;EACV,MAAA,EAAQ,WAAA;EACR,WAAA;AAAA"}
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"agents.d.ts","names":[],"sources":["../src/agents.ts"],"mappings":";KAAY,WAAA;EACV,IAAA;EAEA,SAAA,WAAoB,MAAA;EACpB,GAAA;AAAA;AAAA,KAGU,WAAA;EAEV,YAAA,EAAc,MAAA;EACd,GAAA;AAAA;AAAA,KAGU,SAAA;EACV,MAAA,EAAQ,WAAA;EACR,WAAA;AAAA"}
|
package/dist/agents.js
CHANGED
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","names":[],"sources":["../src/agents.ts"],"sourcesContent":["export type AgentAction = {\n tool: string;\n //
|
|
1
|
+
{"version":3,"file":"agents.js","names":[],"sources":["../src/agents.ts"],"sourcesContent":["export type AgentAction = {\n tool: string;\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n toolInput: string | Record<string, any>;\n log: string;\n};\n\nexport type AgentFinish = {\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n returnValues: Record<string, any>;\n log: string;\n};\n\nexport type AgentStep = {\n action: AgentAction;\n observation: string;\n};\n"],"mappings":""}
|
package/dist/caches/index.cjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const require_hash = require(
|
|
4
|
-
require(
|
|
5
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_hash = require("../utils/js-sha256/hash.cjs");
|
|
4
|
+
require("../utils/hash.cjs");
|
|
5
|
+
const require_utils = require("../messages/utils.cjs");
|
|
6
6
|
//#region src/caches/index.ts
|
|
7
|
-
var caches_exports = {
|
|
8
|
-
require_rolldown_runtime.__export(caches_exports, {
|
|
7
|
+
var caches_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
9
8
|
BaseCache: () => BaseCache,
|
|
10
9
|
InMemoryCache: () => InMemoryCache,
|
|
11
10
|
defaultHashKeyEncoder: () => defaultHashKeyEncoder,
|
|
@@ -78,17 +77,17 @@ var InMemoryCache = class InMemoryCache extends BaseCache {
|
|
|
78
77
|
return new InMemoryCache(GLOBAL_MAP);
|
|
79
78
|
}
|
|
80
79
|
};
|
|
81
|
-
|
|
82
80
|
//#endregion
|
|
83
81
|
exports.BaseCache = BaseCache;
|
|
84
82
|
exports.InMemoryCache = InMemoryCache;
|
|
85
|
-
Object.defineProperty(exports,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
Object.defineProperty(exports, "caches_exports", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return caches_exports;
|
|
87
|
+
}
|
|
90
88
|
});
|
|
91
89
|
exports.defaultHashKeyEncoder = defaultHashKeyEncoder;
|
|
92
90
|
exports.deserializeStoredGeneration = deserializeStoredGeneration;
|
|
93
91
|
exports.serializeGeneration = serializeGeneration;
|
|
92
|
+
|
|
94
93
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["sha256","mapStoredMessageToChatMessage"],"sources":["../../src/caches/index.ts"],"sourcesContent":["import { sha256, type HashKeyEncoder } from \"../utils/hash.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\nimport { mapStoredMessageToChatMessage } from \"../messages/utils.js\";\nimport { type StoredGeneration } from \"../messages/base.js\";\n\nexport const defaultHashKeyEncoder: HashKeyEncoder = (...strings) =>\n sha256(strings.join(\"_\"));\n\nexport function deserializeStoredGeneration(\n storedGeneration: StoredGeneration\n) {\n if (storedGeneration.message !== undefined) {\n return {\n text: storedGeneration.text,\n message: mapStoredMessageToChatMessage(storedGeneration.message),\n };\n } else {\n return { text: storedGeneration.text };\n }\n}\n\nexport function serializeGeneration(generation: Generation) {\n const serializedValue: StoredGeneration = {\n text: generation.text,\n };\n if ((generation as ChatGeneration).message !== undefined) {\n serializedValue.message = (generation as ChatGeneration).message.toDict();\n }\n return serializedValue;\n}\n\n/**\n * Base class for all caches. All caches should extend this class.\n */\nexport abstract class BaseCache<T = Generation[]> {\n protected keyEncoder: HashKeyEncoder = defaultHashKeyEncoder;\n\n /**\n * Sets a custom key encoder function for the cache.\n * This function should take a prompt and an LLM key and return a string\n * that will be used as the cache key.\n * @param keyEncoderFn The custom key encoder function.\n */\n makeDefaultKeyEncoder(keyEncoderFn: HashKeyEncoder): void {\n this.keyEncoder = keyEncoderFn;\n }\n\n abstract lookup(prompt: string, llmKey: string): Promise<T | null>;\n\n abstract update(prompt: string, llmKey: string, value: T): Promise<void>;\n}\n\nconst GLOBAL_MAP = new Map();\n\n/**\n * A cache for storing LLM generations that stores data in memory.\n */\nexport class InMemoryCache<T = Generation[]> extends BaseCache<T> {\n private cache: Map<string, T>;\n\n constructor(map?: Map<string, T>) {\n super();\n this.cache = map ?? new Map();\n }\n\n /**\n * Retrieves data from the cache using a prompt and an LLM key. If the\n * data is not found, it returns null.\n * @param prompt The prompt used to find the data.\n * @param llmKey The LLM key used to find the data.\n * @returns The data corresponding to the prompt and LLM key, or null if not found.\n */\n lookup(prompt: string, llmKey: string): Promise<T | null> {\n return Promise.resolve(\n this.cache.get(this.keyEncoder(prompt, llmKey)) ?? null\n );\n }\n\n /**\n * Updates the cache with new data using a prompt and an LLM key.\n * @param prompt The prompt used to store the data.\n * @param llmKey The LLM key used to store the data.\n * @param value The data to be stored.\n */\n async update(prompt: string, llmKey: string, value: T): Promise<void> {\n this.cache.set(this.keyEncoder(prompt, llmKey), value);\n }\n\n /**\n * Returns a global instance of InMemoryCache using a predefined global\n * map as the initial cache.\n * @returns A global instance of InMemoryCache.\n */\n static global(): InMemoryCache {\n return new InMemoryCache(GLOBAL_MAP);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAKA,MAAa,yBAAyC,GAAG,YACvDA,aAAAA,OAAO,QAAQ,KAAK,IAAI,CAAC;AAE3B,SAAgB,4BACd,kBACA;AACA,KAAI,iBAAiB,YAAY,KAAA,EAC/B,QAAO;EACL,MAAM,iBAAiB;EACvB,SAASC,cAAAA,8BAA8B,iBAAiB,QAAQ;EACjE;KAED,QAAO,EAAE,MAAM,iBAAiB,MAAM;;AAI1C,SAAgB,oBAAoB,YAAwB;CAC1D,MAAM,kBAAoC,EACxC,MAAM,WAAW,MAClB;AACD,KAAK,WAA8B,YAAY,KAAA,EAC7C,iBAAgB,UAAW,WAA8B,QAAQ,QAAQ;AAE3E,QAAO;;;;;AAMT,IAAsB,YAAtB,MAAkD;CAChD,aAAuC;;;;;;;CAQvC,sBAAsB,cAAoC;AACxD,OAAK,aAAa;;;AAQtB,MAAM,6BAAa,IAAI,KAAK;;;;AAK5B,IAAa,gBAAb,MAAa,sBAAwC,UAAa;CAChE;CAEA,YAAY,KAAsB;AAChC,SAAO;AACP,OAAK,QAAQ,uBAAO,IAAI,KAAK;;;;;;;;;CAU/B,OAAO,QAAgB,QAAmC;AACxD,SAAO,QAAQ,QACb,KAAK,MAAM,IAAI,KAAK,WAAW,QAAQ,OAAO,CAAC,IAAI,KACpD;;;;;;;;CASH,MAAM,OAAO,QAAgB,QAAgB,OAAyB;AACpE,OAAK,MAAM,IAAI,KAAK,WAAW,QAAQ,OAAO,EAAE,MAAM;;;;;;;CAQxD,OAAO,SAAwB;AAC7B,SAAO,IAAI,cAAc,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/caches/index.ts"],"mappings":";;;;;;;;;;;;cAKa,qBAAA,EAAuB,cAAA;AAAA,iBAGpB,2BAAA,CACd,gBAAA,EAAkB,gBAAA;;sCAAgB,cAAA;;;;;iBAYpB,mBAAA,CAAoB,UAAA,EAAY,UAAA,GAAU,gBAAA;AAhB1D;;;AAAA,uBA6BsB,SAAA,KAAc,UAAA;EAAA,UACxB,UAAA,EAAY,cAAA;EA3BR;;;;;;EAmCd,qBAAA,CAAsB,YAAA,EAAc,cAAA;EAAA,SAI3B,MAAA,CAAO,MAAA,UAAgB,MAAA,WAAiB,OAAA,CAAQ,CAAA;EAAA,SAEhD,MAAA,CAAO,MAAA,UAAgB,MAAA,UAAgB,KAAA,EAAO,CAAA,GAAI,OAAA;AAAA;;;;cAQhD,aAAA,KAAkB,UAAA,YAAsB,SAAA,CAAU,CAAA;EAAA,QACrD,KAAA;EAER,WAAA,CAAY,GAAA,GAAM,GAAA,SAAY,CAAA;;;;;;;;EAY9B,MAAA,CAAO,MAAA,UAAgB,MAAA,WAAiB,OAAA,CAAQ,CAAA;EA/D9B;;;;;;EA2EZ,MAAA,CAAO,MAAA,UAAgB,MAAA,UAAgB,KAAA,EAAO,CAAA,GAAI,OAAA;;;;;;SASjD,MAAA,CAAA,GAAU,aAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/caches/index.ts"],"mappings":";;;;;;;;;;;;cAKa,qBAAA,EAAuB,cAAA;AAAA,iBAGpB,2BAAA,CACd,gBAAA,EAAkB,gBAAA;;sCAAgB,cAAA;;;;;iBAYpB,mBAAA,CAAoB,UAAA,EAAY,UAAA,GAAU,gBAAA;AAhB1D;;;AAAA,uBA6BsB,SAAA,KAAc,UAAA;EAAA,UACxB,UAAA,EAAY,cAAA;EA3BR;;;;;;EAmCd,qBAAA,CAAsB,YAAA,EAAc,cAAA;EAAA,SAI3B,MAAA,CAAO,MAAA,UAAgB,MAAA,WAAiB,OAAA,CAAQ,CAAA;EAAA,SAEhD,MAAA,CAAO,MAAA,UAAgB,MAAA,UAAgB,KAAA,EAAO,CAAA,GAAI,OAAA;AAAA;;;;cAQhD,aAAA,KAAkB,UAAA,YAAsB,SAAA,CAAU,CAAA;EAAA,QACrD,KAAA;EAER,WAAA,CAAY,GAAA,GAAM,GAAA,SAAY,CAAA;;;;;;;;EAY9B,MAAA,CAAO,MAAA,UAAgB,MAAA,WAAiB,OAAA,CAAQ,CAAA;EA/D9B;;;;;;EA2EZ,MAAA,CAAO,MAAA,UAAgB,MAAA,UAAgB,KAAA,EAAO,CAAA,GAAI,OAAA;;;;;;SASjD,MAAA,CAAA,GAAU,aAAA;AAAA"}
|
package/dist/caches/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { mapStoredMessageToChatMessage } from "../messages/utils.js";
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
2
|
import { sha256 } from "../utils/js-sha256/hash.js";
|
|
4
3
|
import "../utils/hash.js";
|
|
5
|
-
|
|
4
|
+
import { mapStoredMessageToChatMessage } from "../messages/utils.js";
|
|
6
5
|
//#region src/caches/index.ts
|
|
7
|
-
var caches_exports = {
|
|
8
|
-
__export(caches_exports, {
|
|
6
|
+
var caches_exports = /* @__PURE__ */ __exportAll({
|
|
9
7
|
BaseCache: () => BaseCache,
|
|
10
8
|
InMemoryCache: () => InMemoryCache,
|
|
11
9
|
defaultHashKeyEncoder: () => defaultHashKeyEncoder,
|
|
@@ -78,7 +76,7 @@ var InMemoryCache = class InMemoryCache extends BaseCache {
|
|
|
78
76
|
return new InMemoryCache(GLOBAL_MAP);
|
|
79
77
|
}
|
|
80
78
|
};
|
|
81
|
-
|
|
82
79
|
//#endregion
|
|
83
80
|
export { BaseCache, InMemoryCache, caches_exports, defaultHashKeyEncoder, deserializeStoredGeneration, serializeGeneration };
|
|
81
|
+
|
|
84
82
|
//# sourceMappingURL=index.js.map
|
package/dist/caches/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/caches/index.ts"],"sourcesContent":["import { sha256, type HashKeyEncoder } from \"../utils/hash.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\nimport { mapStoredMessageToChatMessage } from \"../messages/utils.js\";\nimport { type StoredGeneration } from \"../messages/base.js\";\n\nexport const defaultHashKeyEncoder: HashKeyEncoder = (...strings) =>\n sha256(strings.join(\"_\"));\n\nexport function deserializeStoredGeneration(\n storedGeneration: StoredGeneration\n) {\n if (storedGeneration.message !== undefined) {\n return {\n text: storedGeneration.text,\n message: mapStoredMessageToChatMessage(storedGeneration.message),\n };\n } else {\n return { text: storedGeneration.text };\n }\n}\n\nexport function serializeGeneration(generation: Generation) {\n const serializedValue: StoredGeneration = {\n text: generation.text,\n };\n if ((generation as ChatGeneration).message !== undefined) {\n serializedValue.message = (generation as ChatGeneration).message.toDict();\n }\n return serializedValue;\n}\n\n/**\n * Base class for all caches. All caches should extend this class.\n */\nexport abstract class BaseCache<T = Generation[]> {\n protected keyEncoder: HashKeyEncoder = defaultHashKeyEncoder;\n\n /**\n * Sets a custom key encoder function for the cache.\n * This function should take a prompt and an LLM key and return a string\n * that will be used as the cache key.\n * @param keyEncoderFn The custom key encoder function.\n */\n makeDefaultKeyEncoder(keyEncoderFn: HashKeyEncoder): void {\n this.keyEncoder = keyEncoderFn;\n }\n\n abstract lookup(prompt: string, llmKey: string): Promise<T | null>;\n\n abstract update(prompt: string, llmKey: string, value: T): Promise<void>;\n}\n\nconst GLOBAL_MAP = new Map();\n\n/**\n * A cache for storing LLM generations that stores data in memory.\n */\nexport class InMemoryCache<T = Generation[]> extends BaseCache<T> {\n private cache: Map<string, T>;\n\n constructor(map?: Map<string, T>) {\n super();\n this.cache = map ?? new Map();\n }\n\n /**\n * Retrieves data from the cache using a prompt and an LLM key. If the\n * data is not found, it returns null.\n * @param prompt The prompt used to find the data.\n * @param llmKey The LLM key used to find the data.\n * @returns The data corresponding to the prompt and LLM key, or null if not found.\n */\n lookup(prompt: string, llmKey: string): Promise<T | null> {\n return Promise.resolve(\n this.cache.get(this.keyEncoder(prompt, llmKey)) ?? null\n );\n }\n\n /**\n * Updates the cache with new data using a prompt and an LLM key.\n * @param prompt The prompt used to store the data.\n * @param llmKey The LLM key used to store the data.\n * @param value The data to be stored.\n */\n async update(prompt: string, llmKey: string, value: T): Promise<void> {\n this.cache.set(this.keyEncoder(prompt, llmKey), value);\n }\n\n /**\n * Returns a global instance of InMemoryCache using a predefined global\n * map as the initial cache.\n * @returns A global instance of InMemoryCache.\n */\n static global(): InMemoryCache {\n return new InMemoryCache(GLOBAL_MAP);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAKA,MAAa,yBAAyC,GAAG,YACvD,OAAO,QAAQ,KAAK,IAAI,CAAC;AAE3B,SAAgB,4BACd,kBACA;AACA,KAAI,iBAAiB,YAAY,KAAA,EAC/B,QAAO;EACL,MAAM,iBAAiB;EACvB,SAAS,8BAA8B,iBAAiB,QAAQ;EACjE;KAED,QAAO,EAAE,MAAM,iBAAiB,MAAM;;AAI1C,SAAgB,oBAAoB,YAAwB;CAC1D,MAAM,kBAAoC,EACxC,MAAM,WAAW,MAClB;AACD,KAAK,WAA8B,YAAY,KAAA,EAC7C,iBAAgB,UAAW,WAA8B,QAAQ,QAAQ;AAE3E,QAAO;;;;;AAMT,IAAsB,YAAtB,MAAkD;CAChD,aAAuC;;;;;;;CAQvC,sBAAsB,cAAoC;AACxD,OAAK,aAAa;;;AAQtB,MAAM,6BAAa,IAAI,KAAK;;;;AAK5B,IAAa,gBAAb,MAAa,sBAAwC,UAAa;CAChE;CAEA,YAAY,KAAsB;AAChC,SAAO;AACP,OAAK,QAAQ,uBAAO,IAAI,KAAK;;;;;;;;;CAU/B,OAAO,QAAgB,QAAmC;AACxD,SAAO,QAAQ,QACb,KAAK,MAAM,IAAI,KAAK,WAAW,QAAQ,OAAO,CAAC,IAAI,KACpD;;;;;;;;CASH,MAAM,OAAO,QAAgB,QAAgB,OAAyB;AACpE,OAAK,MAAM,IAAI,KAAK,WAAW,QAAQ,OAAO,EAAE,MAAM;;;;;;;CAQxD,OAAO,SAAwB;AAC7B,SAAO,IAAI,cAAc,WAAW"}
|