@langchain/core 1.2.0-dev-1765937705265 → 1.2.0
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 +429 -0
- package/README.md +1 -1
- package/agents.cjs +1 -0
- package/agents.d.cts +1 -0
- package/agents.d.ts +1 -0
- package/agents.js +1 -0
- package/caches.cjs +1 -0
- package/caches.d.cts +1 -0
- package/caches.d.ts +1 -0
- package/caches.js +1 -0
- package/callbacks/base.cjs +1 -0
- package/callbacks/base.d.cts +1 -0
- package/callbacks/base.d.ts +1 -0
- package/callbacks/base.js +1 -0
- package/callbacks/dispatch/web.cjs +1 -0
- package/callbacks/dispatch/web.d.cts +1 -0
- package/callbacks/dispatch/web.d.ts +1 -0
- package/callbacks/dispatch/web.js +1 -0
- package/callbacks/dispatch.cjs +1 -0
- package/callbacks/dispatch.d.cts +1 -0
- package/callbacks/dispatch.d.ts +1 -0
- package/callbacks/dispatch.js +1 -0
- package/callbacks/manager.cjs +1 -0
- package/callbacks/manager.d.cts +1 -0
- package/callbacks/manager.d.ts +1 -0
- package/callbacks/manager.js +1 -0
- package/callbacks/promises.cjs +1 -0
- package/callbacks/promises.d.cts +1 -0
- package/callbacks/promises.d.ts +1 -0
- package/callbacks/promises.js +1 -0
- package/chat_history.cjs +1 -0
- package/chat_history.d.cts +1 -0
- package/chat_history.d.ts +1 -0
- package/chat_history.js +1 -0
- package/context.cjs +1 -0
- package/context.d.cts +1 -0
- package/context.d.ts +1 -0
- package/context.js +1 -0
- 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 +22 -26
- package/dist/callbacks/base.cjs.map +1 -1
- package/dist/callbacks/base.d.cts +100 -39
- package/dist/callbacks/base.d.cts.map +1 -1
- package/dist/callbacks/base.d.ts +100 -39
- package/dist/callbacks/base.d.ts.map +1 -1
- package/dist/callbacks/base.js +14 -20
- 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 +94 -80
- package/dist/callbacks/manager.cjs.map +1 -1
- package/dist/callbacks/manager.d.cts +7 -2
- package/dist/callbacks/manager.d.cts.map +1 -1
- package/dist/callbacks/manager.d.ts +7 -2
- package/dist/callbacks/manager.d.ts.map +1 -1
- package/dist/callbacks/manager.js +74 -61
- 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 +11 -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 +7 -12
- 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 +40 -26
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +22 -14
- package/dist/language_models/base.d.cts.map +1 -1
- package/dist/language_models/base.d.ts +22 -16
- package/dist/language_models/base.d.ts.map +1 -1
- package/dist/language_models/base.js +29 -16
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs +173 -75
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.cts +147 -10
- package/dist/language_models/chat_models.d.cts.map +1 -1
- package/dist/language_models/chat_models.d.ts +147 -13
- package/dist/language_models/chat_models.d.ts.map +1 -1
- package/dist/language_models/chat_models.js +155 -58
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/compat.cjs +412 -0
- package/dist/language_models/compat.cjs.map +1 -0
- package/dist/language_models/compat.d.cts +20 -0
- package/dist/language_models/compat.d.cts.map +1 -0
- package/dist/language_models/compat.d.ts +20 -0
- package/dist/language_models/compat.d.ts.map +1 -0
- package/dist/language_models/compat.js +404 -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 +185 -0
- package/dist/language_models/event.d.cts.map +1 -0
- package/dist/language_models/event.d.ts +185 -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 +41 -33
- 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 +30 -23
- package/dist/language_models/llms.js.map +1 -1
- package/dist/language_models/openai_completions_stream.cjs +308 -0
- package/dist/language_models/openai_completions_stream.cjs.map +1 -0
- package/dist/language_models/openai_completions_stream.d.cts +75 -0
- package/dist/language_models/openai_completions_stream.d.cts.map +1 -0
- package/dist/language_models/openai_completions_stream.d.ts +75 -0
- package/dist/language_models/openai_completions_stream.d.ts.map +1 -0
- package/dist/language_models/openai_completions_stream.js +301 -0
- package/dist/language_models/openai_completions_stream.js.map +1 -0
- 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 +506 -0
- package/dist/language_models/stream.cjs.map +1 -0
- package/dist/language_models/stream.d.cts +106 -0
- package/dist/language_models/stream.d.cts.map +1 -0
- package/dist/language_models/stream.d.ts +106 -0
- package/dist/language_models/stream.d.ts.map +1 -0
- package/dist/language_models/stream.js +495 -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 +86 -66
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +49 -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 +179 -41
- package/dist/load/index.cjs.map +1 -1
- package/dist/load/index.d.cts +126 -3
- package/dist/load/index.d.cts.map +1 -1
- package/dist/load/index.d.ts +126 -3
- package/dist/load/index.d.ts.map +1 -1
- package/dist/load/index.js +168 -31
- package/dist/load/index.js.map +1 -1
- package/dist/load/map_keys.cjs +14 -7
- 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 +12 -4
- 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 +27 -18
- 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 +22 -13
- package/dist/messages/ai.js.map +1 -1
- package/dist/messages/base.cjs +121 -44
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.d.cts +58 -12
- package/dist/messages/base.d.cts.map +1 -1
- package/dist/messages/base.d.ts +58 -12
- package/dist/messages/base.d.ts.map +1 -1
- package/dist/messages/base.js +114 -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 +19 -8
- package/dist/messages/block_translators/index.cjs.map +1 -1
- package/dist/messages/block_translators/index.js +14 -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/openrouter.cjs +101 -0
- package/dist/messages/block_translators/openrouter.cjs.map +1 -0
- package/dist/messages/block_translators/openrouter.js +101 -0
- package/dist/messages/block_translators/openrouter.js.map +1 -0
- 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 +4 -4
- package/dist/messages/index.d.ts +4 -4
- 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 +8 -3
- package/dist/messages/modifier.cjs.map +1 -1
- package/dist/messages/modifier.d.cts +9 -4
- package/dist/messages/modifier.d.cts.map +1 -1
- package/dist/messages/modifier.d.ts +9 -4
- package/dist/messages/modifier.d.ts.map +1 -1
- package/dist/messages/modifier.js +7 -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 +85 -32
- package/dist/messages/utils.cjs.map +1 -1
- package/dist/messages/utils.d.cts +25 -8
- package/dist/messages/utils.d.cts.map +1 -1
- package/dist/messages/utils.d.ts +25 -8
- package/dist/messages/utils.d.ts.map +1 -1
- package/dist/messages/utils.js +77 -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 +42 -0
- package/dist/output_parsers/standard_schema.cjs.map +1 -0
- package/dist/output_parsers/standard_schema.d.cts +18 -0
- package/dist/output_parsers/standard_schema.d.cts.map +1 -0
- package/dist/output_parsers/standard_schema.d.ts +18 -0
- package/dist/output_parsers/standard_schema.d.ts.map +1 -0
- package/dist/output_parsers/standard_schema.js +42 -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 +17 -18
- package/dist/output_parsers/structured.cjs.map +1 -1
- package/dist/output_parsers/structured.d.cts +2 -0
- package/dist/output_parsers/structured.d.cts.map +1 -1
- package/dist/output_parsers/structured.d.ts +2 -0
- package/dist/output_parsers/structured.d.ts.map +1 -1
- package/dist/output_parsers/structured.js +12 -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 +13 -17
- package/dist/prompts/prompt.cjs.map +1 -1
- package/dist/prompts/prompt.d.cts +1 -2
- package/dist/prompts/prompt.d.cts.map +1 -1
- package/dist/prompts/prompt.d.ts +1 -2
- package/dist/prompts/prompt.d.ts.map +1 -1
- package/dist/prompts/prompt.js +11 -15
- 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 +76 -100
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +46 -4
- package/dist/runnables/base.d.cts.map +1 -1
- package/dist/runnables/base.d.ts +46 -4
- package/dist/runnables/base.d.ts.map +1 -1
- package/dist/runnables/base.js +58 -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 +21 -16
- 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 +19 -13
- package/dist/runnables/config.js.map +1 -1
- package/dist/runnables/graph.cjs +19 -22
- 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 +6 -10
- 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 +15 -17
- package/dist/runnables/history.cjs.map +1 -1
- package/dist/runnables/history.d.cts +5 -4
- package/dist/runnables/history.d.cts.map +1 -1
- package/dist/runnables/history.d.ts +5 -6
- package/dist/runnables/history.d.ts.map +1 -1
- package/dist/runnables/history.js +10 -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 +226 -0
- package/dist/testing/fake_model_builder.cjs.map +1 -0
- package/dist/testing/fake_model_builder.d.cts +137 -0
- package/dist/testing/fake_model_builder.d.cts.map +1 -0
- package/dist/testing/fake_model_builder.d.ts +137 -0
- package/dist/testing/fake_model_builder.d.ts.map +1 -0
- package/dist/testing/fake_model_builder.js +225 -0
- package/dist/testing/fake_model_builder.js.map +1 -0
- package/dist/testing/index.cjs +58 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +5 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +32 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/matchers.cjs +214 -0
- package/dist/testing/matchers.cjs.map +1 -0
- package/dist/testing/matchers.d.cts +98 -0
- package/dist/testing/matchers.d.cts.map +1 -0
- package/dist/testing/matchers.d.ts +98 -0
- package/dist/testing/matchers.d.ts.map +1 -0
- package/dist/testing/matchers.js +204 -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 +44 -19
- 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 +35 -11
- 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 +112 -20
- package/dist/tracers/tracer_langchain.cjs.map +1 -1
- package/dist/tracers/tracer_langchain.d.cts +28 -2
- package/dist/tracers/tracer_langchain.d.cts.map +1 -1
- package/dist/tracers/tracer_langchain.d.ts +28 -2
- package/dist/tracers/tracer_langchain.d.ts.map +1 -1
- package/dist/tracers/tracer_langchain.js +102 -12
- 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 +28 -20
- 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 +18 -12
- 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 +15 -23
- 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 +8 -17
- 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.map +1 -1
- 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 +36 -21
- package/dist/utils/testing/index.cjs.map +1 -1
- package/dist/utils/testing/index.d.cts +3 -1
- package/dist/utils/testing/index.d.ts +3 -1
- package/dist/utils/testing/index.js +14 -7
- package/dist/utils/testing/index.js.map +1 -1
- 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/openai_stream_fixtures.cjs +160 -0
- package/dist/utils/testing/openai_stream_fixtures.cjs.map +1 -0
- package/dist/utils/testing/openai_stream_fixtures.d.cts +12 -0
- package/dist/utils/testing/openai_stream_fixtures.d.cts.map +1 -0
- package/dist/utils/testing/openai_stream_fixtures.d.ts +12 -0
- package/dist/utils/testing/openai_stream_fixtures.d.ts.map +1 -0
- package/dist/utils/testing/openai_stream_fixtures.js +155 -0
- package/dist/utils/testing/openai_stream_fixtures.js.map +1 -0
- 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/stream.cjs +136 -0
- package/dist/utils/testing/stream.cjs.map +1 -0
- package/dist/utils/testing/stream.d.cts +96 -0
- package/dist/utils/testing/stream.d.cts.map +1 -0
- package/dist/utils/testing/stream.d.ts +96 -0
- package/dist/utils/testing/stream.d.ts.map +1 -0
- package/dist/utils/testing/stream.js +136 -0
- package/dist/utils/testing/stream.js.map +1 -0
- 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/uuid/index.cjs +58 -0
- package/dist/utils/uuid/index.cjs.map +1 -0
- package/dist/utils/uuid/index.d.cts +26 -0
- package/dist/utils/uuid/index.d.cts.map +1 -0
- package/dist/utils/uuid/index.d.ts +26 -0
- package/dist/utils/uuid/index.d.ts.map +1 -0
- package/dist/utils/uuid/index.js +41 -0
- package/dist/utils/uuid/index.js.map +1 -0
- package/dist/utils/uuid/max.cjs +6 -0
- package/dist/utils/uuid/max.cjs.map +1 -0
- package/dist/utils/uuid/max.js +6 -0
- package/dist/utils/uuid/max.js.map +1 -0
- package/dist/utils/uuid/nil.cjs +6 -0
- package/dist/utils/uuid/nil.cjs.map +1 -0
- package/dist/utils/uuid/nil.js +6 -0
- package/dist/utils/uuid/nil.js.map +1 -0
- package/dist/utils/uuid/parse.cjs +11 -0
- package/dist/utils/uuid/parse.cjs.map +1 -0
- package/dist/utils/uuid/parse.d.cts +7 -0
- package/dist/utils/uuid/parse.d.cts.map +1 -0
- package/dist/utils/uuid/parse.d.ts +7 -0
- package/dist/utils/uuid/parse.d.ts.map +1 -0
- package/dist/utils/uuid/parse.js +11 -0
- package/dist/utils/uuid/parse.js.map +1 -0
- package/dist/utils/uuid/regex.cjs +6 -0
- package/dist/utils/uuid/regex.cjs.map +1 -0
- package/dist/utils/uuid/regex.js +6 -0
- package/dist/utils/uuid/regex.js.map +1 -0
- package/dist/utils/uuid/rng.cjs +9 -0
- package/dist/utils/uuid/rng.cjs.map +1 -0
- package/dist/utils/uuid/rng.js +9 -0
- package/dist/utils/uuid/rng.js.map +1 -0
- package/dist/utils/uuid/sha1.cjs +71 -0
- package/dist/utils/uuid/sha1.cjs.map +1 -0
- package/dist/utils/uuid/sha1.js +71 -0
- package/dist/utils/uuid/sha1.js.map +1 -0
- package/dist/utils/uuid/stringify.cjs +21 -0
- package/dist/utils/uuid/stringify.cjs.map +1 -0
- package/dist/utils/uuid/stringify.d.cts +5 -0
- package/dist/utils/uuid/stringify.d.cts.map +1 -0
- package/dist/utils/uuid/stringify.d.ts +5 -0
- package/dist/utils/uuid/stringify.d.ts.map +1 -0
- package/dist/utils/uuid/stringify.js +20 -0
- package/dist/utils/uuid/stringify.js.map +1 -0
- package/dist/utils/uuid/types.d.cts +26 -0
- package/dist/utils/uuid/types.d.cts.map +1 -0
- package/dist/utils/uuid/types.d.ts +26 -0
- package/dist/utils/uuid/types.d.ts.map +1 -0
- package/dist/utils/uuid/v1.cjs +69 -0
- package/dist/utils/uuid/v1.cjs.map +1 -0
- package/dist/utils/uuid/v1.d.cts +8 -0
- package/dist/utils/uuid/v1.d.cts.map +1 -0
- package/dist/utils/uuid/v1.d.ts +8 -0
- package/dist/utils/uuid/v1.d.ts.map +1 -0
- package/dist/utils/uuid/v1.js +69 -0
- package/dist/utils/uuid/v1.js.map +1 -0
- package/dist/utils/uuid/v1ToV6.cjs +14 -0
- package/dist/utils/uuid/v1ToV6.cjs.map +1 -0
- package/dist/utils/uuid/v1ToV6.js +14 -0
- package/dist/utils/uuid/v1ToV6.js.map +1 -0
- package/dist/utils/uuid/v35.cjs +36 -0
- package/dist/utils/uuid/v35.cjs.map +1 -0
- package/dist/utils/uuid/v35.js +34 -0
- package/dist/utils/uuid/v35.js.map +1 -0
- package/dist/utils/uuid/v4.cjs +25 -0
- package/dist/utils/uuid/v4.cjs.map +1 -0
- package/dist/utils/uuid/v4.d.cts +8 -0
- package/dist/utils/uuid/v4.d.cts.map +1 -0
- package/dist/utils/uuid/v4.d.ts +8 -0
- package/dist/utils/uuid/v4.d.ts.map +1 -0
- package/dist/utils/uuid/v4.js +25 -0
- package/dist/utils/uuid/v4.js.map +1 -0
- package/dist/utils/uuid/v5.cjs +12 -0
- package/dist/utils/uuid/v5.cjs.map +1 -0
- package/dist/utils/uuid/v5.d.cts +14 -0
- package/dist/utils/uuid/v5.d.cts.map +1 -0
- package/dist/utils/uuid/v5.d.ts +14 -0
- package/dist/utils/uuid/v5.d.ts.map +1 -0
- package/dist/utils/uuid/v5.js +12 -0
- package/dist/utils/uuid/v5.js.map +1 -0
- package/dist/utils/uuid/v6.cjs +23 -0
- package/dist/utils/uuid/v6.cjs.map +1 -0
- package/dist/utils/uuid/v6.d.cts +8 -0
- package/dist/utils/uuid/v6.d.cts.map +1 -0
- package/dist/utils/uuid/v6.d.ts +8 -0
- package/dist/utils/uuid/v6.d.ts.map +1 -0
- package/dist/utils/uuid/v6.js +23 -0
- package/dist/utils/uuid/v6.js.map +1 -0
- package/dist/utils/uuid/v7.cjs +57 -0
- package/dist/utils/uuid/v7.cjs.map +1 -0
- package/dist/utils/uuid/v7.d.cts +8 -0
- package/dist/utils/uuid/v7.d.cts.map +1 -0
- package/dist/utils/uuid/v7.d.ts +8 -0
- package/dist/utils/uuid/v7.d.ts.map +1 -0
- package/dist/utils/uuid/v7.js +57 -0
- package/dist/utils/uuid/v7.js.map +1 -0
- package/dist/utils/uuid/validate.cjs +9 -0
- package/dist/utils/uuid/validate.cjs.map +1 -0
- package/dist/utils/uuid/validate.d.cts +5 -0
- package/dist/utils/uuid/validate.d.cts.map +1 -0
- package/dist/utils/uuid/validate.d.ts +5 -0
- package/dist/utils/uuid/validate.d.ts.map +1 -0
- package/dist/utils/uuid/validate.js +9 -0
- package/dist/utils/uuid/validate.js.map +1 -0
- package/dist/utils/uuid/version.cjs +10 -0
- package/dist/utils/uuid/version.cjs.map +1 -0
- package/dist/utils/uuid/version.d.cts +5 -0
- package/dist/utils/uuid/version.d.cts.map +1 -0
- package/dist/utils/uuid/version.d.ts +5 -0
- package/dist/utils/uuid/version.d.ts.map +1 -0
- package/dist/utils/uuid/version.js +10 -0
- package/dist/utils/uuid/version.js.map +1 -0
- 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 +28 -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 +27 -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/document_loaders/base.cjs +1 -0
- package/document_loaders/base.d.cts +1 -0
- package/document_loaders/base.d.ts +1 -0
- package/document_loaders/base.js +1 -0
- package/document_loaders/langsmith.cjs +1 -0
- package/document_loaders/langsmith.d.cts +1 -0
- package/document_loaders/langsmith.d.ts +1 -0
- package/document_loaders/langsmith.js +1 -0
- package/documents.cjs +1 -0
- package/documents.d.cts +1 -0
- package/documents.d.ts +1 -0
- package/documents.js +1 -0
- package/embeddings.cjs +1 -0
- package/embeddings.d.cts +1 -0
- package/embeddings.d.ts +1 -0
- package/embeddings.js +1 -0
- package/errors.cjs +1 -0
- package/errors.d.cts +1 -0
- package/errors.d.ts +1 -0
- package/errors.js +1 -0
- package/example_selectors.cjs +1 -0
- package/example_selectors.d.cts +1 -0
- package/example_selectors.d.ts +1 -0
- package/example_selectors.js +1 -0
- package/indexing.cjs +1 -0
- package/indexing.d.cts +1 -0
- package/indexing.d.ts +1 -0
- package/indexing.js +1 -0
- package/language_models/base.cjs +1 -0
- package/language_models/base.d.cts +1 -0
- package/language_models/base.d.ts +1 -0
- package/language_models/base.js +1 -0
- package/language_models/chat_models.cjs +1 -0
- package/language_models/chat_models.d.cts +1 -0
- package/language_models/chat_models.d.ts +1 -0
- package/language_models/chat_models.js +1 -0
- package/language_models/compat.cjs +1 -0
- package/language_models/compat.d.cts +1 -0
- package/language_models/compat.d.ts +1 -0
- package/language_models/compat.js +1 -0
- package/language_models/event.cjs +1 -0
- package/language_models/event.d.cts +1 -0
- package/language_models/event.d.ts +1 -0
- package/language_models/event.js +1 -0
- package/language_models/llms.cjs +1 -0
- package/language_models/llms.d.cts +1 -0
- package/language_models/llms.d.ts +1 -0
- package/language_models/llms.js +1 -0
- package/language_models/openai_completions_stream.cjs +1 -0
- package/language_models/openai_completions_stream.d.cts +1 -0
- package/language_models/openai_completions_stream.d.ts +1 -0
- package/language_models/openai_completions_stream.js +1 -0
- package/language_models/profile.cjs +1 -0
- package/language_models/profile.d.cts +1 -0
- package/language_models/profile.d.ts +1 -0
- package/language_models/profile.js +1 -0
- package/language_models/stream.cjs +1 -0
- package/language_models/stream.d.cts +1 -0
- package/language_models/stream.d.ts +1 -0
- package/language_models/stream.js +1 -0
- package/language_models/structured_output.cjs +1 -0
- package/language_models/structured_output.d.cts +1 -0
- package/language_models/structured_output.d.ts +1 -0
- package/language_models/structured_output.js +1 -0
- package/load/serializable.cjs +1 -0
- package/load/serializable.d.cts +1 -0
- package/load/serializable.d.ts +1 -0
- package/load/serializable.js +1 -0
- package/load.cjs +1 -0
- package/load.d.cts +1 -0
- package/load.d.ts +1 -0
- package/load.js +1 -0
- package/memory.cjs +1 -0
- package/memory.d.cts +1 -0
- package/memory.d.ts +1 -0
- package/memory.js +1 -0
- package/messages/tool.cjs +1 -0
- package/messages/tool.d.cts +1 -0
- package/messages/tool.d.ts +1 -0
- package/messages/tool.js +1 -0
- package/messages.cjs +1 -0
- package/messages.d.cts +1 -0
- package/messages.d.ts +1 -0
- package/messages.js +1 -0
- package/output_parsers/openai_functions.cjs +1 -0
- package/output_parsers/openai_functions.d.cts +1 -0
- package/output_parsers/openai_functions.d.ts +1 -0
- package/output_parsers/openai_functions.js +1 -0
- package/output_parsers/openai_tools.cjs +1 -0
- package/output_parsers/openai_tools.d.cts +1 -0
- package/output_parsers/openai_tools.d.ts +1 -0
- package/output_parsers/openai_tools.js +1 -0
- package/output_parsers.cjs +1 -0
- package/output_parsers.d.cts +1 -0
- package/output_parsers.d.ts +1 -0
- package/output_parsers.js +1 -0
- package/outputs.cjs +1 -0
- package/outputs.d.cts +1 -0
- package/outputs.d.ts +1 -0
- package/outputs.js +1 -0
- package/package.json +144 -27
- package/prompt_values.cjs +1 -0
- package/prompt_values.d.cts +1 -0
- package/prompt_values.d.ts +1 -0
- package/prompt_values.js +1 -0
- package/prompts.cjs +1 -0
- package/prompts.d.cts +1 -0
- package/prompts.d.ts +1 -0
- package/prompts.js +1 -0
- package/retrievers/document_compressors.cjs +1 -0
- package/retrievers/document_compressors.d.cts +1 -0
- package/retrievers/document_compressors.d.ts +1 -0
- package/retrievers/document_compressors.js +1 -0
- package/retrievers.cjs +1 -0
- package/retrievers.d.cts +1 -0
- package/retrievers.d.ts +1 -0
- package/retrievers.js +1 -0
- package/runnables/graph.cjs +1 -0
- package/runnables/graph.d.cts +1 -0
- package/runnables/graph.d.ts +1 -0
- package/runnables/graph.js +1 -0
- package/runnables.cjs +1 -0
- package/runnables.d.cts +1 -0
- package/runnables.d.ts +1 -0
- package/runnables.js +1 -0
- package/singletons.cjs +1 -0
- package/singletons.d.cts +1 -0
- package/singletons.d.ts +1 -0
- package/singletons.js +1 -0
- package/stores.cjs +1 -0
- package/stores.d.cts +1 -0
- package/stores.d.ts +1 -0
- package/stores.js +1 -0
- package/structured_query.cjs +1 -0
- package/structured_query.d.cts +1 -0
- package/structured_query.d.ts +1 -0
- package/structured_query.js +1 -0
- package/testing.cjs +1 -0
- package/testing.d.cts +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +1 -0
- package/tools.cjs +1 -0
- package/tools.d.cts +1 -0
- package/tools.d.ts +1 -0
- package/tools.js +1 -0
- package/tracers/base.cjs +1 -0
- package/tracers/base.d.cts +1 -0
- package/tracers/base.d.ts +1 -0
- package/tracers/base.js +1 -0
- package/tracers/console.cjs +1 -0
- package/tracers/console.d.cts +1 -0
- package/tracers/console.d.ts +1 -0
- package/tracers/console.js +1 -0
- package/tracers/log_stream.cjs +1 -0
- package/tracers/log_stream.d.cts +1 -0
- package/tracers/log_stream.d.ts +1 -0
- package/tracers/log_stream.js +1 -0
- package/tracers/run_collector.cjs +1 -0
- package/tracers/run_collector.d.cts +1 -0
- package/tracers/run_collector.d.ts +1 -0
- package/tracers/run_collector.js +1 -0
- package/tracers/tracer_langchain.cjs +1 -0
- package/tracers/tracer_langchain.d.cts +1 -0
- package/tracers/tracer_langchain.d.ts +1 -0
- package/tracers/tracer_langchain.js +1 -0
- package/types/stream.cjs +1 -0
- package/types/stream.d.cts +1 -0
- package/types/stream.d.ts +1 -0
- package/types/stream.js +1 -0
- package/utils/async_caller.cjs +1 -0
- package/utils/async_caller.d.cts +1 -0
- package/utils/async_caller.d.ts +1 -0
- package/utils/async_caller.js +1 -0
- package/utils/chunk_array.cjs +1 -0
- package/utils/chunk_array.d.cts +1 -0
- package/utils/chunk_array.d.ts +1 -0
- package/utils/chunk_array.js +1 -0
- package/utils/context.cjs +1 -0
- package/utils/context.d.cts +1 -0
- package/utils/context.d.ts +1 -0
- package/utils/context.js +1 -0
- package/utils/env.cjs +1 -0
- package/utils/env.d.cts +1 -0
- package/utils/env.d.ts +1 -0
- package/utils/env.js +1 -0
- package/utils/event_source_parse.cjs +1 -0
- package/utils/event_source_parse.d.cts +1 -0
- package/utils/event_source_parse.d.ts +1 -0
- package/utils/event_source_parse.js +1 -0
- package/utils/format.cjs +1 -0
- package/utils/format.d.cts +1 -0
- package/utils/format.d.ts +1 -0
- package/utils/format.js +1 -0
- package/utils/function_calling.cjs +1 -0
- package/utils/function_calling.d.cts +1 -0
- package/utils/function_calling.d.ts +1 -0
- package/utils/function_calling.js +1 -0
- package/utils/hash.cjs +1 -0
- package/utils/hash.d.cts +1 -0
- package/utils/hash.d.ts +1 -0
- package/utils/hash.js +1 -0
- package/utils/json_patch.cjs +1 -0
- package/utils/json_patch.d.cts +1 -0
- package/utils/json_patch.d.ts +1 -0
- package/utils/json_patch.js +1 -0
- package/utils/json_schema.cjs +1 -0
- package/utils/json_schema.d.cts +1 -0
- package/utils/json_schema.d.ts +1 -0
- package/utils/json_schema.js +1 -0
- package/utils/math.cjs +1 -0
- package/utils/math.d.cts +1 -0
- package/utils/math.d.ts +1 -0
- package/utils/math.js +1 -0
- package/utils/ssrf.cjs +1 -0
- package/utils/ssrf.d.cts +1 -0
- package/utils/ssrf.d.ts +1 -0
- package/utils/ssrf.js +1 -0
- package/utils/standard_schema.cjs +1 -0
- package/utils/standard_schema.d.cts +1 -0
- package/utils/standard_schema.d.ts +1 -0
- package/utils/standard_schema.js +1 -0
- package/utils/stream.cjs +1 -0
- package/utils/stream.d.cts +1 -0
- package/utils/stream.d.ts +1 -0
- package/utils/stream.js +1 -0
- package/utils/testing.cjs +1 -0
- package/utils/testing.d.cts +1 -0
- package/utils/testing.d.ts +1 -0
- package/utils/testing.js +1 -0
- package/utils/tiktoken.cjs +1 -0
- package/utils/tiktoken.d.cts +1 -0
- package/utils/tiktoken.d.ts +1 -0
- package/utils/tiktoken.js +1 -0
- package/utils/types.cjs +1 -0
- package/utils/types.d.cts +1 -0
- package/utils/types.d.ts +1 -0
- package/utils/types.js +1 -0
- package/utils/uuid.cjs +1 -0
- package/utils/uuid.d.cts +1 -0
- package/utils/uuid.d.ts +1 -0
- package/utils/uuid.js +1 -0
- package/vectorstores.cjs +1 -0
- package/vectorstores.d.cts +1 -0
- package/vectorstores.d.ts +1 -0
- package/vectorstores.js +1 -0
- package/dist/_virtual/rolldown_runtime.js +0 -11
package/dist/tools/types.d.cts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { MessageContent } from "../messages/base.cjs";
|
|
2
2
|
import { DirectToolOutput, ToolCall, ToolMessage } from "../messages/tool.cjs";
|
|
3
|
-
import { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType } from "../utils/types/zod.cjs";
|
|
3
|
+
import { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType, ZodV3Like } from "../utils/types/zod.cjs";
|
|
4
4
|
import { CallbackManagerForToolRun } from "../callbacks/manager.cjs";
|
|
5
5
|
import { RunnableConfig, RunnableInterface } from "../runnables/types.cjs";
|
|
6
6
|
import { RunnableToolLike } from "../runnables/base.cjs";
|
|
7
7
|
import { JsonSchema7Type } from "../utils/zod-to-json-schema/parseTypes.cjs";
|
|
8
8
|
import { BaseLangChainParams, ToolDefinition } from "../language_models/base.cjs";
|
|
9
9
|
import { BaseStore } from "../stores.cjs";
|
|
10
|
-
import { z } from "zod/v3";
|
|
11
10
|
|
|
12
11
|
//#region src/tools/types.d.ts
|
|
13
12
|
type ResponseFormat = "content" | "content_and_artifact" | string;
|
|
14
13
|
type ToolOutputType = any;
|
|
14
|
+
type ToolEventType = unknown;
|
|
15
|
+
type InferToolEventFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<infer Y, any, any>) ? Y : ToolEventType;
|
|
16
|
+
type InferToolOutputFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<any, infer R, any>) ? R : F extends ((...args: any[]) => Promise<infer R>) ? R : F extends ((...args: any[]) => infer R) ? R : ToolOutputType;
|
|
15
17
|
type ContentAndArtifact = [MessageContent, any];
|
|
16
18
|
/**
|
|
17
19
|
* Conditional type that determines the return type of the {@link StructuredTool.invoke} method.
|
|
@@ -36,7 +38,7 @@ type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput
|
|
|
36
38
|
* Base type that establishes the types of input schemas that can be used for LangChain tool
|
|
37
39
|
* definitions.
|
|
38
40
|
*/
|
|
39
|
-
type ToolInputSchemaBase =
|
|
41
|
+
type ToolInputSchemaBase = InteropZodType | JsonSchema7Type;
|
|
40
42
|
/**
|
|
41
43
|
* Parameters for the Tool classes.
|
|
42
44
|
*/
|
|
@@ -128,7 +130,7 @@ type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolI
|
|
|
128
130
|
* This is primarily used for creating simple string-based tools where the LLM
|
|
129
131
|
* only needs to provide a single text value as input to the tool.
|
|
130
132
|
*/
|
|
131
|
-
type StringInputToolSchema =
|
|
133
|
+
type StringInputToolSchema = ZodV3Like<string | undefined, any>;
|
|
132
134
|
/**
|
|
133
135
|
* Interface that defines the shape of a LangChain structured tool.
|
|
134
136
|
*
|
|
@@ -163,6 +165,7 @@ interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT =
|
|
|
163
165
|
* @returns A Promise that resolves with a string.
|
|
164
166
|
*/
|
|
165
167
|
call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */
|
|
168
|
+
|
|
166
169
|
tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;
|
|
167
170
|
/**
|
|
168
171
|
* The name of the tool.
|
|
@@ -222,17 +225,22 @@ interface BaseDynamicToolInput extends ToolParams {
|
|
|
222
225
|
}
|
|
223
226
|
/**
|
|
224
227
|
* Interface for the input parameters of the DynamicTool class.
|
|
228
|
+
*
|
|
229
|
+
* @param ToolOutputT - The return type of the tool.
|
|
230
|
+
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
225
231
|
*/
|
|
226
|
-
interface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {
|
|
227
|
-
func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;
|
|
232
|
+
interface DynamicToolInput<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
233
|
+
func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;
|
|
228
234
|
}
|
|
229
235
|
/**
|
|
230
236
|
* Interface for the input parameters of the DynamicStructuredTool class.
|
|
231
237
|
*
|
|
232
238
|
* @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.
|
|
233
239
|
* @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.
|
|
240
|
+
* @param ToolOutputT - The return type of the tool.
|
|
241
|
+
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
234
242
|
*/
|
|
235
|
-
interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {
|
|
243
|
+
interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
236
244
|
/**
|
|
237
245
|
* Tool handler function - the function that will be called when the tool is invoked.
|
|
238
246
|
*
|
|
@@ -241,7 +249,7 @@ interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutput
|
|
|
241
249
|
* @param config - The configuration for the tool.
|
|
242
250
|
* @returns The result of the tool.
|
|
243
251
|
*/
|
|
244
|
-
func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;
|
|
252
|
+
func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;
|
|
245
253
|
schema: SchemaT;
|
|
246
254
|
}
|
|
247
255
|
/**
|
|
@@ -293,7 +301,7 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
293
301
|
*
|
|
294
302
|
* @example
|
|
295
303
|
* ```typescript
|
|
296
|
-
* import { tool, ToolRuntime } from "@langchain/core/tools";
|
|
304
|
+
* import { tool, type ToolRuntime } from "@langchain/core/tools";
|
|
297
305
|
* import { z } from "zod";
|
|
298
306
|
*
|
|
299
307
|
* const stateSchema = z.object({
|
|
@@ -302,7 +310,7 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
302
310
|
* });
|
|
303
311
|
*
|
|
304
312
|
* const greet = tool(
|
|
305
|
-
* async ({ name }, runtime) => {
|
|
313
|
+
* async ({ name }, runtime: ToolRuntime<typeof stateSchema>) => {
|
|
306
314
|
* // Access state
|
|
307
315
|
* const messages = runtime.state.messages;
|
|
308
316
|
*
|
|
@@ -330,6 +338,13 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
330
338
|
* stateSchema,
|
|
331
339
|
* }
|
|
332
340
|
* );
|
|
341
|
+
*
|
|
342
|
+
* const agent = createAgent({
|
|
343
|
+
* model,
|
|
344
|
+
* tools: [greet],
|
|
345
|
+
* stateSchema,
|
|
346
|
+
* contextSchema,
|
|
347
|
+
* });
|
|
333
348
|
* ```
|
|
334
349
|
*
|
|
335
350
|
* @template StateT - The type of the state schema (inferred from stateSchema)
|
|
@@ -366,5 +381,5 @@ type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {
|
|
|
366
381
|
writer: ((chunk: unknown) => void) | null;
|
|
367
382
|
};
|
|
368
383
|
//#endregion
|
|
369
|
-
export { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
384
|
+
export { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, InferToolEventFromFunc, InferToolOutputFromFunc, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolEventType, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
370
385
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["z","z3","CallbackManagerForToolRun","BaseLangChainParams","ToolDefinition","RunnableConfig","RunnableToolLike","RunnableInterface","DirectToolOutput","ToolCall","ToolMessage","MessageContent","InferInteropZodInput","InferInteropZodOutput","InteropZodType","InteropZodObject","JSONSchema","BaseStore","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TInput","TConfig","TOutput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolCallInput","TArg","ToolOutputT","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool","ToolRuntime","TState","TContext"],"sources":["../../src/tools/types.d.ts"],"sourcesContent":["import type { z as z3 } from \"zod/v3\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport type { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport { RunnableToolLike, type RunnableInterface } from \"../runnables/base.js\";\nimport { type DirectToolOutput, type ToolCall, type ToolMessage } from \"../messages/tool.js\";\nimport type { MessageContent } from \"../messages/base.js\";\nimport { type InferInteropZodInput, type InferInteropZodOutput, type InteropZodType, type InteropZodObject } from \"../utils/types/zod.js\";\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport type { BaseStore } from \"../stores.js\";\nexport type ResponseFormat = \"content\" | \"content_and_artifact\" | string;\nexport type ToolOutputType = any;\nexport type ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\nexport type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\nexport type ToolInputSchemaBase = z3.ZodTypeAny | JSONSchema;\n/**\n * Parameters for the Tool classes.\n */\nexport interface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\nexport type ToolRunnableConfig<ConfigurableFieldType extends Record<string, any> = Record<string, any>, ContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\nexport interface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\" | \"extras\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JSONSchema ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JSONSchema ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\nexport type StringInputToolSchema = z3.ZodType<string | undefined, z3.ZodTypeDef, any>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\nexport type ToolCallInput<SchemaT = StringInputToolSchema> = StructuredToolCallInput<SchemaT, ToolInputSchemaInputType<SchemaT>>;\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, \n /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\nexport interface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\nexport interface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\nexport declare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JSONSchema): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\nexport declare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\nexport declare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\nexport declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\nexport type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject ? InferInteropZodOutput<TState> : TState extends Record<string, unknown> ? TState : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject ? InferInteropZodOutput<TContext> : TContext extends Record<string, unknown> ? TContext : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;KAUYkB,cAAAA;KACAC,cAAAA;AADAD,KAEAE,kBAAAA,GAFc,CAEQT,cAFR,EAAA,GAAA,CAAA;AAC1B;AACA;AAOA;;;;AAAoGY,KAAxFF,cAAwFE,CAAAA,MAAAA,EAAAA,OAAAA,EAAAA,OAAAA,CAAAA,GAA7CC,OAA6CD,SAA7Bf,gBAA6Be,GAAVC,OAAUD,GAAAA,OAAAA,SAAAA;EAIhGb,QAAAA,EAAAA;IAAca,EAAAA,EAAAA,MAAAA;EAIdC,CAAAA;CAAUD,GAJVb,WAIUa,GAJIA,OAIJA,SAAAA;EAIVC,QAAAA,EAAAA;IAAUd,EAAAA,EAAAA,SAAAA;EAAcY,CAAAA;CAAeb,GAJvCe,OAIuCf,GAJ7Bc,OAI6Bd,SAAAA;EAAWC,QAAAA,EAAAA;IAAcc,EAAAA,CAAAA,EAAAA,MAAAA;EAAO,CAAA;AAK3E,CAAA,GALIA,OAKQC,GALEf,WAKFe,GALgBH,MAKG,SALYb,QAKNiB,GALiBhB,WAKJM,GALkBQ,OAKR;AAI5D;;;;AA+BaK,KAnCDJ,mBAAAA,GAAsBxB,CAAAA,C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;iBAgB5C,sBAAA,CACd,IAAA,aACC,IAAA,IAAQ,oBAAA;;;;;;;;;iBA0BK,eAAA,CAAgB,IAAA,aAAiB,IAAA,IAAQ,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxJzD;;;;;;;;;;;;;;;;;;;KAqOY,WAAA,yCAGR,cAAA;EAnNS;;;EAuNX,KAAA,EAAO,MAAA,SAAe,gBAAA,GAClB,qBAAA,CAAsB,MAAA,IACtB,MAAA,SAAe,MAAA,oBACb,MAAA;EA3OyB;;;EAgP/B,UAAA;EAlPe;;;EAsPf,QAAA,GAAW,QAAA;EApPH;;;EAwPR,MAAA,EAAQ,kBAAA;EA9OR;;;EAkPA,OAAA,EAAS,QAAA,SAAiB,gBAAA,GACtB,qBAAA,CAAsB,QAAA,IACtB,QAAA,SAAiB,MAAA,oBACf,QAAA;EApP0C;;;EAyPhD,KAAA,EAAO,SAAA;EArPL;;;EAyPF,MAAA,IAAU,KAAA;AAAA"}
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { MessageContent } from "../messages/base.js";
|
|
2
2
|
import { DirectToolOutput, ToolCall, ToolMessage } from "../messages/tool.js";
|
|
3
|
-
import { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType } from "../utils/types/zod.js";
|
|
3
|
+
import { InferInteropZodInput, InferInteropZodOutput, InteropZodObject, InteropZodType, ZodV3Like } from "../utils/types/zod.js";
|
|
4
4
|
import { CallbackManagerForToolRun } from "../callbacks/manager.js";
|
|
5
5
|
import { RunnableConfig, RunnableInterface } from "../runnables/types.js";
|
|
6
|
-
import "../runnables/config.js";
|
|
7
6
|
import { RunnableToolLike } from "../runnables/base.js";
|
|
8
7
|
import { JsonSchema7Type } from "../utils/zod-to-json-schema/parseTypes.js";
|
|
9
|
-
import "../utils/json_schema.js";
|
|
10
8
|
import { BaseLangChainParams, ToolDefinition } from "../language_models/base.js";
|
|
11
9
|
import { BaseStore } from "../stores.js";
|
|
12
|
-
import { z } from "zod/v3";
|
|
13
10
|
|
|
14
11
|
//#region src/tools/types.d.ts
|
|
15
12
|
type ResponseFormat = "content" | "content_and_artifact" | string;
|
|
16
13
|
type ToolOutputType = any;
|
|
14
|
+
type ToolEventType = unknown;
|
|
15
|
+
type InferToolEventFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<infer Y, any, any>) ? Y : ToolEventType;
|
|
16
|
+
type InferToolOutputFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<any, infer R, any>) ? R : F extends ((...args: any[]) => Promise<infer R>) ? R : F extends ((...args: any[]) => infer R) ? R : ToolOutputType;
|
|
17
17
|
type ContentAndArtifact = [MessageContent, any];
|
|
18
18
|
/**
|
|
19
19
|
* Conditional type that determines the return type of the {@link StructuredTool.invoke} method.
|
|
@@ -38,7 +38,7 @@ type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput
|
|
|
38
38
|
* Base type that establishes the types of input schemas that can be used for LangChain tool
|
|
39
39
|
* definitions.
|
|
40
40
|
*/
|
|
41
|
-
type ToolInputSchemaBase =
|
|
41
|
+
type ToolInputSchemaBase = InteropZodType | JsonSchema7Type;
|
|
42
42
|
/**
|
|
43
43
|
* Parameters for the Tool classes.
|
|
44
44
|
*/
|
|
@@ -130,7 +130,7 @@ type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolI
|
|
|
130
130
|
* This is primarily used for creating simple string-based tools where the LLM
|
|
131
131
|
* only needs to provide a single text value as input to the tool.
|
|
132
132
|
*/
|
|
133
|
-
type StringInputToolSchema =
|
|
133
|
+
type StringInputToolSchema = ZodV3Like<string | undefined, any>;
|
|
134
134
|
/**
|
|
135
135
|
* Interface that defines the shape of a LangChain structured tool.
|
|
136
136
|
*
|
|
@@ -165,6 +165,7 @@ interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT =
|
|
|
165
165
|
* @returns A Promise that resolves with a string.
|
|
166
166
|
*/
|
|
167
167
|
call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, /** @deprecated */
|
|
168
|
+
|
|
168
169
|
tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;
|
|
169
170
|
/**
|
|
170
171
|
* The name of the tool.
|
|
@@ -224,17 +225,22 @@ interface BaseDynamicToolInput extends ToolParams {
|
|
|
224
225
|
}
|
|
225
226
|
/**
|
|
226
227
|
* Interface for the input parameters of the DynamicTool class.
|
|
228
|
+
*
|
|
229
|
+
* @param ToolOutputT - The return type of the tool.
|
|
230
|
+
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
227
231
|
*/
|
|
228
|
-
interface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {
|
|
229
|
-
func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;
|
|
232
|
+
interface DynamicToolInput<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
233
|
+
func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;
|
|
230
234
|
}
|
|
231
235
|
/**
|
|
232
236
|
* Interface for the input parameters of the DynamicStructuredTool class.
|
|
233
237
|
*
|
|
234
238
|
* @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.
|
|
235
239
|
* @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.
|
|
240
|
+
* @param ToolOutputT - The return type of the tool.
|
|
241
|
+
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
236
242
|
*/
|
|
237
|
-
interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {
|
|
243
|
+
interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
238
244
|
/**
|
|
239
245
|
* Tool handler function - the function that will be called when the tool is invoked.
|
|
240
246
|
*
|
|
@@ -243,7 +249,7 @@ interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutput
|
|
|
243
249
|
* @param config - The configuration for the tool.
|
|
244
250
|
* @returns The result of the tool.
|
|
245
251
|
*/
|
|
246
|
-
func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;
|
|
252
|
+
func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;
|
|
247
253
|
schema: SchemaT;
|
|
248
254
|
}
|
|
249
255
|
/**
|
|
@@ -295,7 +301,7 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
295
301
|
*
|
|
296
302
|
* @example
|
|
297
303
|
* ```typescript
|
|
298
|
-
* import { tool, ToolRuntime } from "@langchain/core/tools";
|
|
304
|
+
* import { tool, type ToolRuntime } from "@langchain/core/tools";
|
|
299
305
|
* import { z } from "zod";
|
|
300
306
|
*
|
|
301
307
|
* const stateSchema = z.object({
|
|
@@ -304,7 +310,7 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
304
310
|
* });
|
|
305
311
|
*
|
|
306
312
|
* const greet = tool(
|
|
307
|
-
* async ({ name }, runtime) => {
|
|
313
|
+
* async ({ name }, runtime: ToolRuntime<typeof stateSchema>) => {
|
|
308
314
|
* // Access state
|
|
309
315
|
* const messages = runtime.state.messages;
|
|
310
316
|
*
|
|
@@ -332,6 +338,13 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
332
338
|
* stateSchema,
|
|
333
339
|
* }
|
|
334
340
|
* );
|
|
341
|
+
*
|
|
342
|
+
* const agent = createAgent({
|
|
343
|
+
* model,
|
|
344
|
+
* tools: [greet],
|
|
345
|
+
* stateSchema,
|
|
346
|
+
* contextSchema,
|
|
347
|
+
* });
|
|
335
348
|
* ```
|
|
336
349
|
*
|
|
337
350
|
* @template StateT - The type of the state schema (inferred from stateSchema)
|
|
@@ -368,5 +381,5 @@ type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {
|
|
|
368
381
|
writer: ((chunk: unknown) => void) | null;
|
|
369
382
|
};
|
|
370
383
|
//#endregion
|
|
371
|
-
export { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
384
|
+
export { BaseDynamicToolInput, ContentAndArtifact, DynamicStructuredToolInput, DynamicToolInput, InferToolEventFromFunc, InferToolOutputFromFunc, ResponseFormat, StringInputToolSchema, StructuredToolCallInput, StructuredToolInterface, StructuredToolParams, ToolEventType, ToolInputSchemaBase, ToolInputSchemaInputType, ToolInputSchemaOutputType, ToolInterface, ToolOutputType, ToolParams, ToolReturnType, ToolRunnableConfig, ToolRuntime, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
372
385
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["z","z3","CallbackManagerForToolRun","BaseLangChainParams","ToolDefinition","RunnableConfig","RunnableToolLike","RunnableInterface","DirectToolOutput","ToolCall","ToolMessage","MessageContent","InferInteropZodInput","InferInteropZodOutput","InteropZodType","InteropZodObject","JSONSchema","BaseStore","ResponseFormat","ToolOutputType","ContentAndArtifact","ToolReturnType","TInput","TConfig","TOutput","ToolInputSchemaBase","ZodTypeAny","ToolParams","ToolRunnableConfig","Record","ConfigurableFieldType","ContextSchema","StructuredToolParams","StructuredToolInterface","Pick","ToolInputSchemaOutputType","T","ToolInputSchemaInputType","StructuredToolCallInput","SchemaT","SchemaInputT","StringInputToolSchema","ZodTypeDef","ZodType","ToolCallInput","TArg","ToolOutputT","Promise","ToolInterface","NonNullable","BaseDynamicToolInput","DynamicToolInput","DynamicStructuredToolInput","SchemaOutputT","isStructuredTool","isRunnableToolLike","isStructuredToolParams","isLangChainTool","ToolRuntime","TState","TContext"],"sources":["../../src/tools/types.d.ts"],"sourcesContent":["import type { z as z3 } from \"zod/v3\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport type { BaseLangChainParams, ToolDefinition } from \"../language_models/base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport { RunnableToolLike, type RunnableInterface } from \"../runnables/base.js\";\nimport { type DirectToolOutput, type ToolCall, type ToolMessage } from \"../messages/tool.js\";\nimport type { MessageContent } from \"../messages/base.js\";\nimport { type InferInteropZodInput, type InferInteropZodOutput, type InteropZodType, type InteropZodObject } from \"../utils/types/zod.js\";\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport type { BaseStore } from \"../stores.js\";\nexport type ResponseFormat = \"content\" | \"content_and_artifact\" | string;\nexport type ToolOutputType = any;\nexport type ContentAndArtifact = [MessageContent, any];\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\nexport type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {\n toolCall: {\n id: string;\n };\n} ? ToolMessage : TConfig extends {\n toolCall: {\n id: undefined;\n };\n} ? TOutput : TConfig extends {\n toolCall: {\n id?: string;\n };\n} ? TOutput | ToolMessage : TInput extends ToolCall ? ToolMessage : TOutput;\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\nexport type ToolInputSchemaBase = z3.ZodTypeAny | JSONSchema;\n/**\n * Parameters for the Tool classes.\n */\nexport interface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\nexport type ToolRunnableConfig<ConfigurableFieldType extends Record<string, any> = Record<string, any>, ContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\nexport interface StructuredToolParams extends Pick<StructuredToolInterface, \"name\" | \"schema\" | \"extras\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JSONSchema ? unknown : never;\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JSONSchema ? unknown : never;\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\nexport type StringInputToolSchema = z3.ZodType<string | undefined, z3.ZodTypeDef, any>;\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\nexport type ToolCallInput<SchemaT = StringInputToolSchema> = StructuredToolCallInput<SchemaT, ToolInputSchemaInputType<SchemaT>>;\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {\n lc_namespace: string[];\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, configArg?: TConfig, \n /** @deprecated */\n tags?: string[]): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n /**\n * The name of the tool.\n */\n name: string;\n /**\n * A description of the tool.\n */\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>, TConfig extends ToolRunnableConfig | undefined>(arg: TArg, callbacks?: TConfig): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\nexport interface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\nexport interface DynamicToolInput<ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT>;\n}\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (input: SchemaOutputT, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\nexport declare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JSONSchema): tool is StructuredToolInterface;\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\nexport declare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\nexport declare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\nexport declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\nexport type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject ? InferInteropZodOutput<TState> : TState extends Record<string, unknown> ? TState : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject ? InferInteropZodOutput<TContext> : TContext extends Record<string, unknown> ? TContext : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;;;;;;KAUYkB,cAAAA;KACAC,cAAAA;KACAC,k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AA;EArPL;;;EAyPF,MAAA,IAAU,KAAA;AAAA"}
|
package/dist/tools/types.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isInteropZodSchema } from "../utils/types/zod.js";
|
|
2
2
|
import { Runnable } from "../runnables/base.js";
|
|
3
|
-
|
|
4
3
|
//#region src/tools/types.ts
|
|
5
4
|
/**
|
|
6
5
|
* Confirm whether the inputted tool is an instance of `StructuredToolInterface`.
|
|
@@ -47,7 +46,7 @@ function isStructuredToolParams(tool) {
|
|
|
47
46
|
function isLangChainTool(tool) {
|
|
48
47
|
return isStructuredToolParams(tool) || isRunnableToolLike(tool) || isStructuredTool(tool);
|
|
49
48
|
}
|
|
50
|
-
|
|
51
49
|
//#endregion
|
|
52
50
|
export { isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
51
|
+
|
|
53
52
|
//# sourceMappingURL=types.js.map
|
package/dist/tools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["tool?: StructuredToolInterface | ToolDefinition | JSONSchema","tool?: unknown"],"sources":["../../src/tools/types.ts"],"sourcesContent":["import type { z as z3 } from \"zod/v3\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport type {\n BaseLangChainParams,\n ToolDefinition,\n} from \"../language_models/base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport {\n Runnable,\n RunnableToolLike,\n type RunnableInterface,\n} from \"../runnables/base.js\";\nimport {\n type DirectToolOutput,\n type ToolCall,\n type ToolMessage,\n} from \"../messages/tool.js\";\nimport type { MessageContent } from \"../messages/base.js\";\nimport {\n type InferInteropZodInput,\n type InferInteropZodOutput,\n type InteropZodType,\n isInteropZodSchema,\n type InteropZodObject,\n} from \"../utils/types/zod.js\";\n\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport type { BaseStore } from \"../stores.js\";\n\nexport type ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ToolOutputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ContentAndArtifact = [MessageContent, any];\n\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\nexport type ToolReturnType<TInput, TConfig, TOutput> =\n TOutput extends DirectToolOutput\n ? TOutput\n : TConfig extends { toolCall: { id: string } }\n ? ToolMessage\n : TConfig extends { toolCall: { id: undefined } }\n ? TOutput\n : TConfig extends { toolCall: { id?: string } }\n ? TOutput | ToolMessage\n : TInput extends ToolCall\n ? ToolMessage\n : TOutput;\n\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\nexport type ToolInputSchemaBase = z3.ZodTypeAny | JSONSchema;\n\n/**\n * Parameters for the Tool classes.\n */\nexport interface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n\nexport type ToolRunnableConfig<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ConfigurableFieldType extends Record<string, any> = Record<string, any>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextSchema = any\n> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\nexport interface StructuredToolParams\n extends Pick<StructuredToolInterface, \"name\" | \"schema\" | \"extras\"> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaOutputType<T> = T extends InteropZodType\n ? InferInteropZodOutput<T>\n : T extends JSONSchema\n ? unknown\n : never;\n\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaInputType<T> = T extends InteropZodType\n ? InferInteropZodInput<T>\n : T extends JSONSchema\n ? unknown\n : never;\n\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport type StructuredToolCallInput<\n SchemaT = ToolInputSchemaBase,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>\n> =\n | (ToolInputSchemaOutputType<SchemaT> extends string ? string : never)\n | SchemaInputT\n | ToolCall;\n\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\nexport type StringInputToolSchema = z3.ZodType<\n string | undefined,\n z3.ZodTypeDef,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n any\n>;\n\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\nexport type ToolCallInput<SchemaT = StringInputToolSchema> =\n StructuredToolCallInput<SchemaT, ToolInputSchemaInputType<SchemaT>>;\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface StructuredToolInterface<\n SchemaT = ToolInputSchemaBase,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>,\n ToolOutputT = ToolOutputType\n> extends RunnableInterface<\n StructuredToolCallInput<SchemaT, SchemaInputT>,\n ToolOutputT | ToolMessage\n > {\n lc_namespace: string[];\n\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined\n >(\n arg: TArg,\n configArg?: TConfig\n ): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined\n >(\n arg: TArg,\n configArg?: TConfig,\n /** @deprecated */\n tags?: string[]\n ): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n\n /**\n * The name of the tool.\n */\n name: string;\n\n /**\n * A description of the tool.\n */\n description: string;\n\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface ToolInterface<\n SchemaT = StringInputToolSchema,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>,\n ToolOutputT = ToolOutputType\n> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined\n >(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg,\n callbacks?: TConfig\n ): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\nexport interface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n\n/**\n * Interface for the input parameters of the DynamicTool class.\n */\nexport interface DynamicToolInput<ToolOutputT = ToolOutputType>\n extends BaseDynamicToolInput {\n func: (\n input: string,\n runManager?: CallbackManagerForToolRun,\n config?: ToolRunnableConfig\n ) => Promise<ToolOutputT>;\n}\n\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface DynamicStructuredToolInput<\n SchemaT = ToolInputSchemaBase,\n SchemaOutputT = ToolInputSchemaOutputType<SchemaT>,\n ToolOutputT = ToolOutputType\n> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (\n input: SchemaOutputT,\n runManager?: CallbackManagerForToolRun,\n config?: RunnableConfig\n ) => Promise<ToolOutputT>;\n schema: SchemaT;\n}\n\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\nexport function isStructuredTool(\n tool?: StructuredToolInterface | ToolDefinition | JSONSchema\n): tool is StructuredToolInterface {\n return (\n tool !== undefined &&\n Array.isArray((tool as StructuredToolInterface).lc_namespace)\n );\n}\n\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\nexport function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike {\n return (\n tool !== undefined &&\n Runnable.isRunnable(tool) &&\n \"lc_name\" in tool.constructor &&\n typeof tool.constructor.lc_name === \"function\" &&\n tool.constructor.lc_name() === \"RunnableToolLike\"\n );\n}\n\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\nexport function isStructuredToolParams(\n tool?: unknown\n): tool is StructuredToolParams {\n return (\n !!tool &&\n typeof tool === \"object\" &&\n \"name\" in tool &&\n \"schema\" in tool &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (isInteropZodSchema(tool.schema as Record<string, any>) ||\n (tool.schema != null &&\n typeof tool.schema === \"object\" &&\n \"type\" in tool.schema &&\n typeof tool.schema.type === \"string\" &&\n [\"null\", \"boolean\", \"object\", \"array\", \"number\", \"string\"].includes(\n tool.schema.type\n )))\n );\n}\n\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\nexport function isLangChainTool(tool?: unknown): tool is StructuredToolParams {\n return (\n isStructuredToolParams(tool) ||\n isRunnableToolLike(tool) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isStructuredTool(tool as any)\n );\n}\n\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\nexport type ToolRuntime<\n TState = unknown,\n TContext = unknown\n> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject\n ? InferInteropZodOutput<TState>\n : TState extends Record<string, unknown>\n ? TState\n : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject\n ? InferInteropZodOutput<TContext>\n : TContext extends Record<string, unknown>\n ? TContext\n : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n"],"mappings":";;;;;;;;;;AA0XA,SAAgB,iBACdA,MACiC;AACjC,QACE,SAAS,UACT,MAAM,QAAS,KAAiC,aAAa;AAEhE;;;;;;;AAQD,SAAgB,mBAAmBC,MAA0C;AAC3E,QACE,SAAS,UACT,SAAS,WAAW,KAAK,IACzB,aAAa,KAAK,eAClB,OAAO,KAAK,YAAY,YAAY,cACpC,KAAK,YAAY,SAAS,KAAK;AAElC;;;;;;;AAQD,SAAgB,uBACdA,MAC8B;AAC9B,QACE,CAAC,CAAC,QACF,OAAO,SAAS,YAChB,UAAU,QACV,YAAY,SAEX,mBAAmB,KAAK,OAA8B,IACpD,KAAK,UAAU,QACd,OAAO,KAAK,WAAW,YACvB,UAAU,KAAK,UACf,OAAO,KAAK,OAAO,SAAS,YAC5B;EAAC;EAAQ;EAAW;EAAU;EAAS;EAAU;CAAS,EAAC,SACzD,KAAK,OAAO,KACb;AAER;;;;;;;;;AAUD,SAAgB,gBAAgBA,MAA8C;AAC5E,QACE,uBAAuB,KAAK,IAC5B,mBAAmB,KAAK,IAExB,iBAAiB,KAAY;AAEhC"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/tools/types.ts"],"sourcesContent":["import type { ZodV3Like } from \"../utils/types/zod.js\";\nimport { CallbackManagerForToolRun } from \"../callbacks/manager.js\";\nimport type {\n BaseLangChainParams,\n ToolDefinition,\n} from \"../language_models/base.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport {\n Runnable,\n RunnableToolLike,\n type RunnableInterface,\n} from \"../runnables/base.js\";\nimport {\n type DirectToolOutput,\n type ToolCall,\n type ToolMessage,\n} from \"../messages/tool.js\";\nimport type { MessageContent } from \"../messages/base.js\";\nimport {\n type InferInteropZodInput,\n type InferInteropZodOutput,\n type InteropZodType,\n isInteropZodSchema,\n type InteropZodObject,\n} from \"../utils/types/zod.js\";\n\nimport { JSONSchema } from \"../utils/json_schema.js\";\nimport type { BaseStore } from \"../stores.js\";\n\nexport type ResponseFormat = \"content\" | \"content_and_artifact\" | string;\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ToolOutputType = any;\n\nexport type ToolEventType = unknown;\n\n/* oxlint-disable @typescript-eslint/no-explicit-any */\nexport type InferToolEventFromFunc<F> = F extends (\n ...args: any[]\n) => AsyncGenerator<infer Y, any, any>\n ? Y\n : ToolEventType;\n\nexport type InferToolOutputFromFunc<F> = F extends (\n ...args: any[]\n) => AsyncGenerator<any, infer R, any>\n ? R\n : F extends (...args: any[]) => Promise<infer R>\n ? R\n : F extends (...args: any[]) => infer R\n ? R\n : ToolOutputType;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ContentAndArtifact = [MessageContent, any];\n\n/**\n * Conditional type that determines the return type of the {@link StructuredTool.invoke} method.\n * - If the input is a ToolCall, it returns a ToolMessage\n * - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage\n * - Otherwise, it returns the original output type\n */\nexport type ToolReturnType<TInput, TConfig, TOutput> =\n TOutput extends DirectToolOutput\n ? TOutput\n : TConfig extends { toolCall: { id: string } }\n ? ToolMessage\n : TConfig extends { toolCall: { id: undefined } }\n ? TOutput\n : TConfig extends { toolCall: { id?: string } }\n ? TOutput | ToolMessage\n : TInput extends ToolCall\n ? ToolMessage\n : TOutput;\n\n/**\n * Base type that establishes the types of input schemas that can be used for LangChain tool\n * definitions.\n */\nexport type ToolInputSchemaBase = InteropZodType | JSONSchema;\n\n/**\n * Parameters for the Tool classes.\n */\nexport interface ToolParams extends BaseLangChainParams {\n /**\n * The tool response format.\n *\n * If \"content\" then the output of the tool is interpreted as the contents of a\n * ToolMessage. If \"content_and_artifact\" then the output is expected to be a\n * two-tuple corresponding to the (content, artifact) of a ToolMessage.\n *\n * @default \"content\"\n */\n responseFormat?: ResponseFormat;\n /**\n * Default config object for the tool runnable.\n */\n defaultConfig?: ToolRunnableConfig;\n /**\n * Whether to show full details in the thrown parsing errors.\n *\n * @default false\n */\n verboseParsingErrors?: boolean;\n /**\n * Metadata for the tool.\n */\n metadata?: Record<string, unknown>;\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n\nexport type ToolRunnableConfig<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n ConfigurableFieldType extends Record<string, any> = Record<string, any>,\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n ContextSchema = any,\n> = RunnableConfig<ConfigurableFieldType> & {\n toolCall?: ToolCall;\n context?: ContextSchema;\n};\n\n/**\n * Schema for defining tools.\n *\n * @version 0.2.19\n */\nexport interface StructuredToolParams extends Pick<\n StructuredToolInterface,\n \"name\" | \"schema\" | \"extras\"\n> {\n /**\n * An optional description of the tool to pass to the model.\n */\n description?: string;\n}\n\n/**\n * Utility type that resolves the output type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaOutputType<T> = T extends InteropZodType\n ? InferInteropZodOutput<T>\n : T extends JSONSchema\n ? unknown\n : never;\n\n/**\n * Utility type that resolves the input type of a tool input schema.\n *\n * Input & Output types are a concept used with Zod schema, as Zod allows for transforms to occur\n * during parsing. When using JSONSchema, input and output types are the same.\n *\n * The input type for a given schema should match the structure of the arguments that the LLM\n * generates as part of its {@link ToolCall}. The output type will be the type that results from\n * applying any transforms defined in your schema. If there are no transforms, the input and output\n * types will be the same.\n */\nexport type ToolInputSchemaInputType<T> = T extends InteropZodType\n ? InferInteropZodInput<T>\n : T extends JSONSchema\n ? unknown\n : never;\n\n/**\n * Defines the type that will be passed into a tool handler function as a result of a tool call.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport type StructuredToolCallInput<\n SchemaT = ToolInputSchemaBase,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>,\n> =\n | (ToolInputSchemaOutputType<SchemaT> extends string ? string : never)\n | SchemaInputT\n | ToolCall;\n\n/**\n * An input schema type for tools that accept a single string input.\n *\n * This schema defines a tool that takes an optional string parameter named \"input\".\n * It uses Zod's effects to transform the input and strip any extra properties.\n *\n * This is primarily used for creating simple string-based tools where the LLM\n * only needs to provide a single text value as input to the tool.\n */\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport type StringInputToolSchema = ZodV3Like<string | undefined, any>;\n\n/**\n * Defines the type for input to a tool's call method.\n *\n * This type is a convenience alias for StructuredToolCallInput with the input type\n * derived from the schema. It represents the possible inputs that can be passed to a tool,\n * which can be either:\n * - A string (if the tool accepts string input)\n * - A structured input matching the tool's schema\n * - A ToolCall object (typically from an LLM)\n *\n * @param SchemaT - The schema type for the tool input, defaults to StringInputToolSchema\n */\nexport type ToolCallInput<SchemaT = StringInputToolSchema> =\n StructuredToolCallInput<SchemaT, ToolInputSchemaInputType<SchemaT>>;\n\n/**\n * Interface that defines the shape of a LangChain structured tool.\n *\n * A structured tool is a tool that uses a schema to define the structure of the arguments that the\n * LLM generates as part of its {@link ToolCall}.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface StructuredToolInterface<\n SchemaT = ToolInputSchemaBase,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>,\n ToolOutputT = ToolOutputType,\n> extends RunnableInterface<\n StructuredToolCallInput<SchemaT, SchemaInputT>,\n ToolOutputT | ToolMessage\n> {\n lc_namespace: string[];\n\n /**\n * A Zod schema representing the parameters of the tool.\n */\n schema: SchemaT;\n\n /**\n * Invokes the tool with the provided argument and configuration.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration for the tool call.\n * @returns A Promise that resolves with the tool's output.\n */\n invoke<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined,\n >(\n arg: TArg,\n configArg?: TConfig\n ): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument, configuration, and tags. It\n * parses the input according to the schema, handles any errors, and\n * manages callbacks.\n * @param arg The input argument for the tool.\n * @param configArg Optional configuration or callbacks for the tool.\n * @param tags Optional tags for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined,\n >(\n arg: TArg,\n configArg?: TConfig,\n /** @deprecated */\n tags?: string[]\n ): Promise<ToolReturnType<TArg, TConfig, ToolOutputT>>;\n\n /**\n * The name of the tool.\n */\n name: string;\n\n /**\n * A description of the tool.\n */\n description: string;\n\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect: boolean;\n\n /**\n * Optional provider-specific extra fields for the tool.\n *\n * This is used to pass provider-specific configuration that doesn't fit into\n * standard tool fields.\n */\n extras?: Record<string, unknown>;\n}\n\n/**\n * A special interface for tools that accept a string input, usually defined with the {@link Tool} class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaInputT - The TypeScript type representing the structure of the tool arguments generated by the LLM. Useful for type checking tool handler functions when using JSONSchema.\n */\nexport interface ToolInterface<\n SchemaT = StringInputToolSchema,\n SchemaInputT = ToolInputSchemaInputType<SchemaT>,\n ToolOutputT = ToolOutputType,\n> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {\n /**\n * @deprecated Use .invoke() instead. Will be removed in 0.3.0.\n *\n * Calls the tool with the provided argument and callbacks. It handles\n * string inputs specifically.\n * @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.\n * @param callbacks Optional callbacks for the tool.\n * @returns A Promise that resolves with a string.\n */\n call<\n TArg extends StructuredToolCallInput<SchemaT, SchemaInputT>,\n TConfig extends ToolRunnableConfig | undefined,\n >(\n // TODO: shouldn't this be narrowed based on SchemaT?\n arg: TArg,\n callbacks?: TConfig\n ): Promise<ToolReturnType<NonNullable<TArg>, TConfig, ToolOutputT>>;\n}\n\n/**\n * Base interface for the input parameters of the {@link DynamicTool} and\n * {@link DynamicStructuredTool} classes.\n */\nexport interface BaseDynamicToolInput extends ToolParams {\n name: string;\n description: string;\n /**\n * Whether to return the tool's output directly.\n *\n * Setting this to true means that after the tool is called,\n * an agent should stop looping.\n */\n returnDirect?: boolean;\n}\n\n/**\n * Interface for the input parameters of the DynamicTool class.\n *\n * @param ToolOutputT - The return type of the tool.\n * @param ToolEventT - The type of values yielded by the tool when using an async generator.\n */\nexport interface DynamicToolInput<\n ToolOutputT = ToolOutputType,\n ToolEventT = ToolEventType,\n> extends BaseDynamicToolInput {\n func: (\n input: string,\n runManager?: CallbackManagerForToolRun,\n config?: ToolRunnableConfig\n ) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;\n}\n\n/**\n * Interface for the input parameters of the DynamicStructuredTool class.\n *\n * @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.\n * @param SchemaOutputT - The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.\n * @param ToolOutputT - The return type of the tool.\n * @param ToolEventT - The type of values yielded by the tool when using an async generator.\n */\nexport interface DynamicStructuredToolInput<\n SchemaT = ToolInputSchemaBase,\n SchemaOutputT = ToolInputSchemaOutputType<SchemaT>,\n ToolOutputT = ToolOutputType,\n ToolEventT = ToolEventType,\n> extends BaseDynamicToolInput {\n /**\n * Tool handler function - the function that will be called when the tool is invoked.\n *\n * @param input - The input to the tool.\n * @param runManager - The run manager for the tool.\n * @param config - The configuration for the tool.\n * @returns The result of the tool.\n */\n func: (\n input: SchemaOutputT,\n runManager?: CallbackManagerForToolRun,\n config?: RunnableConfig\n ) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;\n schema: SchemaT;\n}\n\n/**\n * Confirm whether the inputted tool is an instance of `StructuredToolInterface`.\n *\n * @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.\n * @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.\n */\nexport function isStructuredTool(\n tool?: StructuredToolInterface | ToolDefinition | JSONSchema\n): tool is StructuredToolInterface {\n return (\n tool !== undefined &&\n Array.isArray((tool as StructuredToolInterface).lc_namespace)\n );\n}\n\n/**\n * Confirm whether the inputted tool is an instance of `RunnableToolLike`.\n *\n * @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.\n * @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.\n */\nexport function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike {\n return (\n tool !== undefined &&\n Runnable.isRunnable(tool) &&\n \"lc_name\" in tool.constructor &&\n typeof tool.constructor.lc_name === \"function\" &&\n tool.constructor.lc_name() === \"RunnableToolLike\"\n );\n}\n\n/**\n * Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.\n *\n * @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.\n * @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.\n */\nexport function isStructuredToolParams(\n tool?: unknown\n): tool is StructuredToolParams {\n return (\n !!tool &&\n typeof tool === \"object\" &&\n \"name\" in tool &&\n \"schema\" in tool &&\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n (isInteropZodSchema(tool.schema as Record<string, any>) ||\n (tool.schema != null &&\n typeof tool.schema === \"object\" &&\n \"type\" in tool.schema &&\n typeof tool.schema.type === \"string\" &&\n [\"null\", \"boolean\", \"object\", \"array\", \"number\", \"string\"].includes(\n tool.schema.type\n )))\n );\n}\n\n/**\n * Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.\n * It returns `is StructuredToolParams` since that is the most minimal interface of the three,\n * while still containing the necessary properties to be passed to a LLM for tool calling.\n *\n * @param {unknown | undefined} tool The tool to check if it is a LangChain tool.\n * @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.\n */\nexport function isLangChainTool(tool?: unknown): tool is StructuredToolParams {\n return (\n isStructuredToolParams(tool) ||\n isRunnableToolLike(tool) ||\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n isStructuredTool(tool as any)\n );\n}\n\n/**\n * Runtime context automatically injected into tools.\n *\n * When a tool function has a parameter named `tool_runtime` with type hint\n * `ToolRuntime`, the tool execution system will automatically inject an instance\n * containing:\n *\n * - `state`: The current graph state\n * - `toolCallId`: The ID of the current tool call\n * - `config`: `RunnableConfig` for the current execution\n * - `context`: Runtime context\n * - `store`: `BaseStore` instance for persistent storage\n * - `writer`: Stream writer for streaming output\n *\n * No `Annotated` wrapper is needed - just use `runtime: ToolRuntime`\n * as a parameter.\n *\n * @example\n * ```typescript\n * import { tool, type ToolRuntime } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const stateSchema = z.object({\n * messages: z.array(z.any()),\n * userId: z.string().optional(),\n * });\n *\n * const greet = tool(\n * async ({ name }, runtime: ToolRuntime<typeof stateSchema>) => {\n * // Access state\n * const messages = runtime.state.messages;\n *\n * // Access tool_call_id\n * console.log(`Tool call ID: ${runtime.toolCallId}`);\n *\n * // Access config\n * console.log(`Run ID: ${runtime.config.runId}`);\n *\n * // Access runtime context\n * const userId = runtime.context?.userId;\n *\n * // Access store\n * await runtime.store?.mset([[\"key\", \"value\"]]);\n *\n * // Stream output\n * runtime.writer?.(\"Processing...\");\n *\n * return `Hello! User ID: ${runtime.state.userId || \"unknown\"} ${name}`;\n * },\n * {\n * name: \"greet\",\n * description: \"Use this to greet the user once you found their info.\",\n * schema: z.object({ name: z.string() }),\n * stateSchema,\n * }\n * );\n *\n * const agent = createAgent({\n * model,\n * tools: [greet],\n * stateSchema,\n * contextSchema,\n * });\n * ```\n *\n * @template StateT - The type of the state schema (inferred from stateSchema)\n * @template ContextT - The type of the context schema (inferred from contextSchema)\n */\nexport type ToolRuntime<\n TState = unknown,\n TContext = unknown,\n> = RunnableConfig & {\n /**\n * The current graph state.\n */\n state: TState extends InteropZodObject\n ? InferInteropZodOutput<TState>\n : TState extends Record<string, unknown>\n ? TState\n : unknown;\n /**\n * The ID of the current tool call.\n */\n toolCallId: string;\n /**\n * The current tool call.\n */\n toolCall?: ToolCall;\n /**\n * RunnableConfig for the current execution.\n */\n config: ToolRunnableConfig;\n /**\n * Runtime context (from langgraph `Runtime`).\n */\n context: TContext extends InteropZodObject\n ? InferInteropZodOutput<TContext>\n : TContext extends Record<string, unknown>\n ? TContext\n : unknown;\n /**\n * BaseStore instance for persistent storage (from langgraph `Runtime`).\n */\n store: BaseStore<string, unknown> | null;\n /**\n * Stream writer for streaming output (from langgraph `Runtime`).\n */\n writer: ((chunk: unknown) => void) | null;\n};\n"],"mappings":";;;;;;;;;AAoZA,SAAgB,iBACd,MACiC;AACjC,QACE,SAAS,KAAA,KACT,MAAM,QAAS,KAAiC,aAAa;;;;;;;;AAUjE,SAAgB,mBAAmB,MAA0C;AAC3E,QACE,SAAS,KAAA,KACT,SAAS,WAAW,KAAK,IACzB,aAAa,KAAK,eAClB,OAAO,KAAK,YAAY,YAAY,cACpC,KAAK,YAAY,SAAS,KAAK;;;;;;;;AAUnC,SAAgB,uBACd,MAC8B;AAC9B,QACE,CAAC,CAAC,QACF,OAAO,SAAS,YAChB,UAAU,QACV,YAAY,SAEX,mBAAmB,KAAK,OAA8B,IACpD,KAAK,UAAU,QACd,OAAO,KAAK,WAAW,YACvB,UAAU,KAAK,UACf,OAAO,KAAK,OAAO,SAAS,YAC5B;EAAC;EAAQ;EAAW;EAAU;EAAS;EAAU;EAAS,CAAC,SACzD,KAAK,OAAO,KACb;;;;;;;;;;AAYT,SAAgB,gBAAgB,MAA8C;AAC5E,QACE,uBAAuB,KAAK,IAC5B,mBAAmB,KAAK,IAExB,iBAAiB,KAAY"}
|
package/dist/tools/utils.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/tools/utils.ts
|
|
3
2
|
function _isToolCall(toolCall) {
|
|
4
3
|
return !!(toolCall && typeof toolCall === "object" && "type" in toolCall && toolCall.type === "tool_call");
|
|
@@ -18,9 +17,9 @@ var ToolInputParsingException = class extends Error {
|
|
|
18
17
|
this.output = output;
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
exports.ToolInputParsingException = ToolInputParsingException;
|
|
24
22
|
exports._configHasToolCallId = _configHasToolCallId;
|
|
25
23
|
exports._isToolCall = _isToolCall;
|
|
24
|
+
|
|
26
25
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tools/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","names":[
|
|
1
|
+
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/tools/utils.ts"],"sourcesContent":["import { ToolCall } from \"../messages/tool.js\";\n\nexport function _isToolCall(toolCall?: unknown): toolCall is ToolCall {\n return !!(\n toolCall &&\n typeof toolCall === \"object\" &&\n \"type\" in toolCall &&\n toolCall.type === \"tool_call\"\n );\n}\n\nexport function _configHasToolCallId(\n config?: unknown\n): config is { toolCall: { id?: string } } {\n return !!(\n config &&\n typeof config === \"object\" &&\n \"toolCall\" in config &&\n config.toolCall != null &&\n typeof config.toolCall === \"object\" &&\n \"id\" in config.toolCall &&\n typeof config.toolCall.id === \"string\"\n );\n}\n/**\n * Custom error class used to handle exceptions related to tool input parsing.\n * It extends the built-in `Error` class and adds an optional `output`\n * property that can hold the output that caused the exception.\n */\nexport class ToolInputParsingException extends Error {\n output?: string;\n\n constructor(message: string, output?: string) {\n super(message);\n this.output = output;\n }\n}\n"],"mappings":";AAEA,SAAgB,YAAY,UAA0C;AACpE,QAAO,CAAC,EACN,YACA,OAAO,aAAa,YACpB,UAAU,YACV,SAAS,SAAS;;AAItB,SAAgB,qBACd,QACyC;AACzC,QAAO,CAAC,EACN,UACA,OAAO,WAAW,YAClB,cAAc,UACd,OAAO,YAAY,QACnB,OAAO,OAAO,aAAa,YAC3B,QAAQ,OAAO,YACf,OAAO,OAAO,SAAS,OAAO;;;;;;;AAQlC,IAAa,4BAAb,cAA+C,MAAM;CACnD;CAEA,YAAY,SAAiB,QAAiB;AAC5C,QAAM,QAAQ;AACd,OAAK,SAAS"}
|
package/dist/tools/utils.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/tools/utils.ts"],"mappings":";;;;;;cA6Ba,yBAAA,SAAkC,KAAA;EAC7C,MAAA;EAEA,WAAA,CAAY,OAAA,UAAiB,MAAA;AAAA"}
|
package/dist/tools/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/tools/utils.ts"],"mappings":";;;;;;cA6Ba,yBAAA,SAAkC,KAAA;EAC7C,MAAA;EAEA,WAAA,CAAY,OAAA,UAAiB,MAAA;AAAA"}
|
package/dist/tools/utils.js
CHANGED
package/dist/tools/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/tools/utils.ts"],"sourcesContent":["import { ToolCall } from \"../messages/tool.js\";\n\nexport function _isToolCall(toolCall?: unknown): toolCall is ToolCall {\n return !!(\n toolCall &&\n typeof toolCall === \"object\" &&\n \"type\" in toolCall &&\n toolCall.type === \"tool_call\"\n );\n}\n\nexport function _configHasToolCallId(\n config?: unknown\n): config is { toolCall: { id?: string } } {\n return !!(\n config &&\n typeof config === \"object\" &&\n \"toolCall\" in config &&\n config.toolCall != null &&\n typeof config.toolCall === \"object\" &&\n \"id\" in config.toolCall &&\n typeof config.toolCall.id === \"string\"\n );\n}\n/**\n * Custom error class used to handle exceptions related to tool input parsing.\n * It extends the built-in `Error` class and adds an optional `output`\n * property that can hold the output that caused the exception.\n */\nexport class ToolInputParsingException extends Error {\n output?: string;\n\n constructor(message: string, output?: string) {\n super(message);\n this.output = output;\n }\n}\n"],"mappings":";AAEA,SAAgB,YAAY,UAA0C;AACpE,QAAO,CAAC,EACN,YACA,OAAO,aAAa,YACpB,UAAU,YACV,SAAS,SAAS;;AAItB,SAAgB,qBACd,QACyC;AACzC,QAAO,CAAC,EACN,UACA,OAAO,WAAW,YAClB,cAAc,UACd,OAAO,YAAY,QACnB,OAAO,OAAO,aAAa,YAC3B,QAAQ,OAAO,YACf,OAAO,OAAO,SAAS,OAAO;;;;;;;AAQlC,IAAa,4BAAb,cAA+C,MAAM;CACnD;CAEA,YAAY,SAAiB,QAAiB;AAC5C,QAAM,QAAQ;AACd,OAAK,SAAS"}
|