@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
|
@@ -12,7 +12,7 @@ import { Runnable } from "../runnables/base.cjs";
|
|
|
12
12
|
* One example of this is a text splitter that splits a large document into
|
|
13
13
|
* many smaller documents.
|
|
14
14
|
*/
|
|
15
|
-
declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterface[] = DocumentInterface[], RunOutput extends DocumentInterface[] = DocumentInterface[]> extends Runnable<RunInput, RunOutput> {
|
|
15
|
+
export declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterface[] = DocumentInterface[], RunOutput extends DocumentInterface[] = DocumentInterface[]> extends Runnable<RunInput, RunOutput> {
|
|
16
16
|
lc_namespace: string[];
|
|
17
17
|
/**
|
|
18
18
|
* Transform a list of documents.
|
|
@@ -33,10 +33,9 @@ declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterfac
|
|
|
33
33
|
* Class for document transformers that return exactly one transformed document
|
|
34
34
|
* for each input document.
|
|
35
35
|
*/
|
|
36
|
-
declare abstract class MappingDocumentTransformer extends BaseDocumentTransformer {
|
|
36
|
+
export declare abstract class MappingDocumentTransformer extends BaseDocumentTransformer {
|
|
37
37
|
transformDocuments(documents: DocumentInterface[]): Promise<DocumentInterface[]>;
|
|
38
38
|
abstract _transformDocument(document: DocumentInterface): Promise<DocumentInterface>;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
export { BaseDocumentTransformer, MappingDocumentTransformer };
|
|
42
41
|
//# sourceMappingURL=transformers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.cts","names":[],"sources":["../../src/documents/transformers.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transformers.d.cts","names":[],"sources":["../../src/documents/transformers.ts"],"mappings":";;;;;;;;;;;;;;8BAcsB,wBACpB,iBAAiB,sBAAsB,qBACvC,kBAAkB,sBAAsB,6BAChC,SAAS,UAAU;EAC3B;;;;;;WAOS,mBAAmB,WAAW,WAAW,QAAQ;;;;;;;;EAS1D,OAAO,OAAO,UAAU,WAAW,qBAAqB,QAAQ;;;;;;8BAS5C,mCAAmC;EACjD,mBACJ,WAAW,sBACV,QAAQ;WASF,mBACP,UAAU,oBACT,QAAQ"}
|
|
@@ -12,7 +12,7 @@ import { Runnable } from "../runnables/base.js";
|
|
|
12
12
|
* One example of this is a text splitter that splits a large document into
|
|
13
13
|
* many smaller documents.
|
|
14
14
|
*/
|
|
15
|
-
declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterface[] = DocumentInterface[], RunOutput extends DocumentInterface[] = DocumentInterface[]> extends Runnable<RunInput, RunOutput> {
|
|
15
|
+
export declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterface[] = DocumentInterface[], RunOutput extends DocumentInterface[] = DocumentInterface[]> extends Runnable<RunInput, RunOutput> {
|
|
16
16
|
lc_namespace: string[];
|
|
17
17
|
/**
|
|
18
18
|
* Transform a list of documents.
|
|
@@ -33,10 +33,9 @@ declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterfac
|
|
|
33
33
|
* Class for document transformers that return exactly one transformed document
|
|
34
34
|
* for each input document.
|
|
35
35
|
*/
|
|
36
|
-
declare abstract class MappingDocumentTransformer extends BaseDocumentTransformer {
|
|
36
|
+
export declare abstract class MappingDocumentTransformer extends BaseDocumentTransformer {
|
|
37
37
|
transformDocuments(documents: DocumentInterface[]): Promise<DocumentInterface[]>;
|
|
38
38
|
abstract _transformDocument(document: DocumentInterface): Promise<DocumentInterface>;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
export { BaseDocumentTransformer, MappingDocumentTransformer };
|
|
42
41
|
//# sourceMappingURL=transformers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/documents/transformers.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/documents/transformers.ts"],"mappings":";;;;;;;;;;;;;;8BAcsB,wBACpB,iBAAiB,sBAAsB,qBACvC,kBAAkB,sBAAsB,6BAChC,SAAS,UAAU;EAC3B;;;;;;WAOS,mBAAmB,WAAW,WAAW,QAAQ;;;;;;;;EAS1D,OAAO,OAAO,UAAU,WAAW,qBAAqB,QAAQ;;;;;;8BAS5C,mCAAmC;EACjD,mBACJ,WAAW,sBACV,QAAQ;WASF,mBACP,UAAU,oBACT,QAAQ"}
|
package/dist/embeddings.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.cjs";
|
|
|
4
4
|
* The parameters required to initialize an instance of the Embeddings
|
|
5
5
|
* class.
|
|
6
6
|
*/
|
|
7
|
-
type EmbeddingsParams = AsyncCallerParams;
|
|
8
|
-
interface EmbeddingsInterface<TOutput = number[]> {
|
|
7
|
+
export type EmbeddingsParams = AsyncCallerParams;
|
|
8
|
+
export interface EmbeddingsInterface<TOutput = number[]> {
|
|
9
9
|
/**
|
|
10
10
|
* An abstract method that takes an array of documents as input and
|
|
11
11
|
* returns a promise that resolves to an array of vectors for each
|
|
@@ -26,7 +26,7 @@ interface EmbeddingsInterface<TOutput = number[]> {
|
|
|
26
26
|
* An abstract class that provides methods for embedding documents and
|
|
27
27
|
* queries using LangChain.
|
|
28
28
|
*/
|
|
29
|
-
declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInterface<TOutput> {
|
|
29
|
+
export declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInterface<TOutput> {
|
|
30
30
|
/**
|
|
31
31
|
* The async caller should be used by subclasses to make any async calls,
|
|
32
32
|
* which will thus benefit from the concurrency and retry logic.
|
|
@@ -50,5 +50,4 @@ declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInter
|
|
|
50
50
|
abstract embedQuery(document: string): Promise<TOutput>;
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
|
-
export { Embeddings, EmbeddingsInterface, EmbeddingsParams };
|
|
54
53
|
//# sourceMappingURL=embeddings.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.cts","names":[],"sources":["../src/embeddings.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"embeddings.d.cts","names":[],"sources":["../src/embeddings.ts"],"mappings":";;;;;;YAMY,mBAAmB;iBAEd,oBAAoB;;;;;;;;EAQnC,eAAe,sBAAsB,QAAQ;;;;;;;EAQ7C,WAAW,mBAAmB,QAAQ;;;;;;8BAOlB,WACpB,+BACW,oBAAoB;;;;;EAK/B,QAAQ;EAER,YAAY,QAAQ;;;;;;;;WAWX,eAAe,sBAAsB,QAAQ;;;;;;;WAQ7C,WAAW,mBAAmB,QAAQ"}
|
package/dist/embeddings.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js";
|
|
|
4
4
|
* The parameters required to initialize an instance of the Embeddings
|
|
5
5
|
* class.
|
|
6
6
|
*/
|
|
7
|
-
type EmbeddingsParams = AsyncCallerParams;
|
|
8
|
-
interface EmbeddingsInterface<TOutput = number[]> {
|
|
7
|
+
export type EmbeddingsParams = AsyncCallerParams;
|
|
8
|
+
export interface EmbeddingsInterface<TOutput = number[]> {
|
|
9
9
|
/**
|
|
10
10
|
* An abstract method that takes an array of documents as input and
|
|
11
11
|
* returns a promise that resolves to an array of vectors for each
|
|
@@ -26,7 +26,7 @@ interface EmbeddingsInterface<TOutput = number[]> {
|
|
|
26
26
|
* An abstract class that provides methods for embedding documents and
|
|
27
27
|
* queries using LangChain.
|
|
28
28
|
*/
|
|
29
|
-
declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInterface<TOutput> {
|
|
29
|
+
export declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInterface<TOutput> {
|
|
30
30
|
/**
|
|
31
31
|
* The async caller should be used by subclasses to make any async calls,
|
|
32
32
|
* which will thus benefit from the concurrency and retry logic.
|
|
@@ -50,5 +50,4 @@ declare abstract class Embeddings<TOutput = number[]> implements EmbeddingsInter
|
|
|
50
50
|
abstract embedQuery(document: string): Promise<TOutput>;
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
|
-
export { Embeddings, EmbeddingsInterface, EmbeddingsParams };
|
|
54
53
|
//# sourceMappingURL=embeddings.d.ts.map
|
package/dist/embeddings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","names":[],"sources":["../src/embeddings.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"embeddings.d.ts","names":[],"sources":["../src/embeddings.ts"],"mappings":";;;;;;YAMY,mBAAmB;iBAEd,oBAAoB;;;;;;;;EAQnC,eAAe,sBAAsB,QAAQ;;;;;;;EAQ7C,WAAW,mBAAmB,QAAQ;;;;;;8BAOlB,WACpB,+BACW,oBAAoB;;;;;EAK/B,QAAQ;EAER,YAAY,QAAQ;;;;;;;;WAWX,eAAe,sBAAsB,QAAQ;;;;;;;WAQ7C,WAAW,mBAAmB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["baseNs"],"sources":["../../src/errors/index.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */\n\nimport type { AIMessageChunk } from \"../messages/ai.js\";\nimport { ns as baseNs } from \"../utils/namespace.js\";\n\nexport type LangChainErrorCodes =\n | \"CONTEXT_OVERFLOW\"\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\"\n | \"MODEL_ABORTED\";\n\n/** @deprecated Subclass LangChainError instead */\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n/** The error namespace for all LangChain errors */\nexport const ns = baseNs.sub(\"error\");\n\n/** Registered globally so duplicate copies of core in one dependency tree agree. */\nconst retryableSymbol = Symbol.for(\"langchain.errors.retryable\");\n\n/**\n * Mark an error as safe or unsafe to retry.\n *\n * Sets a non-enumerable symbol on the error itself, leaving its class and\n * shape untouched, so it is safe to apply to a provider SDK's own error.\n *\n * @param error - The error to mark. Non-objects are returned untouched.\n * @param retryable - `true` if retrying may succeed.\n * @returns The same error instance, for chaining.\n */\nexport function stampRetryable<T>(error: T, retryable: boolean): T {\n if (typeof error !== \"object\" || error === null) {\n return error;\n }\n try {\n Object.defineProperty(error, retryableSymbol, {\n value: retryable,\n configurable: true,\n });\n } catch {\n // Frozen or sealed error object; leave it unmarked rather than throwing.\n }\n return error;\n}\n\n/**\n * Read an error's retryability mark.\n *\n * @returns `true`/`false` when marked, `undefined` when unclassified —\n * supply your own default, e.g. `getRetryable(error) ?? true`.\n */\nexport function getRetryable(error: unknown): boolean | undefined {\n if (typeof error !== \"object\" || error === null) {\n return undefined;\n }\n return Object.getOwnPropertyDescriptor(error, retryableSymbol)?.value as\n | boolean\n | undefined;\n}\n\n/**\n * Base error class for all LangChain errors.\n *\n * All LangChain error classes should extend this class (directly or\n * indirectly). Use `LangChainError.isInstance(obj)` to check if an\n * object is any LangChain error.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(\"hello\");\n * } catch (error) {\n * if (LangChainError.isInstance(error)) {\n * console.log(\"Got a LangChain error:\", error.message);\n * }\n * }\n * ```\n */\nexport class LangChainError extends ns.brand(Error) {\n readonly name: string = \"LangChainError\";\n\n constructor(message?: string) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Error class representing an aborted model operation in LangChain.\n *\n * This error is thrown when a model operation (such as invocation, streaming, or batching)\n * is cancelled before it completes, commonly due to a user-initiated abort signal\n * (e.g., via an AbortController) or an upstream cancellation event.\n *\n * The ModelAbortError provides access to any partial output the model may have produced\n * before the operation was interrupted, which can be useful for resuming work, debugging,\n * or presenting incomplete results to users.\n *\n * @remarks\n * - The `partialOutput` field includes message content that was generated prior to the abort,\n * such as a partial AIMessageChunk.\n * - This error extends the {@link LangChainError} base class with the marker `\"model-abort\"`.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input, { signal: abortController.signal });\n * } catch (err) {\n * if (ModelAbortError.isInstance(err)) {\n * // Handle user cancellation, check err.partialOutput if needed\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ModelAbortError extends ns.brand(LangChainError, \"model-abort\") {\n readonly name = \"ModelAbortError\";\n\n /**\n * The partial message output that was produced before the operation was aborted.\n * This is typically an AIMessageChunk, or could be undefined if no output was available.\n */\n readonly partialOutput?: AIMessageChunk;\n\n /**\n * Constructs a new ModelAbortError instance.\n *\n * @param message - A human-readable message describing the abort event.\n * @param partialOutput - Any partial model output generated before the abort (optional).\n */\n constructor(message: string, partialOutput?: AIMessageChunk) {\n super(message);\n this.partialOutput = partialOutput;\n // Retrying would mean ignoring the caller's explicit abort signal.\n stampRetryable(this, false);\n }\n}\n\n/**\n * Error class representing a context window overflow in a language model operation.\n *\n * This error is thrown when the combined input to a language model (such as prompt tokens,\n * historical messages, and/or instructions) exceeds the maximum context window or token limit\n * that the model can process in a single request. Most models have defined upper limits for the number of\n * tokens or characters allowed in a context, and exceeding this limit will prevent\n * the operation from proceeding.\n *\n * The {@link ContextOverflowError} extends the {@link LangChainError} base class with\n * the marker `\"context-overflow\"`.\n *\n * @remarks\n * - Use this error to programmatically identify cases where a user request, prompt, or input\n * sequence is too long to be handled by the target model.\n * - Model providers and framework integrations should throw this error if they detect\n * a request cannot be processed due to its size.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(veryLongInput);\n * } catch (err) {\n * if (ContextOverflowError.isInstance(err)) {\n * // Handle overflow, e.g., prompt user to shorten input or truncate text\n * console.warn(\"Model context overflow:\", err.message);\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ContextOverflowError extends ns.brand(\n LangChainError,\n \"context-overflow\"\n) {\n readonly name = \"ContextOverflowError\";\n\n /**\n * The underlying error that caused this {@link ContextOverflowError}, if any.\n *\n * This property is optionally set when wrapping a lower-level error using {@link ContextOverflowError.fromError}.\n * It allows error handlers to access or inspect the original error that led to the context overflow.\n */\n cause?: Error;\n\n constructor(message?: string) {\n super(message ?? \"Input exceeded the model's context window.\");\n // The same oversized input fails identically; it needs trimming, not another attempt.\n stampRetryable(this, false);\n }\n\n /**\n * Creates a new {@link ContextOverflowError} instance from an existing error.\n *\n * This static utility copies the message from the provided error and\n * attaches the original error as the {@link ContextOverflowError.cause} property,\n * enabling error handlers to inspect or propagate the original failure.\n *\n * @param obj - The original error object causing the context overflow.\n * @returns A new {@link ContextOverflowError} instance with the original error set as its cause.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input);\n * } catch (err) {\n * throw ContextOverflowError.fromError(err);\n * }\n * ```\n */\n static fromError(obj: Error): ContextOverflowError {\n const error = new ContextOverflowError(obj.message);\n error.cause = obj;\n return error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["baseNs"],"sources":["../../src/errors/index.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */\n\nimport type { AIMessageChunk } from \"../messages/ai.js\";\nimport { ns as baseNs } from \"../utils/namespace.js\";\n\nexport type { BrandedClass } from \"../utils/namespace.js\";\n\nexport type LangChainErrorCodes =\n | \"CONTEXT_OVERFLOW\"\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\"\n | \"MODEL_ABORTED\";\n\n/** @deprecated Subclass LangChainError instead */\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n/** The error namespace for all LangChain errors */\nexport const ns = baseNs.sub(\"error\");\n\n/** Registered globally so duplicate copies of core in one dependency tree agree. */\nconst retryableSymbol = Symbol.for(\"langchain.errors.retryable\");\n\n/**\n * Mark an error as safe or unsafe to retry.\n *\n * Sets a non-enumerable symbol on the error itself, leaving its class and\n * shape untouched, so it is safe to apply to a provider SDK's own error.\n *\n * @param error - The error to mark. Non-objects are returned untouched.\n * @param retryable - `true` if retrying may succeed.\n * @returns The same error instance, for chaining.\n */\nexport function stampRetryable<T>(error: T, retryable: boolean): T {\n if (typeof error !== \"object\" || error === null) {\n return error;\n }\n try {\n Object.defineProperty(error, retryableSymbol, {\n value: retryable,\n configurable: true,\n });\n } catch {\n // Frozen or sealed error object; leave it unmarked rather than throwing.\n }\n return error;\n}\n\n/**\n * Read an error's retryability mark.\n *\n * @returns `true`/`false` when marked, `undefined` when unclassified —\n * supply your own default, e.g. `getRetryable(error) ?? true`.\n */\nexport function getRetryable(error: unknown): boolean | undefined {\n if (typeof error !== \"object\" || error === null) {\n return undefined;\n }\n return Object.getOwnPropertyDescriptor(error, retryableSymbol)?.value as\n | boolean\n | undefined;\n}\n\n/**\n * Base error class for all LangChain errors.\n *\n * All LangChain error classes should extend this class (directly or\n * indirectly). Use `LangChainError.isInstance(obj)` to check if an\n * object is any LangChain error.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(\"hello\");\n * } catch (error) {\n * if (LangChainError.isInstance(error)) {\n * console.log(\"Got a LangChain error:\", error.message);\n * }\n * }\n * ```\n */\nexport class LangChainError extends ns.brand(Error) {\n readonly name: string = \"LangChainError\";\n\n constructor(message?: string) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Error class representing an aborted model operation in LangChain.\n *\n * This error is thrown when a model operation (such as invocation, streaming, or batching)\n * is cancelled before it completes, commonly due to a user-initiated abort signal\n * (e.g., via an AbortController) or an upstream cancellation event.\n *\n * The ModelAbortError provides access to any partial output the model may have produced\n * before the operation was interrupted, which can be useful for resuming work, debugging,\n * or presenting incomplete results to users.\n *\n * @remarks\n * - The `partialOutput` field includes message content that was generated prior to the abort,\n * such as a partial AIMessageChunk.\n * - This error extends the {@link LangChainError} base class with the marker `\"model-abort\"`.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input, { signal: abortController.signal });\n * } catch (err) {\n * if (ModelAbortError.isInstance(err)) {\n * // Handle user cancellation, check err.partialOutput if needed\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ModelAbortError extends ns.brand(LangChainError, \"model-abort\") {\n readonly name = \"ModelAbortError\";\n\n /**\n * The partial message output that was produced before the operation was aborted.\n * This is typically an AIMessageChunk, or could be undefined if no output was available.\n */\n readonly partialOutput?: AIMessageChunk;\n\n /**\n * Constructs a new ModelAbortError instance.\n *\n * @param message - A human-readable message describing the abort event.\n * @param partialOutput - Any partial model output generated before the abort (optional).\n */\n constructor(message: string, partialOutput?: AIMessageChunk) {\n super(message);\n this.partialOutput = partialOutput;\n // Retrying would mean ignoring the caller's explicit abort signal.\n stampRetryable(this, false);\n }\n}\n\n/**\n * Error class representing a context window overflow in a language model operation.\n *\n * This error is thrown when the combined input to a language model (such as prompt tokens,\n * historical messages, and/or instructions) exceeds the maximum context window or token limit\n * that the model can process in a single request. Most models have defined upper limits for the number of\n * tokens or characters allowed in a context, and exceeding this limit will prevent\n * the operation from proceeding.\n *\n * The {@link ContextOverflowError} extends the {@link LangChainError} base class with\n * the marker `\"context-overflow\"`.\n *\n * @remarks\n * - Use this error to programmatically identify cases where a user request, prompt, or input\n * sequence is too long to be handled by the target model.\n * - Model providers and framework integrations should throw this error if they detect\n * a request cannot be processed due to its size.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(veryLongInput);\n * } catch (err) {\n * if (ContextOverflowError.isInstance(err)) {\n * // Handle overflow, e.g., prompt user to shorten input or truncate text\n * console.warn(\"Model context overflow:\", err.message);\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ContextOverflowError extends ns.brand(\n LangChainError,\n \"context-overflow\"\n) {\n readonly name = \"ContextOverflowError\";\n\n /**\n * The underlying error that caused this {@link ContextOverflowError}, if any.\n *\n * This property is optionally set when wrapping a lower-level error using {@link ContextOverflowError.fromError}.\n * It allows error handlers to access or inspect the original error that led to the context overflow.\n */\n cause?: Error;\n\n constructor(message?: string) {\n super(message ?? \"Input exceeded the model's context window.\");\n // The same oversized input fails identically; it needs trimming, not another attempt.\n stampRetryable(this, false);\n }\n\n /**\n * Creates a new {@link ContextOverflowError} instance from an existing error.\n *\n * This static utility copies the message from the provided error and\n * attaches the original error as the {@link ContextOverflowError.cause} property,\n * enabling error handlers to inspect or propagate the original failure.\n *\n * @param obj - The original error object causing the context overflow.\n * @returns A new {@link ContextOverflowError} instance with the original error set as its cause.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input);\n * } catch (err) {\n * throw ContextOverflowError.fromError(err);\n * }\n * ```\n */\n static fromError(obj: Error): ContextOverflowError {\n const error = new ContextOverflowError(obj.message);\n error.cause = obj;\n return error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,wBACd,OACA,eACA;CACA,MAAe,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,sFAAsF,cAAc;CACrI,OAAO;AACT;;AAGA,MAAa,KAAKA,kBAAAA,GAAO,IAAI,OAAO;;AAGpC,MAAM,kBAAkB,OAAO,IAAI,4BAA4B;;;;;;;;;;;AAY/D,SAAgB,eAAkB,OAAU,WAAuB;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC,OAAO;CAET,IAAI;EACF,OAAO,eAAe,OAAO,iBAAiB;GAC5C,OAAO;GACP,cAAc;EAChB,CAAC;CACH,QAAQ,CAER;CACA,OAAO;AACT;;;;;;;AAQA,SAAgB,aAAa,OAAqC;CAChE,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC;CAEF,OAAO,OAAO,yBAAyB,OAAO,eAAe,CAAC,EAAE;AAGlE;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,iBAAb,cAAoC,GAAG,MAAM,KAAK,CAAC,CAAC;CAClD,OAAwB;CAExB,YAAY,SAAkB;EAC5B,MAAM,OAAO;EACb,IAAI,MAAM,mBACR,MAAM,kBAAkB,MAAM,KAAK,WAAW;CAElD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,kBAAb,cAAqC,GAAG,MAAM,gBAAgB,aAAa,CAAC,CAAC;CAC3E,OAAgB;;;;;CAMhB;;;;;;;CAQA,YAAY,SAAiB,eAAgC;EAC3D,MAAM,OAAO;EACb,KAAK,gBAAgB;EAErB,eAAe,MAAM,KAAK;CAC5B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,uBAAb,MAAa,6BAA6B,GAAG,MAC3C,gBACA,kBACF,CAAC,CAAC;CACA,OAAgB;;;;;;;CAQhB;CAEA,YAAY,SAAkB;EAC5B,MAAM,WAAW,4CAA4C;EAE7D,eAAe,MAAM,KAAK;CAC5B;;;;;;;;;;;;;;;;;;;;CAqBA,OAAO,UAAU,KAAkC;EACjD,MAAM,QAAQ,IAAI,qBAAqB,IAAI,OAAO;EAClD,MAAM,QAAQ;EACd,OAAO;CACT;AACF"}
|
package/dist/errors/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AIMessageChunk } from "../messages/ai.cjs";
|
|
2
|
-
import { Namespace } from "../utils/namespace.cjs";
|
|
2
|
+
import { BrandedClass, Namespace } from "../utils/namespace.cjs";
|
|
3
3
|
//#region src/errors/index.d.ts
|
|
4
|
-
type LangChainErrorCodes = "CONTEXT_OVERFLOW" | "INVALID_PROMPT_INPUT" | "INVALID_TOOL_RESULTS" | "MESSAGE_COERCION_FAILURE" | "MODEL_AUTHENTICATION" | "MODEL_NOT_FOUND" | "MODEL_RATE_LIMIT" | "OUTPUT_PARSING_FAILURE" | "MODEL_ABORTED";
|
|
4
|
+
export type LangChainErrorCodes = "CONTEXT_OVERFLOW" | "INVALID_PROMPT_INPUT" | "INVALID_TOOL_RESULTS" | "MESSAGE_COERCION_FAILURE" | "MODEL_AUTHENTICATION" | "MODEL_NOT_FOUND" | "MODEL_RATE_LIMIT" | "OUTPUT_PARSING_FAILURE" | "MODEL_ABORTED";
|
|
5
5
|
/** @deprecated Subclass LangChainError instead */
|
|
6
|
-
declare function addLangChainErrorFields(error: any, lc_error_code: LangChainErrorCodes): any;
|
|
6
|
+
export declare function addLangChainErrorFields(error: any, lc_error_code: LangChainErrorCodes): any;
|
|
7
7
|
/** The error namespace for all LangChain errors */
|
|
8
|
-
declare const ns: Namespace;
|
|
8
|
+
export declare const ns: Namespace;
|
|
9
9
|
/**
|
|
10
10
|
* Mark an error as safe or unsafe to retry.
|
|
11
11
|
*
|
|
@@ -16,17 +16,15 @@ declare const ns: Namespace;
|
|
|
16
16
|
* @param retryable - `true` if retrying may succeed.
|
|
17
17
|
* @returns The same error instance, for chaining.
|
|
18
18
|
*/
|
|
19
|
-
declare function stampRetryable<T>(error: T, retryable: boolean): T;
|
|
19
|
+
export declare function stampRetryable<T>(error: T, retryable: boolean): T;
|
|
20
20
|
/**
|
|
21
21
|
* Read an error's retryability mark.
|
|
22
22
|
*
|
|
23
23
|
* @returns `true`/`false` when marked, `undefined` when unclassified —
|
|
24
24
|
* supply your own default, e.g. `getRetryable(error) ?? true`.
|
|
25
25
|
*/
|
|
26
|
-
declare function getRetryable(error: unknown): boolean | undefined;
|
|
27
|
-
declare const LangChainError_base: ErrorConstructor
|
|
28
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
29
|
-
};
|
|
26
|
+
export declare function getRetryable(error: unknown): boolean | undefined;
|
|
27
|
+
declare const LangChainError_base: BrandedClass<ErrorConstructor>;
|
|
30
28
|
/**
|
|
31
29
|
* Base error class for all LangChain errors.
|
|
32
30
|
*
|
|
@@ -45,13 +43,11 @@ declare const LangChainError_base: ErrorConstructor & {
|
|
|
45
43
|
* }
|
|
46
44
|
* ```
|
|
47
45
|
*/
|
|
48
|
-
declare class LangChainError extends LangChainError_base {
|
|
46
|
+
export declare class LangChainError extends LangChainError_base {
|
|
49
47
|
readonly name: string;
|
|
50
48
|
constructor(message?: string);
|
|
51
49
|
}
|
|
52
|
-
declare const ModelAbortError_base: typeof LangChainError
|
|
53
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
54
|
-
};
|
|
50
|
+
declare const ModelAbortError_base: BrandedClass<typeof LangChainError>;
|
|
55
51
|
/**
|
|
56
52
|
* Error class representing an aborted model operation in LangChain.
|
|
57
53
|
*
|
|
@@ -81,7 +77,7 @@ declare const ModelAbortError_base: typeof LangChainError & {
|
|
|
81
77
|
* }
|
|
82
78
|
* ```
|
|
83
79
|
*/
|
|
84
|
-
declare class ModelAbortError extends ModelAbortError_base {
|
|
80
|
+
export declare class ModelAbortError extends ModelAbortError_base {
|
|
85
81
|
readonly name = "ModelAbortError";
|
|
86
82
|
/**
|
|
87
83
|
* The partial message output that was produced before the operation was aborted.
|
|
@@ -96,9 +92,7 @@ declare class ModelAbortError extends ModelAbortError_base {
|
|
|
96
92
|
*/
|
|
97
93
|
constructor(message: string, partialOutput?: AIMessageChunk);
|
|
98
94
|
}
|
|
99
|
-
declare const ContextOverflowError_base: typeof LangChainError
|
|
100
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
101
|
-
};
|
|
95
|
+
declare const ContextOverflowError_base: BrandedClass<typeof LangChainError>;
|
|
102
96
|
/**
|
|
103
97
|
* Error class representing a context window overflow in a language model operation.
|
|
104
98
|
*
|
|
@@ -131,7 +125,7 @@ declare const ContextOverflowError_base: typeof LangChainError & {
|
|
|
131
125
|
* }
|
|
132
126
|
* ```
|
|
133
127
|
*/
|
|
134
|
-
declare class ContextOverflowError extends ContextOverflowError_base {
|
|
128
|
+
export declare class ContextOverflowError extends ContextOverflowError_base {
|
|
135
129
|
readonly name = "ContextOverflowError";
|
|
136
130
|
/**
|
|
137
131
|
* The underlying error that caused this {@link ContextOverflowError}, if any.
|
|
@@ -163,5 +157,5 @@ declare class ContextOverflowError extends ContextOverflowError_base {
|
|
|
163
157
|
static fromError(obj: Error): ContextOverflowError;
|
|
164
158
|
}
|
|
165
159
|
//#endregion
|
|
166
|
-
export {
|
|
160
|
+
export type { BrandedClass };
|
|
167
161
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/errors/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["_$___utils_namespace_js0.Namespace","_$__index_js0.BrandedClass"],"sources":["../../src/errors/index.ts"],"mappings":";;;YAOY;;wBAYI,wBACd,YACA,eAAe;;qBAQJ,IAAAA;;;;;;;;;;;wBAeG,eAAe,GAAG,OAAO,GAAG,qBAAqB;;;;;;;wBAqBjD,aAAa;;;;;;;;;;;;;;;;;;;;qBA2BhB,uBAAuB;WACzB;EAET,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCD,wBAAwB;WAC1B;;;;;WAMA,gBAAgB;;;;;;;EAQzB,YAAY,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwClC,6BAA6B;WAI/B;;;;;;;EAQT,QAAQ;EAER,YAAY;;;;;;;;;;;;;;;;;;;;SAyBL,UAAU,KAAK,QAAQ"}
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AIMessageChunk } from "../messages/ai.js";
|
|
2
|
-
import { Namespace } from "../utils/namespace.js";
|
|
2
|
+
import { BrandedClass, Namespace } from "../utils/namespace.js";
|
|
3
3
|
//#region src/errors/index.d.ts
|
|
4
|
-
type LangChainErrorCodes = "CONTEXT_OVERFLOW" | "INVALID_PROMPT_INPUT" | "INVALID_TOOL_RESULTS" | "MESSAGE_COERCION_FAILURE" | "MODEL_AUTHENTICATION" | "MODEL_NOT_FOUND" | "MODEL_RATE_LIMIT" | "OUTPUT_PARSING_FAILURE" | "MODEL_ABORTED";
|
|
4
|
+
export type LangChainErrorCodes = "CONTEXT_OVERFLOW" | "INVALID_PROMPT_INPUT" | "INVALID_TOOL_RESULTS" | "MESSAGE_COERCION_FAILURE" | "MODEL_AUTHENTICATION" | "MODEL_NOT_FOUND" | "MODEL_RATE_LIMIT" | "OUTPUT_PARSING_FAILURE" | "MODEL_ABORTED";
|
|
5
5
|
/** @deprecated Subclass LangChainError instead */
|
|
6
|
-
declare function addLangChainErrorFields(error: any, lc_error_code: LangChainErrorCodes): any;
|
|
6
|
+
export declare function addLangChainErrorFields(error: any, lc_error_code: LangChainErrorCodes): any;
|
|
7
7
|
/** The error namespace for all LangChain errors */
|
|
8
|
-
declare const ns: Namespace;
|
|
8
|
+
export declare const ns: Namespace;
|
|
9
9
|
/**
|
|
10
10
|
* Mark an error as safe or unsafe to retry.
|
|
11
11
|
*
|
|
@@ -16,17 +16,15 @@ declare const ns: Namespace;
|
|
|
16
16
|
* @param retryable - `true` if retrying may succeed.
|
|
17
17
|
* @returns The same error instance, for chaining.
|
|
18
18
|
*/
|
|
19
|
-
declare function stampRetryable<T>(error: T, retryable: boolean): T;
|
|
19
|
+
export declare function stampRetryable<T>(error: T, retryable: boolean): T;
|
|
20
20
|
/**
|
|
21
21
|
* Read an error's retryability mark.
|
|
22
22
|
*
|
|
23
23
|
* @returns `true`/`false` when marked, `undefined` when unclassified —
|
|
24
24
|
* supply your own default, e.g. `getRetryable(error) ?? true`.
|
|
25
25
|
*/
|
|
26
|
-
declare function getRetryable(error: unknown): boolean | undefined;
|
|
27
|
-
declare const LangChainError_base: ErrorConstructor
|
|
28
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
29
|
-
};
|
|
26
|
+
export declare function getRetryable(error: unknown): boolean | undefined;
|
|
27
|
+
declare const LangChainError_base: BrandedClass<ErrorConstructor>;
|
|
30
28
|
/**
|
|
31
29
|
* Base error class for all LangChain errors.
|
|
32
30
|
*
|
|
@@ -45,13 +43,11 @@ declare const LangChainError_base: ErrorConstructor & {
|
|
|
45
43
|
* }
|
|
46
44
|
* ```
|
|
47
45
|
*/
|
|
48
|
-
declare class LangChainError extends LangChainError_base {
|
|
46
|
+
export declare class LangChainError extends LangChainError_base {
|
|
49
47
|
readonly name: string;
|
|
50
48
|
constructor(message?: string);
|
|
51
49
|
}
|
|
52
|
-
declare const ModelAbortError_base: typeof LangChainError
|
|
53
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
54
|
-
};
|
|
50
|
+
declare const ModelAbortError_base: BrandedClass<typeof LangChainError>;
|
|
55
51
|
/**
|
|
56
52
|
* Error class representing an aborted model operation in LangChain.
|
|
57
53
|
*
|
|
@@ -81,7 +77,7 @@ declare const ModelAbortError_base: typeof LangChainError & {
|
|
|
81
77
|
* }
|
|
82
78
|
* ```
|
|
83
79
|
*/
|
|
84
|
-
declare class ModelAbortError extends ModelAbortError_base {
|
|
80
|
+
export declare class ModelAbortError extends ModelAbortError_base {
|
|
85
81
|
readonly name = "ModelAbortError";
|
|
86
82
|
/**
|
|
87
83
|
* The partial message output that was produced before the operation was aborted.
|
|
@@ -96,9 +92,7 @@ declare class ModelAbortError extends ModelAbortError_base {
|
|
|
96
92
|
*/
|
|
97
93
|
constructor(message: string, partialOutput?: AIMessageChunk);
|
|
98
94
|
}
|
|
99
|
-
declare const ContextOverflowError_base: typeof LangChainError
|
|
100
|
-
isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
|
|
101
|
-
};
|
|
95
|
+
declare const ContextOverflowError_base: BrandedClass<typeof LangChainError>;
|
|
102
96
|
/**
|
|
103
97
|
* Error class representing a context window overflow in a language model operation.
|
|
104
98
|
*
|
|
@@ -131,7 +125,7 @@ declare const ContextOverflowError_base: typeof LangChainError & {
|
|
|
131
125
|
* }
|
|
132
126
|
* ```
|
|
133
127
|
*/
|
|
134
|
-
declare class ContextOverflowError extends ContextOverflowError_base {
|
|
128
|
+
export declare class ContextOverflowError extends ContextOverflowError_base {
|
|
135
129
|
readonly name = "ContextOverflowError";
|
|
136
130
|
/**
|
|
137
131
|
* The underlying error that caused this {@link ContextOverflowError}, if any.
|
|
@@ -163,5 +157,5 @@ declare class ContextOverflowError extends ContextOverflowError_base {
|
|
|
163
157
|
static fromError(obj: Error): ContextOverflowError;
|
|
164
158
|
}
|
|
165
159
|
//#endregion
|
|
166
|
-
export {
|
|
160
|
+
export type { BrandedClass };
|
|
167
161
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/errors/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$___utils_namespace_js0.Namespace","_$__index_js0.BrandedClass"],"sources":["../../src/errors/index.ts"],"mappings":";;;YAOY;;wBAYI,wBACd,YACA,eAAe;;qBAQJ,IAAAA;;;;;;;;;;;wBAeG,eAAe,GAAG,OAAO,GAAG,qBAAqB;;;;;;;wBAqBjD,aAAa;;;;;;;;;;;;;;;;;;;;qBA2BhB,uBAAuB;WACzB;EAET,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCD,wBAAwB;WAC1B;;;;;WAMA,gBAAgB;;;;;;;EAQzB,YAAY,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwClC,6BAA6B;WAI/B;;;;;;;EAQT,QAAQ;EAER,YAAY;;;;;;;;;;;;;;;;;;;;SAyBL,UAAU,KAAK,QAAQ"}
|
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["baseNs"],"sources":["../../src/errors/index.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */\n\nimport type { AIMessageChunk } from \"../messages/ai.js\";\nimport { ns as baseNs } from \"../utils/namespace.js\";\n\nexport type LangChainErrorCodes =\n | \"CONTEXT_OVERFLOW\"\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\"\n | \"MODEL_ABORTED\";\n\n/** @deprecated Subclass LangChainError instead */\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n/** The error namespace for all LangChain errors */\nexport const ns = baseNs.sub(\"error\");\n\n/** Registered globally so duplicate copies of core in one dependency tree agree. */\nconst retryableSymbol = Symbol.for(\"langchain.errors.retryable\");\n\n/**\n * Mark an error as safe or unsafe to retry.\n *\n * Sets a non-enumerable symbol on the error itself, leaving its class and\n * shape untouched, so it is safe to apply to a provider SDK's own error.\n *\n * @param error - The error to mark. Non-objects are returned untouched.\n * @param retryable - `true` if retrying may succeed.\n * @returns The same error instance, for chaining.\n */\nexport function stampRetryable<T>(error: T, retryable: boolean): T {\n if (typeof error !== \"object\" || error === null) {\n return error;\n }\n try {\n Object.defineProperty(error, retryableSymbol, {\n value: retryable,\n configurable: true,\n });\n } catch {\n // Frozen or sealed error object; leave it unmarked rather than throwing.\n }\n return error;\n}\n\n/**\n * Read an error's retryability mark.\n *\n * @returns `true`/`false` when marked, `undefined` when unclassified —\n * supply your own default, e.g. `getRetryable(error) ?? true`.\n */\nexport function getRetryable(error: unknown): boolean | undefined {\n if (typeof error !== \"object\" || error === null) {\n return undefined;\n }\n return Object.getOwnPropertyDescriptor(error, retryableSymbol)?.value as\n | boolean\n | undefined;\n}\n\n/**\n * Base error class for all LangChain errors.\n *\n * All LangChain error classes should extend this class (directly or\n * indirectly). Use `LangChainError.isInstance(obj)` to check if an\n * object is any LangChain error.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(\"hello\");\n * } catch (error) {\n * if (LangChainError.isInstance(error)) {\n * console.log(\"Got a LangChain error:\", error.message);\n * }\n * }\n * ```\n */\nexport class LangChainError extends ns.brand(Error) {\n readonly name: string = \"LangChainError\";\n\n constructor(message?: string) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Error class representing an aborted model operation in LangChain.\n *\n * This error is thrown when a model operation (such as invocation, streaming, or batching)\n * is cancelled before it completes, commonly due to a user-initiated abort signal\n * (e.g., via an AbortController) or an upstream cancellation event.\n *\n * The ModelAbortError provides access to any partial output the model may have produced\n * before the operation was interrupted, which can be useful for resuming work, debugging,\n * or presenting incomplete results to users.\n *\n * @remarks\n * - The `partialOutput` field includes message content that was generated prior to the abort,\n * such as a partial AIMessageChunk.\n * - This error extends the {@link LangChainError} base class with the marker `\"model-abort\"`.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input, { signal: abortController.signal });\n * } catch (err) {\n * if (ModelAbortError.isInstance(err)) {\n * // Handle user cancellation, check err.partialOutput if needed\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ModelAbortError extends ns.brand(LangChainError, \"model-abort\") {\n readonly name = \"ModelAbortError\";\n\n /**\n * The partial message output that was produced before the operation was aborted.\n * This is typically an AIMessageChunk, or could be undefined if no output was available.\n */\n readonly partialOutput?: AIMessageChunk;\n\n /**\n * Constructs a new ModelAbortError instance.\n *\n * @param message - A human-readable message describing the abort event.\n * @param partialOutput - Any partial model output generated before the abort (optional).\n */\n constructor(message: string, partialOutput?: AIMessageChunk) {\n super(message);\n this.partialOutput = partialOutput;\n // Retrying would mean ignoring the caller's explicit abort signal.\n stampRetryable(this, false);\n }\n}\n\n/**\n * Error class representing a context window overflow in a language model operation.\n *\n * This error is thrown when the combined input to a language model (such as prompt tokens,\n * historical messages, and/or instructions) exceeds the maximum context window or token limit\n * that the model can process in a single request. Most models have defined upper limits for the number of\n * tokens or characters allowed in a context, and exceeding this limit will prevent\n * the operation from proceeding.\n *\n * The {@link ContextOverflowError} extends the {@link LangChainError} base class with\n * the marker `\"context-overflow\"`.\n *\n * @remarks\n * - Use this error to programmatically identify cases where a user request, prompt, or input\n * sequence is too long to be handled by the target model.\n * - Model providers and framework integrations should throw this error if they detect\n * a request cannot be processed due to its size.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(veryLongInput);\n * } catch (err) {\n * if (ContextOverflowError.isInstance(err)) {\n * // Handle overflow, e.g., prompt user to shorten input or truncate text\n * console.warn(\"Model context overflow:\", err.message);\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ContextOverflowError extends ns.brand(\n LangChainError,\n \"context-overflow\"\n) {\n readonly name = \"ContextOverflowError\";\n\n /**\n * The underlying error that caused this {@link ContextOverflowError}, if any.\n *\n * This property is optionally set when wrapping a lower-level error using {@link ContextOverflowError.fromError}.\n * It allows error handlers to access or inspect the original error that led to the context overflow.\n */\n cause?: Error;\n\n constructor(message?: string) {\n super(message ?? \"Input exceeded the model's context window.\");\n // The same oversized input fails identically; it needs trimming, not another attempt.\n stampRetryable(this, false);\n }\n\n /**\n * Creates a new {@link ContextOverflowError} instance from an existing error.\n *\n * This static utility copies the message from the provided error and\n * attaches the original error as the {@link ContextOverflowError.cause} property,\n * enabling error handlers to inspect or propagate the original failure.\n *\n * @param obj - The original error object causing the context overflow.\n * @returns A new {@link ContextOverflowError} instance with the original error set as its cause.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input);\n * } catch (err) {\n * throw ContextOverflowError.fromError(err);\n * }\n * ```\n */\n static fromError(obj: Error): ContextOverflowError {\n const error = new ContextOverflowError(obj.message);\n error.cause = obj;\n return error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["baseNs"],"sources":["../../src/errors/index.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */\n\nimport type { AIMessageChunk } from \"../messages/ai.js\";\nimport { ns as baseNs } from \"../utils/namespace.js\";\n\nexport type { BrandedClass } from \"../utils/namespace.js\";\n\nexport type LangChainErrorCodes =\n | \"CONTEXT_OVERFLOW\"\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\"\n | \"MODEL_ABORTED\";\n\n/** @deprecated Subclass LangChainError instead */\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n/** The error namespace for all LangChain errors */\nexport const ns = baseNs.sub(\"error\");\n\n/** Registered globally so duplicate copies of core in one dependency tree agree. */\nconst retryableSymbol = Symbol.for(\"langchain.errors.retryable\");\n\n/**\n * Mark an error as safe or unsafe to retry.\n *\n * Sets a non-enumerable symbol on the error itself, leaving its class and\n * shape untouched, so it is safe to apply to a provider SDK's own error.\n *\n * @param error - The error to mark. Non-objects are returned untouched.\n * @param retryable - `true` if retrying may succeed.\n * @returns The same error instance, for chaining.\n */\nexport function stampRetryable<T>(error: T, retryable: boolean): T {\n if (typeof error !== \"object\" || error === null) {\n return error;\n }\n try {\n Object.defineProperty(error, retryableSymbol, {\n value: retryable,\n configurable: true,\n });\n } catch {\n // Frozen or sealed error object; leave it unmarked rather than throwing.\n }\n return error;\n}\n\n/**\n * Read an error's retryability mark.\n *\n * @returns `true`/`false` when marked, `undefined` when unclassified —\n * supply your own default, e.g. `getRetryable(error) ?? true`.\n */\nexport function getRetryable(error: unknown): boolean | undefined {\n if (typeof error !== \"object\" || error === null) {\n return undefined;\n }\n return Object.getOwnPropertyDescriptor(error, retryableSymbol)?.value as\n | boolean\n | undefined;\n}\n\n/**\n * Base error class for all LangChain errors.\n *\n * All LangChain error classes should extend this class (directly or\n * indirectly). Use `LangChainError.isInstance(obj)` to check if an\n * object is any LangChain error.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(\"hello\");\n * } catch (error) {\n * if (LangChainError.isInstance(error)) {\n * console.log(\"Got a LangChain error:\", error.message);\n * }\n * }\n * ```\n */\nexport class LangChainError extends ns.brand(Error) {\n readonly name: string = \"LangChainError\";\n\n constructor(message?: string) {\n super(message);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Error class representing an aborted model operation in LangChain.\n *\n * This error is thrown when a model operation (such as invocation, streaming, or batching)\n * is cancelled before it completes, commonly due to a user-initiated abort signal\n * (e.g., via an AbortController) or an upstream cancellation event.\n *\n * The ModelAbortError provides access to any partial output the model may have produced\n * before the operation was interrupted, which can be useful for resuming work, debugging,\n * or presenting incomplete results to users.\n *\n * @remarks\n * - The `partialOutput` field includes message content that was generated prior to the abort,\n * such as a partial AIMessageChunk.\n * - This error extends the {@link LangChainError} base class with the marker `\"model-abort\"`.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input, { signal: abortController.signal });\n * } catch (err) {\n * if (ModelAbortError.isInstance(err)) {\n * // Handle user cancellation, check err.partialOutput if needed\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ModelAbortError extends ns.brand(LangChainError, \"model-abort\") {\n readonly name = \"ModelAbortError\";\n\n /**\n * The partial message output that was produced before the operation was aborted.\n * This is typically an AIMessageChunk, or could be undefined if no output was available.\n */\n readonly partialOutput?: AIMessageChunk;\n\n /**\n * Constructs a new ModelAbortError instance.\n *\n * @param message - A human-readable message describing the abort event.\n * @param partialOutput - Any partial model output generated before the abort (optional).\n */\n constructor(message: string, partialOutput?: AIMessageChunk) {\n super(message);\n this.partialOutput = partialOutput;\n // Retrying would mean ignoring the caller's explicit abort signal.\n stampRetryable(this, false);\n }\n}\n\n/**\n * Error class representing a context window overflow in a language model operation.\n *\n * This error is thrown when the combined input to a language model (such as prompt tokens,\n * historical messages, and/or instructions) exceeds the maximum context window or token limit\n * that the model can process in a single request. Most models have defined upper limits for the number of\n * tokens or characters allowed in a context, and exceeding this limit will prevent\n * the operation from proceeding.\n *\n * The {@link ContextOverflowError} extends the {@link LangChainError} base class with\n * the marker `\"context-overflow\"`.\n *\n * @remarks\n * - Use this error to programmatically identify cases where a user request, prompt, or input\n * sequence is too long to be handled by the target model.\n * - Model providers and framework integrations should throw this error if they detect\n * a request cannot be processed due to its size.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(veryLongInput);\n * } catch (err) {\n * if (ContextOverflowError.isInstance(err)) {\n * // Handle overflow, e.g., prompt user to shorten input or truncate text\n * console.warn(\"Model context overflow:\", err.message);\n * } else {\n * throw err;\n * }\n * }\n * ```\n */\nexport class ContextOverflowError extends ns.brand(\n LangChainError,\n \"context-overflow\"\n) {\n readonly name = \"ContextOverflowError\";\n\n /**\n * The underlying error that caused this {@link ContextOverflowError}, if any.\n *\n * This property is optionally set when wrapping a lower-level error using {@link ContextOverflowError.fromError}.\n * It allows error handlers to access or inspect the original error that led to the context overflow.\n */\n cause?: Error;\n\n constructor(message?: string) {\n super(message ?? \"Input exceeded the model's context window.\");\n // The same oversized input fails identically; it needs trimming, not another attempt.\n stampRetryable(this, false);\n }\n\n /**\n * Creates a new {@link ContextOverflowError} instance from an existing error.\n *\n * This static utility copies the message from the provided error and\n * attaches the original error as the {@link ContextOverflowError.cause} property,\n * enabling error handlers to inspect or propagate the original failure.\n *\n * @param obj - The original error object causing the context overflow.\n * @returns A new {@link ContextOverflowError} instance with the original error set as its cause.\n *\n * @example\n * ```typescript\n * try {\n * await model.invoke(input);\n * } catch (err) {\n * throw ContextOverflowError.fromError(err);\n * }\n * ```\n */\n static fromError(obj: Error): ContextOverflowError {\n const error = new ContextOverflowError(obj.message);\n error.cause = obj;\n return error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,SAAgB,wBACd,OACA,eACA;CACA,MAAe,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,sFAAsF,cAAc;CACrI,OAAO;AACT;;AAGA,MAAa,KAAKA,KAAO,IAAI,OAAO;;AAGpC,MAAM,kBAAkB,OAAO,IAAI,4BAA4B;;;;;;;;;;;AAY/D,SAAgB,eAAkB,OAAU,WAAuB;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC,OAAO;CAET,IAAI;EACF,OAAO,eAAe,OAAO,iBAAiB;GAC5C,OAAO;GACP,cAAc;EAChB,CAAC;CACH,QAAQ,CAER;CACA,OAAO;AACT;;;;;;;AAQA,SAAgB,aAAa,OAAqC;CAChE,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC;CAEF,OAAO,OAAO,yBAAyB,OAAO,eAAe,CAAC,EAAE;AAGlE;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,iBAAb,cAAoC,GAAG,MAAM,KAAK,CAAC,CAAC;CAClD,OAAwB;CAExB,YAAY,SAAkB;EAC5B,MAAM,OAAO;EACb,IAAI,MAAM,mBACR,MAAM,kBAAkB,MAAM,KAAK,WAAW;CAElD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,kBAAb,cAAqC,GAAG,MAAM,gBAAgB,aAAa,CAAC,CAAC;CAC3E,OAAgB;;;;;CAMhB;;;;;;;CAQA,YAAY,SAAiB,eAAgC;EAC3D,MAAM,OAAO;EACb,KAAK,gBAAgB;EAErB,eAAe,MAAM,KAAK;CAC5B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,uBAAb,MAAa,6BAA6B,GAAG,MAC3C,gBACA,kBACF,CAAC,CAAC;CACA,OAAgB;;;;;;;CAQhB;CAEA,YAAY,SAAkB;EAC5B,MAAM,WAAW,4CAA4C;EAE7D,eAAe,MAAM,KAAK;CAC5B;;;;;;;;;;;;;;;;;;;;CAqBA,OAAO,UAAU,KAAkC;EACjD,MAAM,QAAQ,IAAI,qBAAqB,IAAI,OAAO;EAClD,MAAM,QAAQ;EACd,OAAO;CACT;AACF"}
|
|
@@ -4,7 +4,7 @@ import { Example } from "../prompts/base.cjs";
|
|
|
4
4
|
/**
|
|
5
5
|
* Base class for example selectors.
|
|
6
6
|
*/
|
|
7
|
-
declare abstract class BaseExampleSelector extends Serializable {
|
|
7
|
+
export declare abstract class BaseExampleSelector extends Serializable {
|
|
8
8
|
lc_namespace: string[];
|
|
9
9
|
/**
|
|
10
10
|
* Adds an example to the example selector.
|
|
@@ -20,5 +20,4 @@ declare abstract class BaseExampleSelector extends Serializable {
|
|
|
20
20
|
abstract selectExamples(input_variables: Example): Promise<Example[]>;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export { BaseExampleSelector };
|
|
24
23
|
//# sourceMappingURL=base.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/example_selectors/base.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/example_selectors/base.ts"],"mappings":";;;;;;8BAMsB,4BAA4B;EAChD;;;;;;WAOS,WAAW,SAAS,UAAU;;;;;;WAO9B,eAAe,iBAAiB,UAAU,QAAQ"}
|
|
@@ -4,7 +4,7 @@ import { Example } from "../prompts/base.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Base class for example selectors.
|
|
6
6
|
*/
|
|
7
|
-
declare abstract class BaseExampleSelector extends Serializable {
|
|
7
|
+
export declare abstract class BaseExampleSelector extends Serializable {
|
|
8
8
|
lc_namespace: string[];
|
|
9
9
|
/**
|
|
10
10
|
* Adds an example to the example selector.
|
|
@@ -20,5 +20,4 @@ declare abstract class BaseExampleSelector extends Serializable {
|
|
|
20
20
|
abstract selectExamples(input_variables: Example): Promise<Example[]>;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export { BaseExampleSelector };
|
|
24
23
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/example_selectors/base.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/example_selectors/base.ts"],"mappings":";;;;;;8BAMsB,4BAA4B;EAChD;;;;;;WAOS,WAAW,SAAS,UAAU;;;;;;WAO9B,eAAe,iBAAiB,UAAU,QAAQ"}
|
|
@@ -4,14 +4,14 @@ import { BasePromptTemplate } from "../prompts/base.cjs";
|
|
|
4
4
|
import { BaseChatModel } from "../language_models/chat_models.cjs";
|
|
5
5
|
import { BaseLLM } from "../language_models/llms.cjs";
|
|
6
6
|
//#region src/example_selectors/conditional.d.ts
|
|
7
|
-
type BaseGetPromptAsyncOptions = {
|
|
7
|
+
export type BaseGetPromptAsyncOptions = {
|
|
8
8
|
partialVariables?: PartialValues;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Abstract class that defines the interface for selecting a prompt for a
|
|
12
12
|
* given language model.
|
|
13
13
|
*/
|
|
14
|
-
declare abstract class BasePromptSelector {
|
|
14
|
+
export declare abstract class BasePromptSelector {
|
|
15
15
|
/**
|
|
16
16
|
* Abstract method that must be implemented by any class that extends
|
|
17
17
|
* `BasePromptSelector`. It takes a language model as an argument and
|
|
@@ -34,7 +34,7 @@ declare abstract class BasePromptSelector {
|
|
|
34
34
|
* based on a set of conditions. It has a default prompt that it returns
|
|
35
35
|
* if none of the conditions are met.
|
|
36
36
|
*/
|
|
37
|
-
declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
37
|
+
export declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
38
38
|
defaultPrompt: BasePromptTemplate;
|
|
39
39
|
conditionals: Array<[condition: (llm: BaseLanguageModelInterface) => boolean, prompt: BasePromptTemplate]>;
|
|
40
40
|
constructor(default_prompt: BasePromptTemplate, conditionals?: Array<[condition: (llm: BaseLanguageModelInterface) => boolean, prompt: BasePromptTemplate]>);
|
|
@@ -50,12 +50,11 @@ declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
|
50
50
|
* Type guard function that checks if a given language model is of type
|
|
51
51
|
* `BaseLLM`.
|
|
52
52
|
*/
|
|
53
|
-
declare function isLLM(llm: BaseLanguageModelInterface): llm is BaseLLM;
|
|
53
|
+
export declare function isLLM(llm: BaseLanguageModelInterface): llm is BaseLLM;
|
|
54
54
|
/**
|
|
55
55
|
* Type guard function that checks if a given language model is of type
|
|
56
56
|
* `BaseChatModel`.
|
|
57
57
|
*/
|
|
58
|
-
declare function isChatModel(llm: BaseLanguageModelInterface): llm is BaseChatModel;
|
|
58
|
+
export declare function isChatModel(llm: BaseLanguageModelInterface): llm is BaseChatModel;
|
|
59
59
|
//#endregion
|
|
60
|
-
export { BaseGetPromptAsyncOptions, BasePromptSelector, ConditionalPromptSelector, isChatModel, isLLM };
|
|
61
60
|
//# sourceMappingURL=conditional.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.d.cts","names":[],"sources":["../../src/example_selectors/conditional.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"conditional.d.cts","names":[],"sources":["../../src/example_selectors/conditional.ts"],"mappings":";;;;;;YAMY;EACV,mBAAmB;;;;;;8BAOC;;;;;;;;WAQX,UAAU,KAAK,6BAA6B;;;;;;;;EAS/C,eACJ,KAAK,4BACL,UAAU,4BACT,QAAQ;;;;;;;qBAWA,kCAAkC;EAC7C,eAAe;EAEf,cAAc,OAEV,YAAY,KAAK,wCACjB,QAAQ;EAIZ,YACE,gBAAgB,oBAChB,eAAc,OAEV,YAAY,KAAK,wCACjB,QAAQ;;;;;;;EAed,UAAU,KAAK,6BAA6B;;;;;;wBAc9B,MAAM,KAAK,6BAA6B,OAAO;;;;;wBAQ/C,YACd,KAAK,6BACJ,OAAO"}
|
|
@@ -4,14 +4,14 @@ import { BasePromptTemplate } from "../prompts/base.js";
|
|
|
4
4
|
import { BaseChatModel } from "../language_models/chat_models.js";
|
|
5
5
|
import { BaseLLM } from "../language_models/llms.js";
|
|
6
6
|
//#region src/example_selectors/conditional.d.ts
|
|
7
|
-
type BaseGetPromptAsyncOptions = {
|
|
7
|
+
export type BaseGetPromptAsyncOptions = {
|
|
8
8
|
partialVariables?: PartialValues;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Abstract class that defines the interface for selecting a prompt for a
|
|
12
12
|
* given language model.
|
|
13
13
|
*/
|
|
14
|
-
declare abstract class BasePromptSelector {
|
|
14
|
+
export declare abstract class BasePromptSelector {
|
|
15
15
|
/**
|
|
16
16
|
* Abstract method that must be implemented by any class that extends
|
|
17
17
|
* `BasePromptSelector`. It takes a language model as an argument and
|
|
@@ -34,7 +34,7 @@ declare abstract class BasePromptSelector {
|
|
|
34
34
|
* based on a set of conditions. It has a default prompt that it returns
|
|
35
35
|
* if none of the conditions are met.
|
|
36
36
|
*/
|
|
37
|
-
declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
37
|
+
export declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
38
38
|
defaultPrompt: BasePromptTemplate;
|
|
39
39
|
conditionals: Array<[condition: (llm: BaseLanguageModelInterface) => boolean, prompt: BasePromptTemplate]>;
|
|
40
40
|
constructor(default_prompt: BasePromptTemplate, conditionals?: Array<[condition: (llm: BaseLanguageModelInterface) => boolean, prompt: BasePromptTemplate]>);
|
|
@@ -50,12 +50,11 @@ declare class ConditionalPromptSelector extends BasePromptSelector {
|
|
|
50
50
|
* Type guard function that checks if a given language model is of type
|
|
51
51
|
* `BaseLLM`.
|
|
52
52
|
*/
|
|
53
|
-
declare function isLLM(llm: BaseLanguageModelInterface): llm is BaseLLM;
|
|
53
|
+
export declare function isLLM(llm: BaseLanguageModelInterface): llm is BaseLLM;
|
|
54
54
|
/**
|
|
55
55
|
* Type guard function that checks if a given language model is of type
|
|
56
56
|
* `BaseChatModel`.
|
|
57
57
|
*/
|
|
58
|
-
declare function isChatModel(llm: BaseLanguageModelInterface): llm is BaseChatModel;
|
|
58
|
+
export declare function isChatModel(llm: BaseLanguageModelInterface): llm is BaseChatModel;
|
|
59
59
|
//#endregion
|
|
60
|
-
export { BaseGetPromptAsyncOptions, BasePromptSelector, ConditionalPromptSelector, isChatModel, isLLM };
|
|
61
60
|
//# sourceMappingURL=conditional.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.d.ts","names":[],"sources":["../../src/example_selectors/conditional.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"conditional.d.ts","names":[],"sources":["../../src/example_selectors/conditional.ts"],"mappings":";;;;;;YAMY;EACV,mBAAmB;;;;;;8BAOC;;;;;;;;WAQX,UAAU,KAAK,6BAA6B;;;;;;;;EAS/C,eACJ,KAAK,4BACL,UAAU,4BACT,QAAQ;;;;;;;qBAWA,kCAAkC;EAC7C,eAAe;EAEf,cAAc,OAEV,YAAY,KAAK,wCACjB,QAAQ;EAIZ,YACE,gBAAgB,oBAChB,eAAc,OAEV,YAAY,KAAK,wCACjB,QAAQ;;;;;;;EAed,UAAU,KAAK,6BAA6B;;;;;;wBAc9B,MAAM,KAAK,6BAA6B,OAAO;;;;;wBAQ/C,YACd,KAAK,6BACJ,OAAO"}
|
|
@@ -6,7 +6,7 @@ import { PromptTemplate } from "../prompts/prompt.cjs";
|
|
|
6
6
|
* Interface for the input parameters of the LengthBasedExampleSelector
|
|
7
7
|
* class.
|
|
8
8
|
*/
|
|
9
|
-
interface LengthBasedExampleSelectorInput {
|
|
9
|
+
export interface LengthBasedExampleSelectorInput {
|
|
10
10
|
examplePrompt: PromptTemplate;
|
|
11
11
|
maxLength?: number;
|
|
12
12
|
getTextLength?: (text: string) => number;
|
|
@@ -52,7 +52,7 @@ interface LengthBasedExampleSelectorInput {
|
|
|
52
52
|
* );
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
55
|
+
export declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
56
56
|
protected examples: Example[];
|
|
57
57
|
examplePrompt: PromptTemplate;
|
|
58
58
|
getTextLength: (text: string) => number;
|
|
@@ -89,5 +89,4 @@ declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
|
89
89
|
static fromExamples(examples: Example[], args: LengthBasedExampleSelectorInput): Promise<LengthBasedExampleSelector>;
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
|
-
export { LengthBasedExampleSelector, LengthBasedExampleSelectorInput };
|
|
93
92
|
//# sourceMappingURL=length_based.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"length_based.d.cts","names":[],"sources":["../../src/example_selectors/length_based.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"length_based.d.cts","names":[],"sources":["../../src/example_selectors/length_based.ts"],"mappings":";;;;;;;;iBAeiB;EACf,eAAe;EACf;EACA,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4CN,mCAAmC;YACpC,UAAU;EAEpB,eAAgB;EAEhB,gBAAgB;EAEhB;EAEA;EAEA,YAAY,MAAM;;;;;;EAYZ,WAAW,SAAS,UAAU;;;;;;;EAY9B,4BACJ,aACA,QAAQ,6BACP;;;;;;;EAkBG,eAAe,gBAAgB,UAAU,QAAQ;;;;;;;;SA2B1C,aACX,UAAU,WACV,MAAM,kCAA+B,QAAA"}
|
|
@@ -6,7 +6,7 @@ import { PromptTemplate } from "../prompts/prompt.js";
|
|
|
6
6
|
* Interface for the input parameters of the LengthBasedExampleSelector
|
|
7
7
|
* class.
|
|
8
8
|
*/
|
|
9
|
-
interface LengthBasedExampleSelectorInput {
|
|
9
|
+
export interface LengthBasedExampleSelectorInput {
|
|
10
10
|
examplePrompt: PromptTemplate;
|
|
11
11
|
maxLength?: number;
|
|
12
12
|
getTextLength?: (text: string) => number;
|
|
@@ -52,7 +52,7 @@ interface LengthBasedExampleSelectorInput {
|
|
|
52
52
|
* );
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
55
|
+
export declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
56
56
|
protected examples: Example[];
|
|
57
57
|
examplePrompt: PromptTemplate;
|
|
58
58
|
getTextLength: (text: string) => number;
|
|
@@ -89,5 +89,4 @@ declare class LengthBasedExampleSelector extends BaseExampleSelector {
|
|
|
89
89
|
static fromExamples(examples: Example[], args: LengthBasedExampleSelectorInput): Promise<LengthBasedExampleSelector>;
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
|
-
export { LengthBasedExampleSelector, LengthBasedExampleSelectorInput };
|
|
93
92
|
//# sourceMappingURL=length_based.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"length_based.d.ts","names":[],"sources":["../../src/example_selectors/length_based.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"length_based.d.ts","names":[],"sources":["../../src/example_selectors/length_based.ts"],"mappings":";;;;;;;;iBAeiB;EACf,eAAe;EACf;EACA,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4CN,mCAAmC;YACpC,UAAU;EAEpB,eAAgB;EAEhB,gBAAgB;EAEhB;EAEA;EAEA,YAAY,MAAM;;;;;;EAYZ,WAAW,SAAS,UAAU;;;;;;;EAY9B,4BACJ,aACA,QAAQ,6BACP;;;;;;;EAkBG,eAAe,gBAAgB,UAAU,QAAQ;;;;;;;;SA2B1C,aACX,UAAU,WACV,MAAM,kCAA+B,QAAA"}
|