@langchain/core 1.2.14 → 1.2.16
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 +12 -0
- package/dist/agents.d.cts +3 -4
- package/dist/agents.d.cts.map +1 -1
- package/dist/agents.d.ts +3 -4
- package/dist/agents.d.ts.map +1 -1
- package/dist/caches/index.d.cts +5 -6
- package/dist/caches/index.d.cts.map +1 -1
- package/dist/caches/index.d.ts +5 -6
- package/dist/caches/index.d.ts.map +1 -1
- package/dist/callbacks/base.d.cts +10 -11
- package/dist/callbacks/base.d.cts.map +1 -1
- package/dist/callbacks/base.d.ts +10 -11
- package/dist/callbacks/base.d.ts.map +1 -1
- package/dist/callbacks/dispatch/index.d.cts +1 -2
- package/dist/callbacks/dispatch/index.d.cts.map +1 -1
- package/dist/callbacks/dispatch/index.d.ts +1 -2
- package/dist/callbacks/dispatch/index.d.ts.map +1 -1
- package/dist/callbacks/dispatch/web.d.cts +1 -2
- package/dist/callbacks/dispatch/web.d.cts.map +1 -1
- package/dist/callbacks/dispatch/web.d.ts +1 -2
- package/dist/callbacks/dispatch/web.d.ts.map +1 -1
- package/dist/callbacks/manager.cjs +1 -1
- package/dist/callbacks/manager.cjs.map +1 -1
- package/dist/callbacks/manager.d.cts +12 -13
- package/dist/callbacks/manager.d.cts.map +1 -1
- package/dist/callbacks/manager.d.ts +12 -13
- package/dist/callbacks/manager.d.ts.map +1 -1
- package/dist/callbacks/manager.js +1 -1
- package/dist/callbacks/manager.js.map +1 -1
- package/dist/chat_history.d.cts +3 -4
- package/dist/chat_history.d.cts.map +1 -1
- package/dist/chat_history.d.ts +3 -4
- package/dist/chat_history.d.ts.map +1 -1
- package/dist/context.d.cts +2 -2
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.ts +2 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/document_loaders/base.d.cts +2 -3
- package/dist/document_loaders/base.d.cts.map +1 -1
- package/dist/document_loaders/base.d.ts +2 -3
- package/dist/document_loaders/base.d.ts.map +1 -1
- package/dist/document_loaders/langsmith.d.cts +2 -3
- package/dist/document_loaders/langsmith.d.cts.map +1 -1
- package/dist/document_loaders/langsmith.d.ts +2 -3
- package/dist/document_loaders/langsmith.d.ts.map +1 -1
- package/dist/documents/document.d.cts +3 -4
- package/dist/documents/document.d.cts.map +1 -1
- package/dist/documents/document.d.ts +3 -4
- package/dist/documents/document.d.ts.map +1 -1
- package/dist/documents/transformers.d.cts +2 -3
- package/dist/documents/transformers.d.cts.map +1 -1
- package/dist/documents/transformers.d.ts +2 -3
- package/dist/documents/transformers.d.ts.map +1 -1
- package/dist/embeddings.d.cts +3 -4
- package/dist/embeddings.d.cts.map +1 -1
- package/dist/embeddings.d.ts +3 -4
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +13 -19
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +13 -19
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/example_selectors/base.d.cts +1 -2
- package/dist/example_selectors/base.d.cts.map +1 -1
- package/dist/example_selectors/base.d.ts +1 -2
- package/dist/example_selectors/base.d.ts.map +1 -1
- package/dist/example_selectors/conditional.d.cts +5 -6
- package/dist/example_selectors/conditional.d.cts.map +1 -1
- package/dist/example_selectors/conditional.d.ts +5 -6
- package/dist/example_selectors/conditional.d.ts.map +1 -1
- package/dist/example_selectors/length_based.d.cts +2 -3
- package/dist/example_selectors/length_based.d.cts.map +1 -1
- package/dist/example_selectors/length_based.d.ts +2 -3
- package/dist/example_selectors/length_based.d.ts.map +1 -1
- package/dist/example_selectors/semantic_similarity.d.cts +2 -3
- package/dist/example_selectors/semantic_similarity.d.cts.map +1 -1
- package/dist/example_selectors/semantic_similarity.d.ts +2 -3
- package/dist/example_selectors/semantic_similarity.d.ts.map +1 -1
- package/dist/indexing/base.d.cts +9 -10
- package/dist/indexing/base.d.cts.map +1 -1
- package/dist/indexing/base.d.ts +9 -10
- package/dist/indexing/base.d.ts.map +1 -1
- package/dist/indexing/record_manager.d.cts +5 -6
- package/dist/indexing/record_manager.d.cts.map +1 -1
- package/dist/indexing/record_manager.d.ts +5 -6
- package/dist/indexing/record_manager.d.ts.map +1 -1
- package/dist/language_models/base.cjs +1 -1
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +24 -25
- package/dist/language_models/base.d.cts.map +1 -1
- package/dist/language_models/base.d.ts +24 -25
- package/dist/language_models/base.d.ts.map +1 -1
- package/dist/language_models/base.js +1 -1
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.d.cts +9 -10
- package/dist/language_models/chat_models.d.cts.map +1 -1
- package/dist/language_models/chat_models.d.ts +9 -10
- package/dist/language_models/chat_models.d.ts.map +1 -1
- package/dist/language_models/compat.d.cts +2 -3
- package/dist/language_models/compat.d.cts.map +1 -1
- package/dist/language_models/compat.d.ts +2 -3
- package/dist/language_models/compat.d.ts.map +1 -1
- package/dist/language_models/event.d.cts +15 -16
- package/dist/language_models/event.d.cts.map +1 -1
- package/dist/language_models/event.d.ts +15 -16
- package/dist/language_models/event.d.ts.map +1 -1
- package/dist/language_models/llms.d.cts +5 -6
- package/dist/language_models/llms.d.cts.map +1 -1
- package/dist/language_models/llms.d.ts +5 -6
- package/dist/language_models/llms.d.ts.map +1 -1
- package/dist/language_models/openai_completions_stream.d.cts +8 -9
- package/dist/language_models/openai_completions_stream.d.cts.map +1 -1
- package/dist/language_models/openai_completions_stream.d.ts +8 -9
- package/dist/language_models/openai_completions_stream.d.ts.map +1 -1
- package/dist/language_models/profile.d.cts +1 -2
- package/dist/language_models/profile.d.cts.map +1 -1
- package/dist/language_models/profile.d.ts +1 -2
- package/dist/language_models/profile.d.ts.map +1 -1
- package/dist/language_models/stream.d.cts +5 -6
- package/dist/language_models/stream.d.cts.map +1 -1
- package/dist/language_models/stream.d.ts +5 -6
- package/dist/language_models/stream.d.ts.map +1 -1
- package/dist/language_models/structured_output.d.cts +3 -4
- package/dist/language_models/structured_output.d.cts.map +1 -1
- package/dist/language_models/structured_output.d.ts +3 -4
- package/dist/language_models/structured_output.d.ts.map +1 -1
- package/dist/load/import_type.d.cts +2 -3
- package/dist/load/import_type.d.cts.map +1 -1
- package/dist/load/import_type.d.ts +2 -3
- package/dist/load/import_type.d.ts.map +1 -1
- package/dist/load/index.d.cts +2 -3
- package/dist/load/index.d.cts.map +1 -1
- package/dist/load/index.d.ts +2 -3
- package/dist/load/index.d.ts.map +1 -1
- package/dist/load/map_keys.d.cts +1 -2
- package/dist/load/map_keys.d.cts.map +1 -1
- package/dist/load/map_keys.d.ts +1 -2
- package/dist/load/map_keys.d.ts.map +1 -1
- package/dist/load/serializable.d.cts +9 -10
- package/dist/load/serializable.d.cts.map +1 -1
- package/dist/load/serializable.d.ts +9 -10
- package/dist/load/serializable.d.ts.map +1 -1
- package/dist/memory.d.cts +7 -8
- package/dist/memory.d.cts.map +1 -1
- package/dist/memory.d.ts +7 -8
- package/dist/memory.d.ts.map +1 -1
- package/dist/messages/ai.d.cts +6 -7
- package/dist/messages/ai.d.cts.map +1 -1
- package/dist/messages/ai.d.ts +6 -7
- package/dist/messages/ai.d.ts.map +1 -1
- package/dist/messages/base.d.cts +23 -24
- package/dist/messages/base.d.cts.map +1 -1
- package/dist/messages/base.d.ts +23 -24
- package/dist/messages/base.d.ts.map +1 -1
- package/dist/messages/chat.d.cts +5 -6
- package/dist/messages/chat.d.cts.map +1 -1
- package/dist/messages/chat.d.ts +5 -6
- package/dist/messages/chat.d.ts.map +1 -1
- package/dist/messages/content/base.d.cts +1 -2
- package/dist/messages/content/base.d.cts.map +1 -1
- package/dist/messages/content/base.d.ts +1 -2
- package/dist/messages/content/base.d.ts.map +1 -1
- package/dist/messages/content/data.d.cts +18 -19
- package/dist/messages/content/data.d.cts.map +1 -1
- package/dist/messages/content/data.d.ts +18 -19
- package/dist/messages/content/data.d.ts.map +1 -1
- package/dist/messages/content/index.d.cts +4 -5
- package/dist/messages/content/index.d.cts.map +1 -1
- package/dist/messages/content/index.d.ts +4 -5
- package/dist/messages/content/index.d.ts.map +1 -1
- package/dist/messages/content/multimodal.d.cts +2 -3
- package/dist/messages/content/multimodal.d.cts.map +1 -1
- package/dist/messages/content/multimodal.d.ts +2 -3
- package/dist/messages/content/multimodal.d.ts.map +1 -1
- package/dist/messages/content/tools.d.cts +2 -3
- package/dist/messages/content/tools.d.cts.map +1 -1
- package/dist/messages/content/tools.d.ts +2 -3
- package/dist/messages/content/tools.d.ts.map +1 -1
- package/dist/messages/format.d.cts +1 -2
- package/dist/messages/format.d.cts.map +1 -1
- package/dist/messages/format.d.ts +1 -2
- package/dist/messages/format.d.ts.map +1 -1
- package/dist/messages/function.d.cts +5 -6
- package/dist/messages/function.d.cts.map +1 -1
- package/dist/messages/function.d.ts +5 -6
- package/dist/messages/function.d.ts.map +1 -1
- package/dist/messages/human.d.cts +5 -6
- package/dist/messages/human.d.cts.map +1 -1
- package/dist/messages/human.d.ts +5 -6
- package/dist/messages/human.d.ts.map +1 -1
- package/dist/messages/message.d.cts +20 -21
- package/dist/messages/message.d.cts.map +1 -1
- package/dist/messages/message.d.ts +20 -21
- package/dist/messages/message.d.ts.map +1 -1
- package/dist/messages/metadata.d.cts +7 -8
- package/dist/messages/metadata.d.cts.map +1 -1
- package/dist/messages/metadata.d.ts +7 -8
- package/dist/messages/metadata.d.ts.map +1 -1
- package/dist/messages/modifier.d.cts +2 -3
- package/dist/messages/modifier.d.cts.map +1 -1
- package/dist/messages/modifier.d.ts +2 -3
- package/dist/messages/modifier.d.ts.map +1 -1
- package/dist/messages/system.d.cts +5 -6
- package/dist/messages/system.d.cts.map +1 -1
- package/dist/messages/system.d.ts +5 -6
- package/dist/messages/system.d.ts.map +1 -1
- package/dist/messages/tool.d.cts +11 -12
- package/dist/messages/tool.d.cts.map +1 -1
- package/dist/messages/tool.d.ts +11 -12
- package/dist/messages/tool.d.ts.map +1 -1
- package/dist/messages/transformers.d.cts +12 -13
- package/dist/messages/transformers.d.cts.map +1 -1
- package/dist/messages/transformers.d.ts +12 -13
- package/dist/messages/transformers.d.ts.map +1 -1
- package/dist/messages/utils.d.cts +13 -14
- package/dist/messages/utils.d.cts.map +1 -1
- package/dist/messages/utils.d.ts +13 -14
- package/dist/messages/utils.d.ts.map +1 -1
- package/dist/output_parsers/base.d.cts +4 -5
- package/dist/output_parsers/base.d.cts.map +1 -1
- package/dist/output_parsers/base.d.ts +4 -5
- package/dist/output_parsers/base.d.ts.map +1 -1
- package/dist/output_parsers/bytes.d.cts +1 -2
- package/dist/output_parsers/bytes.d.cts.map +1 -1
- package/dist/output_parsers/bytes.d.ts +1 -2
- package/dist/output_parsers/bytes.d.ts.map +1 -1
- package/dist/output_parsers/json.d.cts +2 -2
- package/dist/output_parsers/json.d.cts.map +1 -1
- package/dist/output_parsers/json.d.ts +2 -2
- package/dist/output_parsers/json.d.ts.map +1 -1
- package/dist/output_parsers/list.d.cts +5 -6
- package/dist/output_parsers/list.d.cts.map +1 -1
- package/dist/output_parsers/list.d.ts +5 -6
- package/dist/output_parsers/list.d.ts.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +4 -5
- 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 +4 -5
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +12 -13
- 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 +12 -13
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +1 -1
- package/dist/output_parsers/standard_schema.d.cts +1 -2
- package/dist/output_parsers/standard_schema.d.cts.map +1 -1
- package/dist/output_parsers/standard_schema.d.ts +1 -2
- package/dist/output_parsers/standard_schema.d.ts.map +1 -1
- package/dist/output_parsers/string.d.cts +1 -2
- package/dist/output_parsers/string.d.cts.map +1 -1
- package/dist/output_parsers/string.d.ts +1 -2
- package/dist/output_parsers/string.d.ts.map +1 -1
- package/dist/output_parsers/structured.d.cts +6 -7
- package/dist/output_parsers/structured.d.cts.map +1 -1
- package/dist/output_parsers/structured.d.ts +6 -7
- package/dist/output_parsers/structured.d.ts.map +1 -1
- package/dist/output_parsers/transform.d.cts +3 -4
- package/dist/output_parsers/transform.d.cts.map +1 -1
- package/dist/output_parsers/transform.d.ts +3 -4
- package/dist/output_parsers/transform.d.ts.map +1 -1
- package/dist/output_parsers/xml.d.cts +6 -7
- package/dist/output_parsers/xml.d.cts.map +1 -1
- package/dist/output_parsers/xml.d.ts +6 -7
- package/dist/output_parsers/xml.d.ts.map +1 -1
- package/dist/outputs.d.cts +9 -10
- package/dist/outputs.d.cts.map +1 -1
- package/dist/outputs.d.ts +9 -10
- package/dist/outputs.d.ts.map +1 -1
- package/dist/prompt_values.d.cts +10 -11
- package/dist/prompt_values.d.cts.map +1 -1
- package/dist/prompt_values.d.ts +10 -11
- package/dist/prompt_values.d.ts.map +1 -1
- package/dist/prompts/base.d.cts +4 -5
- package/dist/prompts/base.d.cts.map +1 -1
- package/dist/prompts/base.d.ts +4 -5
- package/dist/prompts/base.d.ts.map +1 -1
- package/dist/prompts/chat.d.cts +14 -15
- package/dist/prompts/chat.d.cts.map +1 -1
- package/dist/prompts/chat.d.ts +14 -15
- package/dist/prompts/chat.d.ts.map +1 -1
- package/dist/prompts/dict.d.cts +1 -2
- package/dist/prompts/dict.d.cts.map +1 -1
- package/dist/prompts/dict.d.ts +1 -2
- package/dist/prompts/dict.d.ts.map +1 -1
- package/dist/prompts/few_shot.d.cts +4 -5
- package/dist/prompts/few_shot.d.cts.map +1 -1
- package/dist/prompts/few_shot.d.ts +4 -5
- package/dist/prompts/few_shot.d.ts.map +1 -1
- package/dist/prompts/image.d.cts +2 -3
- package/dist/prompts/image.d.cts.map +1 -1
- package/dist/prompts/image.d.ts +2 -3
- package/dist/prompts/image.d.ts.map +1 -1
- package/dist/prompts/pipeline.d.cts +3 -4
- package/dist/prompts/pipeline.d.cts.map +1 -1
- package/dist/prompts/pipeline.d.ts +3 -4
- package/dist/prompts/pipeline.d.ts.map +1 -1
- package/dist/prompts/prompt.d.cts +4 -5
- package/dist/prompts/prompt.d.cts.map +1 -1
- package/dist/prompts/prompt.d.ts +4 -5
- package/dist/prompts/prompt.d.ts.map +1 -1
- package/dist/prompts/serde.d.cts +3 -4
- package/dist/prompts/serde.d.cts.map +1 -1
- package/dist/prompts/serde.d.ts +3 -4
- package/dist/prompts/serde.d.ts.map +1 -1
- package/dist/prompts/string.d.cts +1 -2
- package/dist/prompts/string.d.cts.map +1 -1
- package/dist/prompts/string.d.ts +1 -2
- package/dist/prompts/string.d.ts.map +1 -1
- package/dist/prompts/structured.d.cts +2 -3
- package/dist/prompts/structured.d.cts.map +1 -1
- package/dist/prompts/structured.d.ts +2 -3
- package/dist/prompts/structured.d.ts.map +1 -1
- package/dist/prompts/template.d.cts +12 -13
- package/dist/prompts/template.d.cts.map +1 -1
- package/dist/prompts/template.d.ts +12 -13
- package/dist/prompts/template.d.ts.map +1 -1
- package/dist/retrievers/document_compressors/index.d.cts +1 -2
- package/dist/retrievers/document_compressors/index.d.cts.map +1 -1
- package/dist/retrievers/document_compressors/index.d.ts +1 -2
- package/dist/retrievers/document_compressors/index.d.ts.map +1 -1
- package/dist/retrievers/index.d.cts +3 -4
- package/dist/retrievers/index.d.cts.map +1 -1
- package/dist/retrievers/index.d.ts +3 -4
- package/dist/retrievers/index.d.ts.map +1 -1
- package/dist/runnables/base.d.cts +23 -23
- package/dist/runnables/base.d.cts.map +1 -1
- package/dist/runnables/base.d.ts +23 -23
- package/dist/runnables/base.d.ts.map +1 -1
- package/dist/runnables/branch.d.cts +3 -4
- package/dist/runnables/branch.d.cts.map +1 -1
- package/dist/runnables/branch.d.ts +3 -4
- package/dist/runnables/branch.d.ts.map +1 -1
- package/dist/runnables/config.d.cts +6 -6
- package/dist/runnables/config.d.cts.map +1 -1
- package/dist/runnables/config.d.ts +6 -6
- package/dist/runnables/config.d.ts.map +1 -1
- package/dist/runnables/graph.d.cts +2 -2
- package/dist/runnables/graph.d.cts.map +1 -1
- package/dist/runnables/graph.d.ts +2 -2
- package/dist/runnables/graph.d.ts.map +1 -1
- package/dist/runnables/history.d.cts +2 -3
- package/dist/runnables/history.d.cts.map +1 -1
- package/dist/runnables/history.d.ts +2 -3
- package/dist/runnables/history.d.ts.map +1 -1
- package/dist/runnables/passthrough.d.cts +1 -2
- package/dist/runnables/passthrough.d.cts.map +1 -1
- package/dist/runnables/passthrough.d.ts +1 -2
- package/dist/runnables/passthrough.d.ts.map +1 -1
- package/dist/runnables/router.d.cts +2 -3
- package/dist/runnables/router.d.cts.map +1 -1
- package/dist/runnables/router.d.ts +2 -3
- package/dist/runnables/router.d.ts.map +1 -1
- package/dist/runnables/types.d.cts +6 -7
- package/dist/runnables/types.d.cts.map +1 -1
- package/dist/runnables/types.d.ts +6 -7
- package/dist/runnables/types.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/context.d.cts +4 -5
- package/dist/singletons/async_local_storage/context.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/context.d.ts +4 -5
- package/dist/singletons/async_local_storage/context.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/globals.d.cts +2 -3
- package/dist/singletons/async_local_storage/globals.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/globals.d.ts +2 -3
- package/dist/singletons/async_local_storage/globals.d.ts.map +1 -1
- package/dist/singletons/async_local_storage/index.d.cts +2 -2
- package/dist/singletons/async_local_storage/index.d.cts.map +1 -1
- package/dist/singletons/async_local_storage/index.d.ts +2 -2
- package/dist/singletons/async_local_storage/index.d.ts.map +1 -1
- package/dist/singletons/callbacks.d.cts +2 -3
- package/dist/singletons/callbacks.d.cts.map +1 -1
- package/dist/singletons/callbacks.d.ts +2 -3
- package/dist/singletons/callbacks.d.ts.map +1 -1
- package/dist/stores.d.cts +2 -3
- package/dist/stores.d.cts.map +1 -1
- package/dist/stores.d.ts +2 -3
- package/dist/stores.d.ts.map +1 -1
- package/dist/structured_query/base.d.cts +3 -4
- package/dist/structured_query/base.d.cts.map +1 -1
- package/dist/structured_query/base.d.ts +3 -4
- package/dist/structured_query/base.d.ts.map +1 -1
- package/dist/structured_query/functional.d.cts +2 -3
- package/dist/structured_query/functional.d.cts.map +1 -1
- package/dist/structured_query/functional.d.ts +2 -3
- package/dist/structured_query/functional.d.ts.map +1 -1
- package/dist/structured_query/ir.d.cts +23 -24
- package/dist/structured_query/ir.d.cts.map +1 -1
- package/dist/structured_query/ir.d.ts +23 -24
- package/dist/structured_query/ir.d.ts.map +1 -1
- package/dist/structured_query/utils.d.cts +7 -8
- package/dist/structured_query/utils.d.cts.map +1 -1
- package/dist/structured_query/utils.d.ts +7 -8
- package/dist/structured_query/utils.d.ts.map +1 -1
- package/dist/testing/fake_model_builder.d.cts +2 -3
- package/dist/testing/fake_model_builder.d.cts.map +1 -1
- package/dist/testing/fake_model_builder.d.ts +2 -3
- package/dist/testing/fake_model_builder.d.ts.map +1 -1
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/matchers.d.cts +12 -13
- package/dist/testing/matchers.d.cts.map +1 -1
- package/dist/testing/matchers.d.ts +12 -13
- package/dist/testing/matchers.d.ts.map +1 -1
- package/dist/testing/vitest-expect.d.cts +8 -0
- package/dist/testing/vitest-expect.d.cts.map +1 -0
- package/dist/testing/vitest-expect.d.ts +8 -0
- package/dist/testing/vitest-expect.d.ts.map +1 -0
- package/dist/tools/index.d.cts +21 -21
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +21 -21
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/types.d.cts +25 -26
- package/dist/tools/types.d.cts.map +1 -1
- package/dist/tools/types.d.ts +25 -26
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/utils.d.cts +1 -2
- package/dist/tools/utils.d.cts.map +1 -1
- package/dist/tools/utils.d.ts +1 -2
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tracers/base.cjs +7 -4
- package/dist/tracers/base.cjs.map +1 -1
- package/dist/tracers/base.d.cts +7 -8
- package/dist/tracers/base.d.cts.map +1 -1
- package/dist/tracers/base.d.ts +7 -8
- package/dist/tracers/base.d.ts.map +1 -1
- package/dist/tracers/base.js +7 -4
- package/dist/tracers/base.js.map +1 -1
- package/dist/tracers/console.d.cts +1 -2
- package/dist/tracers/console.d.cts.map +1 -1
- package/dist/tracers/console.d.ts +1 -2
- package/dist/tracers/console.d.ts.map +1 -1
- package/dist/tracers/event_stream.d.cts +3 -4
- package/dist/tracers/event_stream.d.cts.map +1 -1
- package/dist/tracers/event_stream.d.ts +3 -4
- package/dist/tracers/event_stream.d.ts.map +1 -1
- package/dist/tracers/log_stream.d.cts +9 -9
- package/dist/tracers/log_stream.d.cts.map +1 -1
- package/dist/tracers/log_stream.d.ts +9 -9
- package/dist/tracers/log_stream.d.ts.map +1 -1
- package/dist/tracers/run_collector.d.cts +1 -2
- package/dist/tracers/run_collector.d.cts.map +1 -1
- package/dist/tracers/run_collector.d.ts +1 -2
- package/dist/tracers/run_collector.d.ts.map +1 -1
- package/dist/tracers/tracer_langchain.d.cts +6 -7
- package/dist/tracers/tracer_langchain.d.cts.map +1 -1
- package/dist/tracers/tracer_langchain.d.ts +6 -7
- package/dist/tracers/tracer_langchain.d.ts.map +1 -1
- package/dist/types/_internal.d.cts +1 -2
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.ts +1 -2
- package/dist/types/_internal.d.ts.map +1 -1
- package/dist/types/type-utils.d.cts +2 -3
- package/dist/types/type-utils.d.cts.map +1 -1
- package/dist/types/type-utils.d.ts +2 -3
- package/dist/types/type-utils.d.ts.map +1 -1
- package/dist/utils/async_caller.d.cts +6 -7
- package/dist/utils/async_caller.d.cts.map +1 -1
- package/dist/utils/async_caller.d.ts +6 -7
- package/dist/utils/async_caller.d.ts.map +1 -1
- package/dist/utils/chunk_array.d.cts +1 -2
- package/dist/utils/chunk_array.d.cts.map +1 -1
- package/dist/utils/chunk_array.d.ts +1 -2
- package/dist/utils/chunk_array.d.ts.map +1 -1
- package/dist/utils/context.d.cts +1 -2
- package/dist/utils/context.d.cts.map +1 -1
- package/dist/utils/context.d.ts +1 -2
- package/dist/utils/context.d.ts.map +1 -1
- package/dist/utils/env.d.cts +9 -10
- package/dist/utils/env.d.cts.map +1 -1
- package/dist/utils/env.d.ts +9 -10
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/event_source_parse.d.cts +6 -7
- package/dist/utils/event_source_parse.d.cts.map +1 -1
- package/dist/utils/event_source_parse.d.ts +6 -7
- package/dist/utils/event_source_parse.d.ts.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.cts +13 -14
- package/dist/utils/fast-json-patch/src/core.d.cts.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.ts +13 -14
- package/dist/utils/fast-json-patch/src/core.d.ts.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.d.cts +1 -2
- package/dist/utils/fast-json-patch/src/duplex.d.cts.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.d.ts +1 -2
- package/dist/utils/fast-json-patch/src/duplex.d.ts.map +1 -1
- package/dist/utils/format.d.cts +2 -3
- package/dist/utils/format.d.cts.map +1 -1
- package/dist/utils/format.d.ts +2 -3
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/function_calling.d.cts +3 -3
- package/dist/utils/function_calling.d.cts.map +1 -1
- package/dist/utils/function_calling.d.ts +3 -3
- package/dist/utils/function_calling.d.ts.map +1 -1
- package/dist/utils/gateway.d.cts +4 -5
- package/dist/utils/gateway.d.cts.map +1 -1
- package/dist/utils/gateway.d.ts +4 -5
- package/dist/utils/gateway.d.ts.map +1 -1
- package/dist/utils/hash.d.cts +2 -2
- package/dist/utils/hash.d.cts.map +1 -1
- package/dist/utils/hash.d.ts +2 -2
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/js-sha256/hash.cjs +2 -2
- package/dist/utils/js-sha256/hash.cjs.map +1 -1
- package/dist/utils/js-sha256/hash.d.cts +1 -2
- package/dist/utils/js-sha256/hash.d.cts.map +1 -1
- package/dist/utils/js-sha256/hash.d.ts +1 -2
- package/dist/utils/js-sha256/hash.d.ts.map +1 -1
- package/dist/utils/js-sha256/hash.js +2 -2
- package/dist/utils/js-sha256/hash.js.map +1 -1
- package/dist/utils/json.d.cts +2 -3
- package/dist/utils/json.d.cts.map +1 -1
- package/dist/utils/json.d.ts +2 -3
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json_schema.d.cts +4 -4
- package/dist/utils/json_schema.d.cts.map +1 -1
- package/dist/utils/json_schema.d.ts +4 -4
- package/dist/utils/json_schema.d.ts.map +1 -1
- package/dist/utils/math.d.cts +6 -7
- package/dist/utils/math.d.cts.map +1 -1
- package/dist/utils/math.d.ts +6 -7
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/ml-distance/similarities.d.cts +1 -2
- package/dist/utils/ml-distance/similarities.d.cts.map +1 -1
- package/dist/utils/ml-distance/similarities.d.ts +1 -2
- package/dist/utils/ml-distance/similarities.d.ts.map +1 -1
- package/dist/utils/namespace.cjs.map +1 -1
- package/dist/utils/namespace.d.cts +2 -3
- package/dist/utils/namespace.d.cts.map +1 -1
- package/dist/utils/namespace.d.ts +2 -3
- package/dist/utils/namespace.d.ts.map +1 -1
- package/dist/utils/namespace.js.map +1 -1
- package/dist/utils/signal.d.cts +1 -2
- package/dist/utils/signal.d.cts.map +1 -1
- package/dist/utils/signal.d.ts +1 -2
- package/dist/utils/signal.d.ts.map +1 -1
- package/dist/utils/ssrf.d.cts +6 -7
- package/dist/utils/ssrf.d.cts.map +1 -1
- package/dist/utils/ssrf.d.ts +6 -7
- package/dist/utils/ssrf.d.ts.map +1 -1
- package/dist/utils/standard_schema.d.cts +4 -5
- package/dist/utils/standard_schema.d.cts.map +1 -1
- package/dist/utils/standard_schema.d.ts +4 -5
- package/dist/utils/standard_schema.d.ts.map +1 -1
- package/dist/utils/stream.d.cts +6 -6
- package/dist/utils/stream.d.cts.map +1 -1
- package/dist/utils/stream.d.ts +6 -6
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/testing/chat_models.d.cts +8 -9
- package/dist/utils/testing/chat_models.d.cts.map +1 -1
- package/dist/utils/testing/chat_models.d.ts +8 -9
- package/dist/utils/testing/chat_models.d.ts.map +1 -1
- package/dist/utils/testing/embeddings.d.cts +2 -3
- package/dist/utils/testing/embeddings.d.cts.map +1 -1
- package/dist/utils/testing/embeddings.d.ts +2 -3
- package/dist/utils/testing/embeddings.d.ts.map +1 -1
- package/dist/utils/testing/llms.d.cts +2 -3
- package/dist/utils/testing/llms.d.cts.map +1 -1
- package/dist/utils/testing/llms.d.ts +2 -3
- package/dist/utils/testing/llms.d.ts.map +1 -1
- package/dist/utils/testing/message_history.d.cts +3 -4
- package/dist/utils/testing/message_history.d.cts.map +1 -1
- package/dist/utils/testing/message_history.d.ts +3 -4
- package/dist/utils/testing/message_history.d.ts.map +1 -1
- package/dist/utils/testing/openai_stream_fixtures.d.cts +6 -7
- package/dist/utils/testing/openai_stream_fixtures.d.cts.map +1 -1
- package/dist/utils/testing/openai_stream_fixtures.d.ts +6 -7
- package/dist/utils/testing/openai_stream_fixtures.d.ts.map +1 -1
- package/dist/utils/testing/output_parsers.d.cts +1 -2
- package/dist/utils/testing/output_parsers.d.cts.map +1 -1
- package/dist/utils/testing/output_parsers.d.ts +1 -2
- package/dist/utils/testing/output_parsers.d.ts.map +1 -1
- package/dist/utils/testing/retrievers.d.cts +1 -2
- package/dist/utils/testing/retrievers.d.cts.map +1 -1
- package/dist/utils/testing/retrievers.d.ts +1 -2
- package/dist/utils/testing/retrievers.d.ts.map +1 -1
- package/dist/utils/testing/runnables.d.cts +1 -2
- package/dist/utils/testing/runnables.d.cts.map +1 -1
- package/dist/utils/testing/runnables.d.ts +1 -2
- package/dist/utils/testing/runnables.d.ts.map +1 -1
- package/dist/utils/testing/stream.d.cts +10 -11
- package/dist/utils/testing/stream.d.cts.map +1 -1
- package/dist/utils/testing/stream.d.ts +10 -11
- package/dist/utils/testing/stream.d.ts.map +1 -1
- package/dist/utils/testing/tools.d.cts +2 -3
- package/dist/utils/testing/tools.d.cts.map +1 -1
- package/dist/utils/testing/tools.d.ts +2 -3
- package/dist/utils/testing/tools.d.ts.map +1 -1
- package/dist/utils/testing/tracers.d.cts +1 -2
- package/dist/utils/testing/tracers.d.cts.map +1 -1
- package/dist/utils/testing/tracers.d.ts +1 -2
- package/dist/utils/testing/tracers.d.ts.map +1 -1
- package/dist/utils/testing/vectorstores.d.cts +2 -3
- package/dist/utils/testing/vectorstores.d.cts.map +1 -1
- package/dist/utils/testing/vectorstores.d.ts +2 -3
- package/dist/utils/testing/vectorstores.d.ts.map +1 -1
- package/dist/utils/tiktoken.d.cts +2 -3
- package/dist/utils/tiktoken.d.cts.map +1 -1
- package/dist/utils/tiktoken.d.ts +2 -3
- package/dist/utils/tiktoken.d.ts.map +1 -1
- package/dist/utils/types/index.d.cts +5 -5
- package/dist/utils/types/index.d.cts.map +1 -1
- package/dist/utils/types/index.d.ts +5 -5
- package/dist/utils/types/index.d.ts.map +1 -1
- package/dist/utils/types/zod.d.cts +62 -63
- package/dist/utils/types/zod.d.cts.map +1 -1
- package/dist/utils/types/zod.d.ts +62 -63
- package/dist/utils/types/zod.d.ts.map +1 -1
- package/dist/utils/uuid/index.d.cts +12 -12
- package/dist/utils/uuid/index.d.cts.map +1 -1
- package/dist/utils/uuid/index.d.ts +12 -12
- package/dist/utils/uuid/index.d.ts.map +1 -1
- package/dist/utils/uuid/types.d.cts +6 -7
- package/dist/utils/uuid/types.d.cts.map +1 -1
- package/dist/utils/uuid/types.d.ts +6 -7
- package/dist/utils/uuid/types.d.ts.map +1 -1
- package/dist/utils/uuid/v35.d.cts +2 -3
- package/dist/utils/uuid/v35.d.cts.map +1 -1
- package/dist/utils/uuid/v35.d.ts +2 -3
- package/dist/utils/uuid/v35.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts +1 -2
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts +1 -2
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.cts +2 -3
- package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +1 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.ts +2 -3
- package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.cts +1 -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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.cts +1 -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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.cts +1 -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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.cts +2 -3
- 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 +2 -3
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts +1 -2
- 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 +1 -2
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -1
- package/dist/vectorstores.d.cts +8 -9
- package/dist/vectorstores.d.cts.map +1 -1
- package/dist/vectorstores.d.ts +8 -9
- package/dist/vectorstores.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -23,20 +23,20 @@ interface ExpectationResult {
|
|
|
23
23
|
actual?: unknown;
|
|
24
24
|
expected?: unknown;
|
|
25
25
|
}
|
|
26
|
-
declare const toBeHumanMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
27
|
-
declare const toBeAIMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
28
|
-
declare const toBeSystemMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
29
|
-
declare const toBeToolMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
30
|
-
declare function toHaveToolCalls(this: ExpectExtendThis, received: unknown, expected: Array<Record<string, unknown>>): ExpectationResult;
|
|
31
|
-
declare function toHaveToolCallCount(this: ExpectExtendThis, received: unknown, expected: number): ExpectationResult;
|
|
32
|
-
declare function toContainToolCall(this: ExpectExtendThis, received: unknown, expected: Record<string, unknown>): ExpectationResult;
|
|
33
|
-
declare function toHaveToolMessages(this: ExpectExtendThis, received: unknown, expected: Array<Record<string, unknown>>): ExpectationResult;
|
|
34
|
-
declare function toHaveBeenInterrupted(this: ExpectExtendThis, received: unknown, expectedValue?: unknown): ExpectationResult;
|
|
35
|
-
declare function toHaveStructuredResponse(this: ExpectExtendThis, received: unknown, expected?: Record<string, unknown>): ExpectationResult;
|
|
26
|
+
export declare const toBeHumanMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
27
|
+
export declare const toBeAIMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
28
|
+
export declare const toBeSystemMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
29
|
+
export declare const toBeToolMessage: (this: ExpectExtendThis, received: unknown, expected?: string | Record<string, unknown>) => ExpectationResult;
|
|
30
|
+
export declare function toHaveToolCalls(this: ExpectExtendThis, received: unknown, expected: Array<Record<string, unknown>>): ExpectationResult;
|
|
31
|
+
export declare function toHaveToolCallCount(this: ExpectExtendThis, received: unknown, expected: number): ExpectationResult;
|
|
32
|
+
export declare function toContainToolCall(this: ExpectExtendThis, received: unknown, expected: Record<string, unknown>): ExpectationResult;
|
|
33
|
+
export declare function toHaveToolMessages(this: ExpectExtendThis, received: unknown, expected: Array<Record<string, unknown>>): ExpectationResult;
|
|
34
|
+
export declare function toHaveBeenInterrupted(this: ExpectExtendThis, received: unknown, expectedValue?: unknown): ExpectationResult;
|
|
35
|
+
export declare function toHaveStructuredResponse(this: ExpectExtendThis, received: unknown, expected?: Record<string, unknown>): ExpectationResult;
|
|
36
36
|
/**
|
|
37
37
|
* All matcher functions bundled for convenient use with `expect.extend()`.
|
|
38
38
|
*/
|
|
39
|
-
declare const langchainMatchers: {
|
|
39
|
+
export declare const langchainMatchers: {
|
|
40
40
|
toHaveStreamText: typeof toHaveStreamText;
|
|
41
41
|
toHaveStreamReasoning: typeof toHaveStreamReasoning;
|
|
42
42
|
toHaveStreamToolCalls: typeof toHaveStreamToolCalls;
|
|
@@ -53,7 +53,7 @@ declare const langchainMatchers: {
|
|
|
53
53
|
toHaveBeenInterrupted: typeof toHaveBeenInterrupted;
|
|
54
54
|
toHaveStructuredResponse: typeof toHaveStructuredResponse;
|
|
55
55
|
};
|
|
56
|
-
interface LangChainMatchers<R = unknown> extends StreamMatchers<R> {
|
|
56
|
+
export interface LangChainMatchers<R = unknown> extends StreamMatchers<R> {
|
|
57
57
|
toBeHumanMessage(expected?: string | {
|
|
58
58
|
content?: string;
|
|
59
59
|
id?: string;
|
|
@@ -93,5 +93,4 @@ interface LangChainMatchers<R = unknown> extends StreamMatchers<R> {
|
|
|
93
93
|
toHaveStructuredResponse(expected?: Record<string, unknown>): R;
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
96
|
-
export { LangChainMatchers, langchainMatchers, toBeAIMessage, toBeHumanMessage, toBeSystemMessage, toBeToolMessage, toContainToolCall, toHaveBeenInterrupted, toHaveStructuredResponse, toHaveToolCallCount, toHaveToolCalls, toHaveToolMessages };
|
|
97
96
|
//# sourceMappingURL=matchers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchers.d.ts","names":[],"sources":["../../src/testing/matchers.ts"],"mappings":";;;;;;;;;;UAmBU;EACR;EACA,OAAO,YAAY;EACnB;IACE,YAAY,cAAc,mBAAmB;IAC7C,cAAc;IACd,cAAc;;;UAIR;EACR;EACA;EACA;EACA;;
|
|
1
|
+
{"version":3,"file":"matchers.d.ts","names":["_$___utils_testing_stream_js0.toHaveStreamText","_$___utils_testing_stream_js0.toHaveStreamReasoning","_$___utils_testing_stream_js0.toHaveStreamToolCalls","_$___utils_testing_stream_js0.toHaveStreamUsage","_$___utils_testing_stream_js0.toHaveStreamOutput"],"sources":["../../src/testing/matchers.ts"],"mappings":";;;;;;;;;;UAmBU;EACR;EACA,OAAO,YAAY;EACnB;IACE,YAAY,cAAc,mBAAmB;IAC7C,cAAc;IACd,cAAc;;;UAIR;EACR;EACA;EACA;EACA;;qBAoFW,mBAAgB,MAvEnB,kBAAgB,mBACL,oBACG,4BACnB;qBAyEQ,gBAAa,MA5EhB,kBAAgB,mBACL,oBACG,4BACnB;qBA8EQ,oBAAiB,MAjFpB,kBAAgB,mBACL,oBACG,4BACnB;qBAmFQ,kBAAe,MAtFlB,kBAAgB,mBACL,oBACG,4BACnB;wBAwFW,gBACd,MAAM,kBACN,mBACA,UAAU,MAAM,2BACf;wBAwDa,oBACd,MAAM,kBACN,mBACA,mBACC;wBA2Ba,kBACd,MAAM,kBACN,mBACA,UAAU,0BACT;wBA+Ba,mBACd,MAAM,kBACN,mBACA,UAAU,MAAM,2BACf;wBA6Da,sBACd,MAAM,kBACN,mBACA,0BACC;wBAyCa,yBACd,MAAM,kBACN,mBACA,WAAW,0BACV;;;;qBA4CU;2BAAAA;;;;;EAvXH,mBAAA,MAAA,kBAAgB,mBACL,oBACG,4BACnB;;;;;;;;;;;iBAkYY,kBAAkB,qBAAqB,eAAe;EACrE,iBAAiB;IAAsB;IAAkB;MAAgB;EACzE,cAAc;IAAsB;IAAkB;MAAkB;EACxE,kBACE;IAAsB;IAAkB;MACvC;EACH,gBACE;IAGM;IACA;IACA;IACA;MAEL;EACH,gBACE,UAAU;IACR;IACA;IACA,OAAO;OAER;EACH,oBAAoB,mBAAmB;EACvC,kBAAkB;IAChB;IACA;IACA,OAAO;MACL;EACJ,mBACE,UAAU;IACR;IACA;IACA;IACA;OAED;EACH,sBAAsB,0BAA0B;EAChD,yBAAyB,WAAW,0BAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LangChainMatchers } from "./matchers.cjs";
|
|
2
|
+
//#region src/testing/vitest-expect.d.ts
|
|
3
|
+
declare module "vitest" {
|
|
4
|
+
interface Assertion<R extends void | Promise<void> = void, T = unknown> extends LangChainMatchers<R> {}
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export type { LangChainMatchers };
|
|
8
|
+
//# sourceMappingURL=vitest-expect.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest-expect.d.cts","names":[],"sources":["../../src/testing/vitest-expect.ts"],"mappings":";;;YAIY,UACR,iBAAiB,sBACjB,qBACQ,kBAAkB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LangChainMatchers } from "./matchers.js";
|
|
2
|
+
//#region src/testing/vitest-expect.d.ts
|
|
3
|
+
declare module "vitest" {
|
|
4
|
+
interface Assertion<R extends void | Promise<void> = void, T = unknown> extends LangChainMatchers<R> {}
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export type { LangChainMatchers };
|
|
8
|
+
//# sourceMappingURL=vitest-expect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest-expect.d.ts","names":[],"sources":["../../src/testing/vitest-expect.ts"],"mappings":";;;YAIY,UACR,iBAAiB,sBACjB,qBACQ,kBAAkB"}
|
package/dist/tools/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ import { z } from "zod/v3";
|
|
|
14
14
|
/**
|
|
15
15
|
* Base class for Tools that accept input of any shape defined by a Zod schema.
|
|
16
16
|
*/
|
|
17
|
-
declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseLangChain<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> implements StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
17
|
+
export declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseLangChain<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> implements StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
18
18
|
abstract name: string;
|
|
19
19
|
abstract description: string;
|
|
20
20
|
abstract schema: SchemaT;
|
|
@@ -75,7 +75,7 @@ declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutpu
|
|
|
75
75
|
/**
|
|
76
76
|
* Base class for Tools that accept input as a string.
|
|
77
77
|
*/
|
|
78
|
-
declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends StructuredTool<StringInputToolSchema, ToolInputSchemaOutputType<StringInputToolSchema>, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT, ToolEventT> implements ToolInterface<StringInputToolSchema, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT> {
|
|
78
|
+
export declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends StructuredTool<StringInputToolSchema, ToolInputSchemaOutputType<StringInputToolSchema>, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT, ToolEventT> implements ToolInterface<StringInputToolSchema, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT> {
|
|
79
79
|
schema: z.ZodEffects<z.ZodObject<{
|
|
80
80
|
input: z.ZodOptional<z.ZodString>;
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -100,7 +100,7 @@ declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEvent
|
|
|
100
100
|
/**
|
|
101
101
|
* A tool that can be created dynamically from a function, name, and description.
|
|
102
102
|
*/
|
|
103
|
-
declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends Tool<ToolOutputT, ToolEventT> {
|
|
103
|
+
export declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends Tool<ToolOutputT, ToolEventT> {
|
|
104
104
|
static lc_name(): string;
|
|
105
105
|
name: string;
|
|
106
106
|
description: string;
|
|
@@ -129,7 +129,7 @@ declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventTy
|
|
|
129
129
|
* @template ToolOutputT The return type of the tool's function. Defaults to `ToolOutputType`.
|
|
130
130
|
* @template NameT The literal type of the tool name (for discriminated union support). Defaults to `string`.
|
|
131
131
|
*/
|
|
132
|
-
declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType, NameT extends string = string> extends StructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventT> {
|
|
132
|
+
export declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType, NameT extends string = string> extends StructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventT> {
|
|
133
133
|
static lc_name(): string;
|
|
134
134
|
name: NameT;
|
|
135
135
|
description: string;
|
|
@@ -151,7 +151,7 @@ declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT
|
|
|
151
151
|
* of tools that agents can use. Subclasses must implement the `tools`
|
|
152
152
|
* property to provide the specific tools for the toolkit.
|
|
153
153
|
*/
|
|
154
|
-
declare abstract class BaseToolkit {
|
|
154
|
+
export declare abstract class BaseToolkit {
|
|
155
155
|
abstract tools: StructuredToolInterface[];
|
|
156
156
|
getTools(): StructuredToolInterface[];
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ declare abstract class BaseToolkit {
|
|
|
162
162
|
* @template {ToolInputSchemaBase} RunInput The input schema for the tool.
|
|
163
163
|
* @template {string} NameT The literal name type for discriminated union support.
|
|
164
164
|
*/
|
|
165
|
-
interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT extends string = string> extends ToolParams {
|
|
165
|
+
export interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT extends string = string> extends ToolParams {
|
|
166
166
|
/**
|
|
167
167
|
* The name of the tool. If using with an LLM, this
|
|
168
168
|
* will be passed as the tool name.
|
|
@@ -214,20 +214,20 @@ interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT ex
|
|
|
214
214
|
*
|
|
215
215
|
* @returns {DynamicStructuredTool<SchemaT>} A new StructuredTool instance.
|
|
216
216
|
*/
|
|
217
|
-
declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
218
|
-
declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
219
|
-
declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
220
|
-
declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
221
|
-
declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig> = RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
222
|
-
declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT> | DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
223
|
-
declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
224
|
-
declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
225
|
-
declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
226
|
-
declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
227
|
-
declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
228
|
-
declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT> | DynamicTool<ToolOutputT>;
|
|
229
|
-
type ServerTool = Record<string, unknown>;
|
|
230
|
-
type ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;
|
|
217
|
+
export declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
218
|
+
export declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
219
|
+
export declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
220
|
+
export declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
221
|
+
export declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig> = RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
222
|
+
export declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT> | DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
223
|
+
export declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
224
|
+
export declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
225
|
+
export declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
226
|
+
export declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
227
|
+
export declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
228
|
+
export declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT> | DynamicTool<ToolOutputT>;
|
|
229
|
+
export type ServerTool = Record<string, unknown>;
|
|
230
|
+
export type ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;
|
|
231
231
|
//#endregion
|
|
232
|
-
export { type BaseDynamicToolInput,
|
|
232
|
+
export { type BaseDynamicToolInput, type ContentAndArtifact, type DynamicStructuredToolInput, type DynamicToolInput, type ResponseFormat, type StructuredToolCallInput, type StructuredToolInterface, type StructuredToolParams, ToolInputParsingException, type ToolInterface, type ToolParams, type ToolReturnType, type ToolRunnableConfig, type ToolRuntime, type ToolInputSchemaBase as ToolSchemaBase, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
233
233
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["JSONSchema"],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;;;;;8BA8FsB,eACpB,UAAU,qBACV,gBAAgB,0BAA0B,UAC1C,eAAe,yBAAyB,UACxC,cAAc,gBACd,aAAa,uBAEL,cACN,wBAAwB,SAAS,eACjC,cAAc,wBAEL,wBAAwB,SAAS,cAAc;WAEjD;WAEA;WAEA,QAAQ;;;;;;;EAQjB,SAAS;;;;;;;EAQT;EAEA;MAEI;;;;;;;;;;EAaJ,iBAAiB;;;;EAKjB,gBAAgB;EAEhB,YAAY,SAAS;qBAWF,MACjB,KAAK,eACL,aAAa,2BACb,eAAe,qBACd,QAAQ,eAAe,eAAe,YAAY;;;;;;;EAQ/C,OACJ,eAAe,wBAAwB,SAAS,eAChD,gBAAgB,gCAEhB,OAAO,QACP,SAAS,UACR,QAAQ,eAAe,QAAQ,SAAS;;;;;;;;;;;;EAyCrC,KACJ,aAAa,wBAAwB,SAAS,eAC9C,gBAAgB,gCAEhB,KAAK,MACL,YAAY,SAEZ;;EAAA,kBACC,QAAQ,eAAe,MAAM,SAAS;;;;;8BAwIrB,KACpB,cAAc,gBACd,aAAa,uBAEL,eACN,uBACA,0BAA0B,wBAC1B,yBAAyB,wBACzB,aACA,uBAGA,cACE,uBACA,yBAAyB,wBACzB;EAGJ,QAAM,EAAA,WAAA,EAAA;;;;;;;;;EAIN,YAAY,SAAS;;;;;;;;;;EAcrB,KACE,kCAAkC,EAAE,wBAAwB,UAC5D,gBAAgB,gCAEhB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a;YACb,aACR,0BACA,cACA"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { z } from "zod/v3";
|
|
|
14
14
|
/**
|
|
15
15
|
* Base class for Tools that accept input of any shape defined by a Zod schema.
|
|
16
16
|
*/
|
|
17
|
-
declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseLangChain<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> implements StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
17
|
+
export declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseLangChain<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> implements StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
18
18
|
abstract name: string;
|
|
19
19
|
abstract description: string;
|
|
20
20
|
abstract schema: SchemaT;
|
|
@@ -75,7 +75,7 @@ declare abstract class StructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutpu
|
|
|
75
75
|
/**
|
|
76
76
|
* Base class for Tools that accept input as a string.
|
|
77
77
|
*/
|
|
78
|
-
declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends StructuredTool<StringInputToolSchema, ToolInputSchemaOutputType<StringInputToolSchema>, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT, ToolEventT> implements ToolInterface<StringInputToolSchema, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT> {
|
|
78
|
+
export declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends StructuredTool<StringInputToolSchema, ToolInputSchemaOutputType<StringInputToolSchema>, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT, ToolEventT> implements ToolInterface<StringInputToolSchema, ToolInputSchemaInputType<StringInputToolSchema>, ToolOutputT> {
|
|
79
79
|
schema: z.ZodEffects<z.ZodObject<{
|
|
80
80
|
input: z.ZodOptional<z.ZodString>;
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -100,7 +100,7 @@ declare abstract class Tool<ToolOutputT = ToolOutputType, ToolEventT = ToolEvent
|
|
|
100
100
|
/**
|
|
101
101
|
* A tool that can be created dynamically from a function, name, and description.
|
|
102
102
|
*/
|
|
103
|
-
declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends Tool<ToolOutputT, ToolEventT> {
|
|
103
|
+
export declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends Tool<ToolOutputT, ToolEventT> {
|
|
104
104
|
static lc_name(): string;
|
|
105
105
|
name: string;
|
|
106
106
|
description: string;
|
|
@@ -129,7 +129,7 @@ declare class DynamicTool<ToolOutputT = ToolOutputType, ToolEventT = ToolEventTy
|
|
|
129
129
|
* @template ToolOutputT The return type of the tool's function. Defaults to `ToolOutputType`.
|
|
130
130
|
* @template NameT The literal type of the tool name (for discriminated union support). Defaults to `string`.
|
|
131
131
|
*/
|
|
132
|
-
declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType, NameT extends string = string> extends StructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventT> {
|
|
132
|
+
export declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType, NameT extends string = string> extends StructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventT> {
|
|
133
133
|
static lc_name(): string;
|
|
134
134
|
name: NameT;
|
|
135
135
|
description: string;
|
|
@@ -151,7 +151,7 @@ declare class DynamicStructuredTool<SchemaT = ToolInputSchemaBase, SchemaOutputT
|
|
|
151
151
|
* of tools that agents can use. Subclasses must implement the `tools`
|
|
152
152
|
* property to provide the specific tools for the toolkit.
|
|
153
153
|
*/
|
|
154
|
-
declare abstract class BaseToolkit {
|
|
154
|
+
export declare abstract class BaseToolkit {
|
|
155
155
|
abstract tools: StructuredToolInterface[];
|
|
156
156
|
getTools(): StructuredToolInterface[];
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ declare abstract class BaseToolkit {
|
|
|
162
162
|
* @template {ToolInputSchemaBase} RunInput The input schema for the tool.
|
|
163
163
|
* @template {string} NameT The literal name type for discriminated union support.
|
|
164
164
|
*/
|
|
165
|
-
interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT extends string = string> extends ToolParams {
|
|
165
|
+
export interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT extends string = string> extends ToolParams {
|
|
166
166
|
/**
|
|
167
167
|
* The name of the tool. If using with an LLM, this
|
|
168
168
|
* will be passed as the tool name.
|
|
@@ -214,20 +214,20 @@ interface ToolWrapperParams<RunInput = ToolInputSchemaBase | undefined, NameT ex
|
|
|
214
214
|
*
|
|
215
215
|
* @returns {DynamicStructuredTool<SchemaT>} A new StructuredTool instance.
|
|
216
216
|
*/
|
|
217
|
-
declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
218
|
-
declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
219
|
-
declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
220
|
-
declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
221
|
-
declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig> = RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
222
|
-
declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT> | DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
223
|
-
declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
224
|
-
declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
225
|
-
declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
226
|
-
declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
227
|
-
declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
228
|
-
declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT> | DynamicTool<ToolOutputT>;
|
|
229
|
-
type ServerTool = Record<string, unknown>;
|
|
230
|
-
type ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;
|
|
217
|
+
export declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
218
|
+
export declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig> = RunnableFunc<InferInteropZodOutput<SchemaT>, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT>): DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
219
|
+
export declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
220
|
+
export declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
221
|
+
export declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig> = RunnableFunc<Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT>;
|
|
222
|
+
export declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, FuncT extends RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig> = RunnableFunc<SchemaOutputT, ToolOutputT, ToolRunnableConfig>>(func: FuncT, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>, NameT> | DynamicTool<InferToolOutputFromFunc<FuncT>, InferToolEventFromFunc<FuncT>>;
|
|
223
|
+
export declare function tool<SchemaT extends ZodStringV3, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
224
|
+
export declare function tool<SchemaT extends ZodStringV4, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: InferInteropZodOutput<SchemaT>, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT>): DynamicTool<ToolOutputT>;
|
|
225
|
+
export declare function tool<SchemaT extends ZodObjectV3, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
226
|
+
export declare function tool<SchemaT extends ZodObjectV4, NameT extends string, SchemaOutputT = InferInteropZodOutput<SchemaT>, SchemaInputT = InferInteropZodInput<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
227
|
+
export declare function tool<SchemaT extends JsonSchema7Type, NameT extends string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: Parameters<DynamicStructuredToolInput<SchemaT>["func"]>[0], runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT>;
|
|
228
|
+
export declare function tool<SchemaT extends InteropZodObject | InteropZodType<string> | JsonSchema7Type = InteropZodObject, NameT extends string = string, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType, TState = unknown, TContext = unknown>(func: (input: SchemaOutputT, runtime: ToolRuntime<TState, TContext>) => ToolOutputT | Promise<ToolOutputT>, fields: ToolWrapperParams<SchemaT, NameT>): DynamicStructuredTool<SchemaT, SchemaOutputT, SchemaInputT, ToolOutputT, ToolEventType, NameT> | DynamicTool<ToolOutputT>;
|
|
229
|
+
export type ServerTool = Record<string, unknown>;
|
|
230
|
+
export type ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;
|
|
231
231
|
//#endregion
|
|
232
|
-
export { type BaseDynamicToolInput,
|
|
232
|
+
export { type BaseDynamicToolInput, type ContentAndArtifact, type DynamicStructuredToolInput, type DynamicToolInput, type ResponseFormat, type StructuredToolCallInput, type StructuredToolInterface, type StructuredToolParams, ToolInputParsingException, type ToolInterface, type ToolParams, type ToolReturnType, type ToolRunnableConfig, type ToolRuntime, type ToolInputSchemaBase as ToolSchemaBase, isLangChainTool, isRunnableToolLike, isStructuredTool, isStructuredToolParams };
|
|
233
233
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["JSONSchema"],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;;;;;8BA8FsB,eACpB,UAAU,qBACV,gBAAgB,0BAA0B,UAC1C,eAAe,yBAAyB,UACxC,cAAc,gBACd,aAAa,uBAEL,cACN,wBAAwB,SAAS,eACjC,cAAc,wBAEL,wBAAwB,SAAS,cAAc;WAEjD;WAEA;WAEA,QAAQ;;;;;;;EAQjB,SAAS;;;;;;;EAQT;EAEA;MAEI;;;;;;;;;;EAaJ,iBAAiB;;;;EAKjB,gBAAgB;EAEhB,YAAY,SAAS;qBAWF,MACjB,KAAK,eACL,aAAa,2BACb,eAAe,qBACd,QAAQ,eAAe,eAAe,YAAY;;;;;;;EAQ/C,OACJ,eAAe,wBAAwB,SAAS,eAChD,gBAAgB,gCAEhB,OAAO,QACP,SAAS,UACR,QAAQ,eAAe,QAAQ,SAAS;;;;;;;;;;;;EA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,YAAY,QAAQ,cAC1B,cAAc,QAAQ,cAC3B,QAAQ,kBAAkB,SAAS,SAClC,sBACD,SACA,eACA,cACA,aACA,eACA;wBAGc,KACd,gBAAgB,mBAAmB,yBAAyBA,kBAC1D,kBACF,+BACA,gBAAgB,0BAA0B,UAC1C,eAAe,yBAAyB,UACxC,cAAc,gBACd,kBACA,oBAEA,OACE,OAAO,eACP,SAAS,YAAY,QAAQ,cAC1B,cAAc,QAAQ,cAC3B,QAAQ,kBAAkB,SAAS,SAEjC,sBACE,SACA,eACA,cACA,aACA,eACA,SAEF,YAAY;YA6LJ,aAAa;YACb,aACR,0BACA,cACA"}
|
package/dist/tools/types.d.cts
CHANGED
|
@@ -10,19 +10,19 @@ import "../utils/json_schema.cjs";
|
|
|
10
10
|
import { BaseLangChainParams, ToolDefinition } from "../language_models/base.cjs";
|
|
11
11
|
import { BaseStore } from "../stores.cjs";
|
|
12
12
|
//#region src/tools/types.d.ts
|
|
13
|
-
type ResponseFormat = "content" | "content_and_artifact" | string;
|
|
14
|
-
type ToolOutputType = any;
|
|
15
|
-
type ToolEventType = unknown;
|
|
16
|
-
type InferToolEventFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<infer Y, any, any>) ? Y : ToolEventType;
|
|
17
|
-
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;
|
|
18
|
-
type ContentAndArtifact = [MessageContent, any];
|
|
13
|
+
export type ResponseFormat = "content" | "content_and_artifact" | string;
|
|
14
|
+
export type ToolOutputType = any;
|
|
15
|
+
export type ToolEventType = unknown;
|
|
16
|
+
export type InferToolEventFromFunc<F> = F extends ((...args: any[]) => AsyncGenerator<infer Y, any, any>) ? Y : ToolEventType;
|
|
17
|
+
export 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;
|
|
18
|
+
export type ContentAndArtifact = [MessageContent, any];
|
|
19
19
|
/**
|
|
20
20
|
* Conditional type that determines the return type of the {@link StructuredTool.invoke} method.
|
|
21
21
|
* - If the input is a ToolCall, it returns a ToolMessage
|
|
22
22
|
* - If the config is a runnable config and contains a toolCall property, it returns a ToolMessage
|
|
23
23
|
* - Otherwise, it returns the original output type
|
|
24
24
|
*/
|
|
25
|
-
type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {
|
|
25
|
+
export type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput ? TOutput : TConfig extends {
|
|
26
26
|
toolCall: {
|
|
27
27
|
id: string;
|
|
28
28
|
};
|
|
@@ -39,11 +39,11 @@ type ToolReturnType<TInput, TConfig, TOutput> = TOutput extends DirectToolOutput
|
|
|
39
39
|
* Base type that establishes the types of input schemas that can be used for LangChain tool
|
|
40
40
|
* definitions.
|
|
41
41
|
*/
|
|
42
|
-
type ToolInputSchemaBase = InteropZodType | JsonSchema7Type;
|
|
42
|
+
export type ToolInputSchemaBase = InteropZodType | JsonSchema7Type;
|
|
43
43
|
/**
|
|
44
44
|
* Parameters for the Tool classes.
|
|
45
45
|
*/
|
|
46
|
-
interface ToolParams extends BaseLangChainParams {
|
|
46
|
+
export interface ToolParams extends BaseLangChainParams {
|
|
47
47
|
/**
|
|
48
48
|
* The tool response format.
|
|
49
49
|
*
|
|
@@ -76,7 +76,7 @@ interface ToolParams extends BaseLangChainParams {
|
|
|
76
76
|
*/
|
|
77
77
|
extras?: Record<string, unknown>;
|
|
78
78
|
}
|
|
79
|
-
type ToolRunnableConfig<ConfigurableFieldType extends Record<string, any> = Record<string, any>, ContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {
|
|
79
|
+
export type ToolRunnableConfig<ConfigurableFieldType extends Record<string, any> = Record<string, any>, ContextSchema = any> = RunnableConfig<ConfigurableFieldType> & {
|
|
80
80
|
toolCall?: ToolCall;
|
|
81
81
|
context?: ContextSchema;
|
|
82
82
|
};
|
|
@@ -85,7 +85,7 @@ type ToolRunnableConfig<ConfigurableFieldType extends Record<string, any> = Reco
|
|
|
85
85
|
*
|
|
86
86
|
* @version 0.2.19
|
|
87
87
|
*/
|
|
88
|
-
interface StructuredToolParams extends Pick<StructuredToolInterface, "name" | "schema" | "extras"> {
|
|
88
|
+
export interface StructuredToolParams extends Pick<StructuredToolInterface, "name" | "schema" | "extras"> {
|
|
89
89
|
/**
|
|
90
90
|
* An optional description of the tool to pass to the model.
|
|
91
91
|
*/
|
|
@@ -102,7 +102,7 @@ interface StructuredToolParams extends Pick<StructuredToolInterface, "name" | "s
|
|
|
102
102
|
* applying any transforms defined in your schema. If there are no transforms, the input and output
|
|
103
103
|
* types will be the same.
|
|
104
104
|
*/
|
|
105
|
-
type ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;
|
|
105
|
+
export type ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOutput<T> : T extends JsonSchema7Type ? unknown : never;
|
|
106
106
|
/**
|
|
107
107
|
* Utility type that resolves the input type of a tool input schema.
|
|
108
108
|
*
|
|
@@ -114,14 +114,14 @@ type ToolInputSchemaOutputType<T> = T extends InteropZodType ? InferInteropZodOu
|
|
|
114
114
|
* applying any transforms defined in your schema. If there are no transforms, the input and output
|
|
115
115
|
* types will be the same.
|
|
116
116
|
*/
|
|
117
|
-
type ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;
|
|
117
|
+
export type ToolInputSchemaInputType<T> = T extends InteropZodType ? InferInteropZodInput<T> : T extends JsonSchema7Type ? unknown : never;
|
|
118
118
|
/**
|
|
119
119
|
* Defines the type that will be passed into a tool handler function as a result of a tool call.
|
|
120
120
|
*
|
|
121
121
|
* @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.
|
|
122
122
|
* @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.
|
|
123
123
|
*/
|
|
124
|
-
type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;
|
|
124
|
+
export type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>> = (ToolInputSchemaOutputType<SchemaT> extends string ? string : never) | SchemaInputT | ToolCall;
|
|
125
125
|
/**
|
|
126
126
|
* An input schema type for tools that accept a single string input.
|
|
127
127
|
*
|
|
@@ -131,7 +131,7 @@ type StructuredToolCallInput<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolI
|
|
|
131
131
|
* This is primarily used for creating simple string-based tools where the LLM
|
|
132
132
|
* only needs to provide a single text value as input to the tool.
|
|
133
133
|
*/
|
|
134
|
-
type StringInputToolSchema = ZodV3Like<string | undefined, any>;
|
|
134
|
+
export type StringInputToolSchema = ZodV3Like<string | undefined, any>;
|
|
135
135
|
/**
|
|
136
136
|
* Interface that defines the shape of a LangChain structured tool.
|
|
137
137
|
*
|
|
@@ -141,7 +141,7 @@ type StringInputToolSchema = ZodV3Like<string | undefined, any>;
|
|
|
141
141
|
* @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.
|
|
142
142
|
* @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.
|
|
143
143
|
*/
|
|
144
|
-
interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {
|
|
144
|
+
export interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends RunnableInterface<StructuredToolCallInput<SchemaT, SchemaInputT>, ToolOutputT | ToolMessage> {
|
|
145
145
|
lc_namespace: string[];
|
|
146
146
|
/**
|
|
147
147
|
* A Zod schema representing the parameters of the tool.
|
|
@@ -197,7 +197,7 @@ interface StructuredToolInterface<SchemaT = ToolInputSchemaBase, SchemaInputT =
|
|
|
197
197
|
* @param SchemaT - The type of the tool input schema. Usually you don't need to specify this.
|
|
198
198
|
* @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.
|
|
199
199
|
*/
|
|
200
|
-
interface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
200
|
+
export interface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInputSchemaInputType<SchemaT>, ToolOutputT = ToolOutputType> extends StructuredToolInterface<SchemaT, SchemaInputT, ToolOutputT> {
|
|
201
201
|
/**
|
|
202
202
|
* @deprecated Use .invoke() instead. Will be removed in 0.3.0.
|
|
203
203
|
*
|
|
@@ -213,7 +213,7 @@ interface ToolInterface<SchemaT = StringInputToolSchema, SchemaInputT = ToolInpu
|
|
|
213
213
|
* Base interface for the input parameters of the {@link DynamicTool} and
|
|
214
214
|
* {@link DynamicStructuredTool} classes.
|
|
215
215
|
*/
|
|
216
|
-
interface BaseDynamicToolInput extends ToolParams {
|
|
216
|
+
export interface BaseDynamicToolInput extends ToolParams {
|
|
217
217
|
name: string;
|
|
218
218
|
description: string;
|
|
219
219
|
/**
|
|
@@ -230,7 +230,7 @@ interface BaseDynamicToolInput extends ToolParams {
|
|
|
230
230
|
* @param ToolOutputT - The return type of the tool.
|
|
231
231
|
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
232
232
|
*/
|
|
233
|
-
interface DynamicToolInput<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
233
|
+
export interface DynamicToolInput<ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
234
234
|
func: (input: string, runManager?: CallbackManagerForToolRun, config?: ToolRunnableConfig) => Promise<ToolOutputT> | AsyncGenerator<ToolEventT, ToolOutputT>;
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
@@ -241,7 +241,7 @@ interface DynamicToolInput<ToolOutputT = ToolOutputType, ToolEventT = ToolEventT
|
|
|
241
241
|
* @param ToolOutputT - The return type of the tool.
|
|
242
242
|
* @param ToolEventT - The type of values yielded by the tool when using an async generator.
|
|
243
243
|
*/
|
|
244
|
-
interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
244
|
+
export interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutputT = ToolInputSchemaOutputType<SchemaT>, ToolOutputT = ToolOutputType, ToolEventT = ToolEventType> extends BaseDynamicToolInput {
|
|
245
245
|
/**
|
|
246
246
|
* Tool handler function - the function that will be called when the tool is invoked.
|
|
247
247
|
*
|
|
@@ -259,21 +259,21 @@ interface DynamicStructuredToolInput<SchemaT = ToolInputSchemaBase, SchemaOutput
|
|
|
259
259
|
* @param {StructuredToolInterface | JSONSchema | undefined} tool The tool to check if it is an instance of `StructuredToolInterface`.
|
|
260
260
|
* @returns {tool is StructuredToolInterface} Whether the inputted tool is an instance of `StructuredToolInterface`.
|
|
261
261
|
*/
|
|
262
|
-
declare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;
|
|
262
|
+
export declare function isStructuredTool(tool?: StructuredToolInterface | ToolDefinition | JsonSchema7Type): tool is StructuredToolInterface;
|
|
263
263
|
/**
|
|
264
264
|
* Confirm whether the inputted tool is an instance of `RunnableToolLike`.
|
|
265
265
|
*
|
|
266
266
|
* @param {unknown | undefined} tool The tool to check if it is an instance of `RunnableToolLike`.
|
|
267
267
|
* @returns {tool is RunnableToolLike} Whether the inputted tool is an instance of `RunnableToolLike`.
|
|
268
268
|
*/
|
|
269
|
-
declare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;
|
|
269
|
+
export declare function isRunnableToolLike(tool?: unknown): tool is RunnableToolLike;
|
|
270
270
|
/**
|
|
271
271
|
* Confirm whether or not the tool contains the necessary properties to be considered a `StructuredToolParams`.
|
|
272
272
|
*
|
|
273
273
|
* @param {unknown | undefined} tool The object to check if it is a `StructuredToolParams`.
|
|
274
274
|
* @returns {tool is StructuredToolParams} Whether the inputted object is a `StructuredToolParams`.
|
|
275
275
|
*/
|
|
276
|
-
declare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;
|
|
276
|
+
export declare function isStructuredToolParams(tool?: unknown): tool is StructuredToolParams;
|
|
277
277
|
/**
|
|
278
278
|
* Whether or not the tool is one of StructuredTool, RunnableTool or StructuredToolParams.
|
|
279
279
|
* It returns `is StructuredToolParams` since that is the most minimal interface of the three,
|
|
@@ -282,7 +282,7 @@ declare function isStructuredToolParams(tool?: unknown): tool is StructuredToolP
|
|
|
282
282
|
* @param {unknown | undefined} tool The tool to check if it is a LangChain tool.
|
|
283
283
|
* @returns {tool is StructuredToolParams} Whether the inputted tool is a LangChain tool.
|
|
284
284
|
*/
|
|
285
|
-
declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
285
|
+
export declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
286
286
|
/**
|
|
287
287
|
* Runtime context automatically injected into tools.
|
|
288
288
|
*
|
|
@@ -351,7 +351,7 @@ declare function isLangChainTool(tool?: unknown): tool is StructuredToolParams;
|
|
|
351
351
|
* @template StateT - The type of the state schema (inferred from stateSchema)
|
|
352
352
|
* @template ContextT - The type of the context schema (inferred from contextSchema)
|
|
353
353
|
*/
|
|
354
|
-
type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {
|
|
354
|
+
export type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {
|
|
355
355
|
/**
|
|
356
356
|
* The current graph state.
|
|
357
357
|
*/
|
|
@@ -382,5 +382,4 @@ type ToolRuntime<TState = unknown, TContext = unknown> = RunnableConfig & {
|
|
|
382
382
|
writer: ((chunk: unknown) => void) | null;
|
|
383
383
|
};
|
|
384
384
|
//#endregion
|
|
385
|
-
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 };
|
|
386
385
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/tools/types.ts"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":["JSONSchema"],"sources":["../../src/tools/types.ts"],"mappings":";;;;;;;;;;;;YA6BY;YAGA;YAEA;YAGA,uBAAuB,KAAK,eACnC,gBACA,qBAAqB,gBACtB,IACA;YAEQ,wBAAwB,KAAK,eACpC,gBACA,0BAA0B,WAC3B,IACA,eAAc,gBAAgB,cAAc,MAC1C,IACA,eAAc,sBAAsB,KAClC,IACA;YAII,sBAAsB;;;;;;;YAQtB,eAAe,QAAQ,SAAS,WAC1C,gBAAgB,mBACZ,UACA;EAAkB;IAAY;;IAC5B,cACA;EAAkB;IAAY;;IAC5B,UACA;EAAkB;IAAY;;IAC5B,UAAU,cACV,eAAe,WACb,cACA;;;;;YAMF,sBAAsB,iB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