@langchain/core 1.0.6 → 1.1.1
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 +20 -0
- package/agents.cjs +1 -0
- package/agents.d.cts +1 -0
- package/agents.d.ts +1 -0
- package/agents.js +1 -0
- package/caches.cjs +1 -0
- package/caches.d.cts +1 -0
- package/caches.d.ts +1 -0
- package/caches.js +1 -0
- package/callbacks/base.cjs +1 -0
- package/callbacks/base.d.cts +1 -0
- package/callbacks/base.d.ts +1 -0
- package/callbacks/base.js +1 -0
- package/callbacks/dispatch/web.cjs +1 -0
- package/callbacks/dispatch/web.d.cts +1 -0
- package/callbacks/dispatch/web.d.ts +1 -0
- package/callbacks/dispatch/web.js +1 -0
- package/callbacks/dispatch.cjs +1 -0
- package/callbacks/dispatch.d.cts +1 -0
- package/callbacks/dispatch.d.ts +1 -0
- package/callbacks/dispatch.js +1 -0
- package/callbacks/manager.cjs +1 -0
- package/callbacks/manager.d.cts +1 -0
- package/callbacks/manager.d.ts +1 -0
- package/callbacks/manager.js +1 -0
- package/callbacks/promises.cjs +1 -0
- package/callbacks/promises.d.cts +1 -0
- package/callbacks/promises.d.ts +1 -0
- package/callbacks/promises.js +1 -0
- package/chat_history.cjs +1 -0
- package/chat_history.d.cts +1 -0
- package/chat_history.d.ts +1 -0
- package/chat_history.js +1 -0
- package/context.cjs +1 -0
- package/context.d.cts +1 -0
- package/context.d.ts +1 -0
- package/context.js +1 -0
- package/dist/caches/{base.cjs → index.cjs} +6 -6
- package/dist/caches/index.cjs.map +1 -0
- package/dist/caches/{base.d.cts → index.d.cts} +2 -2
- package/dist/caches/{base.d.ts → index.d.ts} +2 -2
- package/dist/caches/{base.js → index.js} +5 -5
- package/dist/caches/index.js.map +1 -0
- package/dist/callbacks/dispatch/index.d.ts +1 -0
- package/dist/callbacks/dispatch/web.d.ts +1 -0
- package/dist/chat_history.d.ts +1 -0
- package/dist/language_models/base.cjs +2 -2
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +1 -1
- package/dist/language_models/base.d.ts +3 -1
- package/dist/language_models/base.js +1 -1
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.cts +1 -1
- package/dist/language_models/chat_models.d.ts +4 -1
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/llms.cjs.map +1 -1
- package/dist/language_models/llms.d.cts +1 -1
- package/dist/language_models/llms.d.ts +2 -1
- package/dist/language_models/llms.js.map +1 -1
- package/dist/load/import_constants.cjs +1 -0
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +1 -0
- package/dist/load/import_constants.js.map +1 -1
- package/dist/load/import_map.cjs +12 -12
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +16 -16
- package/dist/load/import_map.js.map +1 -1
- package/dist/messages/base.cjs +10 -3
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.js +10 -3
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/message.d.cts +1 -1
- package/dist/messages/message.d.ts +1 -1
- package/dist/messages/system.cjs +25 -1
- package/dist/messages/system.cjs.map +1 -1
- package/dist/messages/system.d.cts +6 -0
- package/dist/messages/system.d.ts +6 -0
- package/dist/messages/system.js +25 -1
- package/dist/messages/system.js.map +1 -1
- package/dist/messages/transformers.d.cts +2 -1
- package/dist/messages/transformers.d.ts +2 -1
- package/dist/messages/utils.d.cts +8 -8
- package/dist/messages/utils.d.ts +8 -8
- package/dist/output_parsers/base.d.ts +3 -0
- package/dist/output_parsers/index.cjs +1 -1
- package/dist/output_parsers/index.js +1 -1
- package/dist/output_parsers/list.d.ts +1 -0
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
- package/dist/output_parsers/string.d.ts +1 -0
- package/dist/prompts/base.d.ts +1 -0
- package/dist/prompts/chat.d.ts +1 -0
- package/dist/prompts/few_shot.d.ts +1 -0
- package/dist/prompts/image.d.ts +1 -0
- package/dist/prompts/prompt.d.ts +1 -0
- package/dist/prompts/serde.d.ts +1 -0
- package/dist/prompts/structured.d.ts +1 -1
- package/dist/prompts/template.d.ts +1 -1
- package/dist/retrievers/document_compressors/{base.cjs → index.cjs} +6 -6
- package/dist/retrievers/document_compressors/index.cjs.map +1 -0
- package/dist/retrievers/document_compressors/{base.d.cts → index.d.cts} +2 -2
- package/dist/retrievers/document_compressors/{base.d.ts → index.d.ts} +2 -2
- package/dist/retrievers/document_compressors/index.js +17 -0
- package/dist/retrievers/document_compressors/index.js.map +1 -0
- package/dist/retrievers/index.d.ts +1 -0
- package/dist/runnables/base.cjs +2 -2
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +0 -17
- package/dist/runnables/base.d.ts +0 -17
- package/dist/runnables/base.js +2 -2
- package/dist/runnables/base.js.map +1 -1
- package/dist/runnables/branch.d.ts +1 -0
- package/dist/runnables/history.d.ts +2 -0
- package/dist/runnables/index.cjs +4 -1
- package/dist/runnables/index.cjs.map +1 -1
- package/dist/runnables/index.d.cts +2 -1
- package/dist/runnables/index.d.ts +2 -1
- package/dist/runnables/index.js +4 -2
- package/dist/runnables/index.js.map +1 -1
- package/dist/runnables/passthrough.d.ts +1 -0
- package/dist/runnables/router.d.ts +1 -0
- package/dist/tools/index.cjs +9 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +7 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.cjs.map +1 -1
- package/dist/tools/types.d.cts +15 -14
- package/dist/tools/types.d.ts +17 -14
- package/dist/tools/types.js.map +1 -1
- package/dist/tracers/event_stream.d.ts +1 -0
- package/dist/utils/async_caller.cjs +9 -4
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.js +8 -3
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.cts +0 -18
- package/dist/utils/fast-json-patch/src/core.d.ts +0 -18
- package/dist/utils/json_schema.d.cts +0 -5
- package/dist/utils/json_schema.d.ts +1 -5
- package/dist/utils/signal.d.cts +13 -0
- package/dist/utils/signal.d.ts +13 -0
- package/dist/utils/testing/chat_models.d.ts +1 -0
- package/dist/utils/testing/message_history.d.ts +1 -0
- package/dist/utils/types/index.cjs +2 -0
- package/dist/utils/types/index.d.cts +2 -2
- package/dist/utils/types/index.d.ts +2 -2
- package/dist/utils/types/index.js +3 -2
- package/dist/utils/types/zod.cjs +4 -0
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +3 -2
- package/dist/utils/types/zod.d.ts +3 -2
- package/dist/utils/types/zod.js +4 -1
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/Refs.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/index.d.ts +37 -0
- package/dist/utils/zod-to-json-schema/parseDef.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/default.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +4 -0
- package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts +2 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/selectParser.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +3 -0
- package/document_loaders/base.cjs +1 -0
- package/document_loaders/base.d.cts +1 -0
- package/document_loaders/base.d.ts +1 -0
- package/document_loaders/base.js +1 -0
- package/document_loaders/langsmith.cjs +1 -0
- package/document_loaders/langsmith.d.cts +1 -0
- package/document_loaders/langsmith.d.ts +1 -0
- package/document_loaders/langsmith.js +1 -0
- package/documents.cjs +1 -0
- package/documents.d.cts +1 -0
- package/documents.d.ts +1 -0
- package/documents.js +1 -0
- package/embeddings.cjs +1 -0
- package/embeddings.d.cts +1 -0
- package/embeddings.d.ts +1 -0
- package/embeddings.js +1 -0
- package/example_selectors.cjs +1 -0
- package/example_selectors.d.cts +1 -0
- package/example_selectors.d.ts +1 -0
- package/example_selectors.js +1 -0
- package/indexing.cjs +1 -0
- package/indexing.d.cts +1 -0
- package/indexing.d.ts +1 -0
- package/indexing.js +1 -0
- package/language_models/base.cjs +1 -0
- package/language_models/base.d.cts +1 -0
- package/language_models/base.d.ts +1 -0
- package/language_models/base.js +1 -0
- package/language_models/chat_models.cjs +1 -0
- package/language_models/chat_models.d.cts +1 -0
- package/language_models/chat_models.d.ts +1 -0
- package/language_models/chat_models.js +1 -0
- package/language_models/llms.cjs +1 -0
- package/language_models/llms.d.cts +1 -0
- package/language_models/llms.d.ts +1 -0
- package/language_models/llms.js +1 -0
- package/language_models/profile.cjs +1 -0
- package/language_models/profile.d.cts +1 -0
- package/language_models/profile.d.ts +1 -0
- package/language_models/profile.js +1 -0
- package/load/serializable.cjs +1 -0
- package/load/serializable.d.cts +1 -0
- package/load/serializable.d.ts +1 -0
- package/load/serializable.js +1 -0
- package/load.cjs +1 -0
- package/load.d.cts +1 -0
- package/load.d.ts +1 -0
- package/load.js +1 -0
- package/memory.cjs +1 -0
- package/memory.d.cts +1 -0
- package/memory.d.ts +1 -0
- package/memory.js +1 -0
- package/messages/tool.cjs +1 -0
- package/messages/tool.d.cts +1 -0
- package/messages/tool.d.ts +1 -0
- package/messages/tool.js +1 -0
- package/messages.cjs +1 -0
- package/messages.d.cts +1 -0
- package/messages.d.ts +1 -0
- package/messages.js +1 -0
- package/output_parsers/openai_functions.cjs +1 -0
- package/output_parsers/openai_functions.d.cts +1 -0
- package/output_parsers/openai_functions.d.ts +1 -0
- package/output_parsers/openai_functions.js +1 -0
- package/output_parsers/openai_tools.cjs +1 -0
- package/output_parsers/openai_tools.d.cts +1 -0
- package/output_parsers/openai_tools.d.ts +1 -0
- package/output_parsers/openai_tools.js +1 -0
- package/output_parsers.cjs +1 -0
- package/output_parsers.d.cts +1 -0
- package/output_parsers.d.ts +1 -0
- package/output_parsers.js +1 -0
- package/outputs.cjs +1 -0
- package/outputs.d.cts +1 -0
- package/outputs.d.ts +1 -0
- package/outputs.js +1 -0
- package/package.json +163 -63
- package/prompt_values.cjs +1 -0
- package/prompt_values.d.cts +1 -0
- package/prompt_values.d.ts +1 -0
- package/prompt_values.js +1 -0
- package/prompts.cjs +1 -0
- package/prompts.d.cts +1 -0
- package/prompts.d.ts +1 -0
- package/prompts.js +1 -0
- package/retrievers/document_compressors.cjs +1 -0
- package/retrievers/document_compressors.d.cts +1 -0
- package/retrievers/document_compressors.d.ts +1 -0
- package/retrievers/document_compressors.js +1 -0
- package/retrievers.cjs +1 -0
- package/retrievers.d.cts +1 -0
- package/retrievers.d.ts +1 -0
- package/retrievers.js +1 -0
- package/runnables/graph.cjs +1 -0
- package/runnables/graph.d.cts +1 -0
- package/runnables/graph.d.ts +1 -0
- package/runnables/graph.js +1 -0
- package/runnables.cjs +1 -0
- package/runnables.d.cts +1 -0
- package/runnables.d.ts +1 -0
- package/runnables.js +1 -0
- package/singletons.cjs +1 -0
- package/singletons.d.cts +1 -0
- package/singletons.d.ts +1 -0
- package/singletons.js +1 -0
- package/stores.cjs +1 -0
- package/stores.d.cts +1 -0
- package/stores.d.ts +1 -0
- package/stores.js +1 -0
- package/structured_query.cjs +1 -0
- package/structured_query.d.cts +1 -0
- package/structured_query.d.ts +1 -0
- package/structured_query.js +1 -0
- package/tools.cjs +1 -0
- package/tools.d.cts +1 -0
- package/tools.d.ts +1 -0
- package/tools.js +1 -0
- package/tracers/base.cjs +1 -0
- package/tracers/base.d.cts +1 -0
- package/tracers/base.d.ts +1 -0
- package/tracers/base.js +1 -0
- package/tracers/console.cjs +1 -0
- package/tracers/console.d.cts +1 -0
- package/tracers/console.d.ts +1 -0
- package/tracers/console.js +1 -0
- package/tracers/log_stream.cjs +1 -0
- package/tracers/log_stream.d.cts +1 -0
- package/tracers/log_stream.d.ts +1 -0
- package/tracers/log_stream.js +1 -0
- package/tracers/run_collector.cjs +1 -0
- package/tracers/run_collector.d.cts +1 -0
- package/tracers/run_collector.d.ts +1 -0
- package/tracers/run_collector.js +1 -0
- package/tracers/tracer_langchain.cjs +1 -0
- package/tracers/tracer_langchain.d.cts +1 -0
- package/tracers/tracer_langchain.d.ts +1 -0
- package/tracers/tracer_langchain.js +1 -0
- package/types/stream.cjs +1 -0
- package/types/stream.d.cts +1 -0
- package/types/stream.d.ts +1 -0
- package/types/stream.js +1 -0
- package/utils/async_caller.cjs +1 -0
- package/utils/async_caller.d.cts +1 -0
- package/utils/async_caller.d.ts +1 -0
- package/utils/async_caller.js +1 -0
- package/utils/chunk_array.cjs +1 -0
- package/utils/chunk_array.d.cts +1 -0
- package/utils/chunk_array.d.ts +1 -0
- package/utils/chunk_array.js +1 -0
- package/utils/env.cjs +1 -0
- package/utils/env.d.cts +1 -0
- package/utils/env.d.ts +1 -0
- package/utils/env.js +1 -0
- package/utils/event_source_parse.cjs +1 -0
- package/utils/event_source_parse.d.cts +1 -0
- package/utils/event_source_parse.d.ts +1 -0
- package/utils/event_source_parse.js +1 -0
- package/utils/format.cjs +1 -0
- package/utils/format.d.cts +1 -0
- package/utils/format.d.ts +1 -0
- package/utils/format.js +1 -0
- package/utils/function_calling.cjs +1 -0
- package/utils/function_calling.d.cts +1 -0
- package/utils/function_calling.d.ts +1 -0
- package/utils/function_calling.js +1 -0
- package/utils/hash.cjs +1 -0
- package/utils/hash.d.cts +1 -0
- package/utils/hash.d.ts +1 -0
- package/utils/hash.js +1 -0
- package/utils/json_patch.cjs +1 -0
- package/utils/json_patch.d.cts +1 -0
- package/utils/json_patch.d.ts +1 -0
- package/utils/json_patch.js +1 -0
- package/utils/json_schema.cjs +1 -0
- package/utils/json_schema.d.cts +1 -0
- package/utils/json_schema.d.ts +1 -0
- package/utils/json_schema.js +1 -0
- package/utils/math.cjs +1 -0
- package/utils/math.d.cts +1 -0
- package/utils/math.d.ts +1 -0
- package/utils/math.js +1 -0
- package/utils/stream.cjs +1 -0
- package/utils/stream.d.cts +1 -0
- package/utils/stream.d.ts +1 -0
- package/utils/stream.js +1 -0
- package/utils/testing.cjs +1 -0
- package/utils/testing.d.cts +1 -0
- package/utils/testing.d.ts +1 -0
- package/utils/testing.js +1 -0
- package/utils/tiktoken.cjs +1 -0
- package/utils/tiktoken.d.cts +1 -0
- package/utils/tiktoken.d.ts +1 -0
- package/utils/tiktoken.js +1 -0
- package/utils/types.cjs +1 -0
- package/utils/types.d.cts +1 -0
- package/utils/types.d.ts +1 -0
- package/utils/types.js +1 -0
- package/vectorstores.cjs +1 -0
- package/vectorstores.d.cts +1 -0
- package/vectorstores.d.ts +1 -0
- package/vectorstores.js +1 -0
- package/dist/agents.d.cts.map +0 -1
- package/dist/agents.d.ts.map +0 -1
- package/dist/caches/base.cjs.map +0 -1
- package/dist/caches/base.d.cts.map +0 -1
- package/dist/caches/base.d.ts.map +0 -1
- package/dist/caches/base.js.map +0 -1
- package/dist/callbacks/base.d.cts.map +0 -1
- package/dist/callbacks/base.d.ts.map +0 -1
- package/dist/callbacks/dispatch/index.d.cts.map +0 -1
- package/dist/callbacks/dispatch/index.d.ts.map +0 -1
- package/dist/callbacks/dispatch/web.d.cts.map +0 -1
- package/dist/callbacks/dispatch/web.d.ts.map +0 -1
- package/dist/callbacks/manager.d.cts.map +0 -1
- package/dist/callbacks/manager.d.ts.map +0 -1
- package/dist/chat_history.d.cts.map +0 -1
- package/dist/chat_history.d.ts.map +0 -1
- package/dist/context.d.cts.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/document_loaders/base.d.cts.map +0 -1
- package/dist/document_loaders/base.d.ts.map +0 -1
- package/dist/document_loaders/langsmith.d.cts.map +0 -1
- package/dist/document_loaders/langsmith.d.ts.map +0 -1
- package/dist/documents/document.d.cts.map +0 -1
- package/dist/documents/document.d.ts.map +0 -1
- package/dist/documents/transformers.d.cts.map +0 -1
- package/dist/documents/transformers.d.ts.map +0 -1
- package/dist/embeddings.d.cts.map +0 -1
- package/dist/embeddings.d.ts.map +0 -1
- package/dist/example_selectors/base.d.cts.map +0 -1
- package/dist/example_selectors/base.d.ts.map +0 -1
- package/dist/example_selectors/conditional.d.cts.map +0 -1
- package/dist/example_selectors/conditional.d.ts.map +0 -1
- package/dist/example_selectors/length_based.d.cts.map +0 -1
- package/dist/example_selectors/length_based.d.ts.map +0 -1
- package/dist/example_selectors/semantic_similarity.d.cts.map +0 -1
- package/dist/example_selectors/semantic_similarity.d.ts.map +0 -1
- package/dist/indexing/base.d.cts.map +0 -1
- package/dist/indexing/base.d.ts.map +0 -1
- package/dist/indexing/record_manager.d.cts.map +0 -1
- package/dist/indexing/record_manager.d.ts.map +0 -1
- package/dist/language_models/base.d.cts.map +0 -1
- package/dist/language_models/base.d.ts.map +0 -1
- package/dist/language_models/chat_models.d.cts.map +0 -1
- package/dist/language_models/chat_models.d.ts.map +0 -1
- package/dist/language_models/llms.d.cts.map +0 -1
- package/dist/language_models/llms.d.ts.map +0 -1
- package/dist/language_models/profile.d.cts.map +0 -1
- package/dist/language_models/profile.d.ts.map +0 -1
- package/dist/load/import_type.d.cts.map +0 -1
- package/dist/load/import_type.d.ts.map +0 -1
- package/dist/load/index.d.cts.map +0 -1
- package/dist/load/index.d.ts.map +0 -1
- package/dist/load/map_keys.d.cts.map +0 -1
- package/dist/load/map_keys.d.ts.map +0 -1
- package/dist/load/serializable.d.cts.map +0 -1
- package/dist/load/serializable.d.ts.map +0 -1
- package/dist/memory.d.cts.map +0 -1
- package/dist/memory.d.ts.map +0 -1
- package/dist/messages/ai.d.cts.map +0 -1
- package/dist/messages/ai.d.ts.map +0 -1
- package/dist/messages/base.d.cts.map +0 -1
- package/dist/messages/base.d.ts.map +0 -1
- package/dist/messages/chat.d.cts.map +0 -1
- package/dist/messages/chat.d.ts.map +0 -1
- package/dist/messages/content/base.d.cts.map +0 -1
- package/dist/messages/content/base.d.ts.map +0 -1
- package/dist/messages/content/data.d.cts.map +0 -1
- package/dist/messages/content/data.d.ts.map +0 -1
- package/dist/messages/content/index.d.cts.map +0 -1
- package/dist/messages/content/index.d.ts.map +0 -1
- package/dist/messages/content/multimodal.d.cts.map +0 -1
- package/dist/messages/content/multimodal.d.ts.map +0 -1
- package/dist/messages/content/tools.d.cts.map +0 -1
- package/dist/messages/content/tools.d.ts.map +0 -1
- package/dist/messages/format.d.cts.map +0 -1
- package/dist/messages/format.d.ts.map +0 -1
- package/dist/messages/function.d.cts.map +0 -1
- package/dist/messages/function.d.ts.map +0 -1
- package/dist/messages/human.d.cts.map +0 -1
- package/dist/messages/human.d.ts.map +0 -1
- package/dist/messages/message.d.cts.map +0 -1
- package/dist/messages/message.d.ts.map +0 -1
- package/dist/messages/metadata.d.cts.map +0 -1
- package/dist/messages/metadata.d.ts.map +0 -1
- package/dist/messages/modifier.d.cts.map +0 -1
- package/dist/messages/modifier.d.ts.map +0 -1
- package/dist/messages/system.d.cts.map +0 -1
- package/dist/messages/system.d.ts.map +0 -1
- package/dist/messages/tool.d.cts.map +0 -1
- package/dist/messages/tool.d.ts.map +0 -1
- package/dist/messages/transformers.d.cts.map +0 -1
- package/dist/messages/transformers.d.ts.map +0 -1
- package/dist/messages/utils.d.cts.map +0 -1
- package/dist/messages/utils.d.ts.map +0 -1
- package/dist/output_parsers/base.d.cts.map +0 -1
- package/dist/output_parsers/base.d.ts.map +0 -1
- package/dist/output_parsers/bytes.d.cts.map +0 -1
- package/dist/output_parsers/bytes.d.ts.map +0 -1
- package/dist/output_parsers/json.d.cts.map +0 -1
- package/dist/output_parsers/json.d.ts.map +0 -1
- package/dist/output_parsers/list.d.cts.map +0 -1
- package/dist/output_parsers/list.d.ts.map +0 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts.map +0 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +0 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +0 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +0 -1
- package/dist/output_parsers/string.d.cts.map +0 -1
- package/dist/output_parsers/string.d.ts.map +0 -1
- package/dist/output_parsers/structured.d.cts.map +0 -1
- package/dist/output_parsers/structured.d.ts.map +0 -1
- package/dist/output_parsers/transform.d.cts.map +0 -1
- package/dist/output_parsers/transform.d.ts.map +0 -1
- package/dist/output_parsers/xml.d.cts.map +0 -1
- package/dist/output_parsers/xml.d.ts.map +0 -1
- package/dist/outputs.d.cts.map +0 -1
- package/dist/outputs.d.ts.map +0 -1
- package/dist/prompt_values.d.cts.map +0 -1
- package/dist/prompt_values.d.ts.map +0 -1
- package/dist/prompts/base.d.cts.map +0 -1
- package/dist/prompts/base.d.ts.map +0 -1
- package/dist/prompts/chat.d.cts.map +0 -1
- package/dist/prompts/chat.d.ts.map +0 -1
- package/dist/prompts/dict.d.cts.map +0 -1
- package/dist/prompts/dict.d.ts.map +0 -1
- package/dist/prompts/few_shot.d.cts.map +0 -1
- package/dist/prompts/few_shot.d.ts.map +0 -1
- package/dist/prompts/image.d.cts.map +0 -1
- package/dist/prompts/image.d.ts.map +0 -1
- package/dist/prompts/pipeline.d.cts.map +0 -1
- package/dist/prompts/pipeline.d.ts.map +0 -1
- package/dist/prompts/prompt.d.cts.map +0 -1
- package/dist/prompts/prompt.d.ts.map +0 -1
- package/dist/prompts/serde.d.cts.map +0 -1
- package/dist/prompts/serde.d.ts.map +0 -1
- package/dist/prompts/string.d.cts.map +0 -1
- package/dist/prompts/string.d.ts.map +0 -1
- package/dist/prompts/structured.d.cts.map +0 -1
- package/dist/prompts/structured.d.ts.map +0 -1
- package/dist/prompts/template.d.cts.map +0 -1
- package/dist/prompts/template.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/base.cjs.map +0 -1
- package/dist/retrievers/document_compressors/base.d.cts.map +0 -1
- package/dist/retrievers/document_compressors/base.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/base.js +0 -17
- package/dist/retrievers/document_compressors/base.js.map +0 -1
- package/dist/retrievers/index.d.cts.map +0 -1
- package/dist/retrievers/index.d.ts.map +0 -1
- package/dist/runnables/base.d.cts.map +0 -1
- package/dist/runnables/base.d.ts.map +0 -1
- package/dist/runnables/branch.d.cts.map +0 -1
- package/dist/runnables/branch.d.ts.map +0 -1
- package/dist/runnables/config.d.cts.map +0 -1
- package/dist/runnables/config.d.ts.map +0 -1
- package/dist/runnables/graph.d.cts.map +0 -1
- package/dist/runnables/graph.d.ts.map +0 -1
- package/dist/runnables/history.d.cts.map +0 -1
- package/dist/runnables/history.d.ts.map +0 -1
- package/dist/runnables/passthrough.d.cts.map +0 -1
- package/dist/runnables/passthrough.d.ts.map +0 -1
- package/dist/runnables/router.d.cts.map +0 -1
- package/dist/runnables/router.d.ts.map +0 -1
- package/dist/runnables/types.d.cts.map +0 -1
- package/dist/runnables/types.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/context.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/context.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/globals.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/globals.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/index.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/index.d.ts.map +0 -1
- package/dist/singletons/callbacks.d.cts.map +0 -1
- package/dist/singletons/callbacks.d.ts.map +0 -1
- package/dist/stores.d.cts.map +0 -1
- package/dist/stores.d.ts.map +0 -1
- package/dist/structured_query/base.d.cts.map +0 -1
- package/dist/structured_query/base.d.ts.map +0 -1
- package/dist/structured_query/functional.d.cts.map +0 -1
- package/dist/structured_query/functional.d.ts.map +0 -1
- package/dist/structured_query/ir.d.cts.map +0 -1
- package/dist/structured_query/ir.d.ts.map +0 -1
- package/dist/structured_query/utils.d.cts.map +0 -1
- package/dist/structured_query/utils.d.ts.map +0 -1
- package/dist/tools/index.d.cts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/types.d.cts.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/utils.d.cts.map +0 -1
- package/dist/tools/utils.d.ts.map +0 -1
- package/dist/tracers/base.d.cts.map +0 -1
- package/dist/tracers/base.d.ts.map +0 -1
- package/dist/tracers/console.d.cts.map +0 -1
- package/dist/tracers/console.d.ts.map +0 -1
- package/dist/tracers/event_stream.d.cts.map +0 -1
- package/dist/tracers/event_stream.d.ts.map +0 -1
- package/dist/tracers/log_stream.d.cts.map +0 -1
- package/dist/tracers/log_stream.d.ts.map +0 -1
- package/dist/tracers/run_collector.d.cts.map +0 -1
- package/dist/tracers/run_collector.d.ts.map +0 -1
- package/dist/tracers/tracer_langchain.d.cts.map +0 -1
- package/dist/tracers/tracer_langchain.d.ts.map +0 -1
- package/dist/types/_internal.d.cts.map +0 -1
- package/dist/types/_internal.d.ts.map +0 -1
- package/dist/types/type-utils.d.cts.map +0 -1
- package/dist/types/type-utils.d.ts.map +0 -1
- package/dist/utils/async_caller.d.cts.map +0 -1
- package/dist/utils/async_caller.d.ts.map +0 -1
- package/dist/utils/chunk_array.d.cts.map +0 -1
- package/dist/utils/chunk_array.d.ts.map +0 -1
- package/dist/utils/env.d.cts.map +0 -1
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/event_source_parse.d.cts.map +0 -1
- package/dist/utils/event_source_parse.d.ts.map +0 -1
- package/dist/utils/fast-json-patch/src/core.d.cts.map +0 -1
- package/dist/utils/fast-json-patch/src/core.d.ts.map +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.cts.map +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.ts.map +0 -1
- package/dist/utils/format.d.cts.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/function_calling.d.cts.map +0 -1
- package/dist/utils/function_calling.d.ts.map +0 -1
- package/dist/utils/hash.d.cts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/js-sha256/hash.d.cts.map +0 -1
- package/dist/utils/js-sha256/hash.d.ts.map +0 -1
- package/dist/utils/json.d.cts.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json_schema.d.cts.map +0 -1
- package/dist/utils/json_schema.d.ts.map +0 -1
- package/dist/utils/math.d.cts.map +0 -1
- package/dist/utils/math.d.ts.map +0 -1
- package/dist/utils/ml-distance/similarities.d.cts.map +0 -1
- package/dist/utils/ml-distance/similarities.d.ts.map +0 -1
- package/dist/utils/stream.d.cts.map +0 -1
- package/dist/utils/stream.d.ts.map +0 -1
- package/dist/utils/testing/chat_models.d.cts.map +0 -1
- package/dist/utils/testing/chat_models.d.ts.map +0 -1
- package/dist/utils/testing/embeddings.d.cts.map +0 -1
- package/dist/utils/testing/embeddings.d.ts.map +0 -1
- package/dist/utils/testing/llms.d.cts.map +0 -1
- package/dist/utils/testing/llms.d.ts.map +0 -1
- package/dist/utils/testing/message_history.d.cts.map +0 -1
- package/dist/utils/testing/message_history.d.ts.map +0 -1
- package/dist/utils/testing/output_parsers.d.cts.map +0 -1
- package/dist/utils/testing/output_parsers.d.ts.map +0 -1
- package/dist/utils/testing/retrievers.d.cts.map +0 -1
- package/dist/utils/testing/retrievers.d.ts.map +0 -1
- package/dist/utils/testing/runnables.d.cts.map +0 -1
- package/dist/utils/testing/runnables.d.ts.map +0 -1
- package/dist/utils/testing/tools.d.cts.map +0 -1
- package/dist/utils/testing/tools.d.ts.map +0 -1
- package/dist/utils/testing/tracers.d.cts.map +0 -1
- package/dist/utils/testing/tracers.d.ts.map +0 -1
- package/dist/utils/testing/vectorstores.d.cts.map +0 -1
- package/dist/utils/testing/vectorstores.d.ts.map +0 -1
- package/dist/utils/tiktoken.d.cts.map +0 -1
- package/dist/utils/tiktoken.d.ts.map +0 -1
- package/dist/utils/types/index.d.cts.map +0 -1
- package/dist/utils/types/index.d.ts.map +0 -1
- package/dist/utils/types/zod.d.cts.map +0 -1
- package/dist/utils/types/zod.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +0 -1
- package/dist/vectorstores.d.cts.map +0 -1
- package/dist/vectorstores.d.ts.map +0 -1
package/dist/messages/system.js
CHANGED
|
@@ -4,7 +4,7 @@ import { BaseMessage, BaseMessageChunk, _mergeDicts, mergeContent } from "./base
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents a system message in a conversation.
|
|
6
6
|
*/
|
|
7
|
-
var SystemMessage = class extends BaseMessage {
|
|
7
|
+
var SystemMessage = class SystemMessage extends BaseMessage {
|
|
8
8
|
static lc_name() {
|
|
9
9
|
return "SystemMessage";
|
|
10
10
|
}
|
|
@@ -12,6 +12,30 @@ var SystemMessage = class extends BaseMessage {
|
|
|
12
12
|
constructor(fields) {
|
|
13
13
|
super(fields);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Concatenates a string or another system message with the current system message.
|
|
17
|
+
* @param chunk - The chunk to concatenate with the system message.
|
|
18
|
+
* @returns A new system message with the concatenated content.
|
|
19
|
+
*/
|
|
20
|
+
concat(chunk) {
|
|
21
|
+
if (typeof chunk === "string") return new SystemMessage({
|
|
22
|
+
...this,
|
|
23
|
+
content: mergeContent(this.content, chunk)
|
|
24
|
+
});
|
|
25
|
+
if (SystemMessage.isInstance(chunk)) return new SystemMessage({
|
|
26
|
+
...this,
|
|
27
|
+
additional_kwargs: {
|
|
28
|
+
...this.additional_kwargs,
|
|
29
|
+
...chunk.additional_kwargs
|
|
30
|
+
},
|
|
31
|
+
response_metadata: {
|
|
32
|
+
...this.response_metadata,
|
|
33
|
+
...chunk.response_metadata
|
|
34
|
+
},
|
|
35
|
+
content: mergeContent(this.content, chunk.content)
|
|
36
|
+
});
|
|
37
|
+
throw new Error("Unexpected chunk type for system message");
|
|
38
|
+
}
|
|
15
39
|
static isInstance(obj) {
|
|
16
40
|
return super.isInstance(obj) && obj.type === "system";
|
|
17
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","names":["fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>","obj: unknown","chunk: SystemMessageChunk<TStructure>","x: BaseMessage","x: BaseMessageChunk"],"sources":["../../src/messages/system.ts"],"sourcesContent":["import {\n BaseMessage,\n BaseMessageChunk,\n mergeContent,\n _mergeDicts,\n type BaseMessageFields,\n} from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nimport { Constructor } from \"./utils.js\";\n\nexport interface SystemMessageFields<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageFields<TStructure, \"system\"> {}\n\n/**\n * Represents a system message in a conversation.\n */\nexport class SystemMessage<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessage<TStructure, \"system\"> {\n static lc_name() {\n return \"SystemMessage\";\n }\n\n readonly type = \"system\" as const;\n\n constructor(\n fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>\n ) {\n super(fields);\n }\n\n static isInstance(obj: unknown): obj is SystemMessage {\n return super.isInstance(obj) && obj.type === \"system\";\n }\n}\n\n/**\n * Represents a chunk of a system message, which can be concatenated with\n * other system message chunks.\n */\nexport class SystemMessageChunk<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageChunk<TStructure, \"system\"> {\n static lc_name() {\n return \"SystemMessageChunk\";\n }\n\n readonly type = \"system\" as const;\n\n constructor(\n fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>\n ) {\n super(fields);\n }\n\n concat(chunk: SystemMessageChunk<TStructure>) {\n const Cls = this.constructor as Constructor<this>;\n return new Cls({\n content: mergeContent(this.content, chunk.content),\n additional_kwargs: _mergeDicts(\n this.additional_kwargs,\n chunk.additional_kwargs\n ),\n response_metadata: _mergeDicts(\n this.response_metadata,\n chunk.response_metadata\n ),\n id: this.id ?? chunk.id,\n });\n }\n\n static isInstance(obj: unknown): obj is SystemMessageChunk {\n return super.isInstance(obj) && obj.type === \"system\";\n }\n}\n\n/**\n * @deprecated Use {@link SystemMessage.isInstance} instead\n */\nexport function isSystemMessage<TStructure extends MessageStructure>(\n x: BaseMessage\n): x is SystemMessage<TStructure> {\n return x._getType() === \"system\";\n}\n\n/**\n * @deprecated Use {@link SystemMessageChunk.isInstance} instead\n */\nexport function isSystemMessageChunk<TStructure extends MessageStructure>(\n x: BaseMessageChunk\n): x is SystemMessageChunk<TStructure> {\n return x._getType() === \"system\";\n}\n"],"mappings":";;;;;;AAiBA,IAAa,gBAAb,
|
|
1
|
+
{"version":3,"file":"system.js","names":["fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>","chunk: string | SystemMessage","obj: unknown","chunk: SystemMessageChunk<TStructure>","x: BaseMessage","x: BaseMessageChunk"],"sources":["../../src/messages/system.ts"],"sourcesContent":["import {\n BaseMessage,\n BaseMessageChunk,\n mergeContent,\n _mergeDicts,\n type BaseMessageFields,\n} from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nimport { Constructor } from \"./utils.js\";\n\nexport interface SystemMessageFields<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageFields<TStructure, \"system\"> {}\n\n/**\n * Represents a system message in a conversation.\n */\nexport class SystemMessage<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessage<TStructure, \"system\"> {\n static lc_name() {\n return \"SystemMessage\";\n }\n\n readonly type = \"system\" as const;\n\n constructor(\n fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>\n ) {\n super(fields);\n }\n\n /**\n * Concatenates a string or another system message with the current system message.\n * @param chunk - The chunk to concatenate with the system message.\n * @returns A new system message with the concatenated content.\n */\n concat(chunk: string | SystemMessage) {\n if (typeof chunk === \"string\") {\n return new SystemMessage({\n ...this,\n content: mergeContent(this.content, chunk),\n });\n }\n\n if (SystemMessage.isInstance(chunk)) {\n return new SystemMessage({\n ...this,\n additional_kwargs: {\n ...this.additional_kwargs,\n ...chunk.additional_kwargs,\n },\n response_metadata: {\n ...this.response_metadata,\n ...chunk.response_metadata,\n },\n content: mergeContent(this.content, chunk.content),\n });\n }\n\n throw new Error(\"Unexpected chunk type for system message\");\n }\n\n static isInstance(obj: unknown): obj is SystemMessage {\n return super.isInstance(obj) && obj.type === \"system\";\n }\n}\n\n/**\n * Represents a chunk of a system message, which can be concatenated with\n * other system message chunks.\n */\nexport class SystemMessageChunk<\n TStructure extends MessageStructure = MessageStructure\n> extends BaseMessageChunk<TStructure, \"system\"> {\n static lc_name() {\n return \"SystemMessageChunk\";\n }\n\n readonly type = \"system\" as const;\n\n constructor(\n fields:\n | $InferMessageContent<TStructure, \"system\">\n | SystemMessageFields<TStructure>\n ) {\n super(fields);\n }\n\n concat(chunk: SystemMessageChunk<TStructure>) {\n const Cls = this.constructor as Constructor<this>;\n return new Cls({\n content: mergeContent(this.content, chunk.content),\n additional_kwargs: _mergeDicts(\n this.additional_kwargs,\n chunk.additional_kwargs\n ),\n response_metadata: _mergeDicts(\n this.response_metadata,\n chunk.response_metadata\n ),\n id: this.id ?? chunk.id,\n });\n }\n\n static isInstance(obj: unknown): obj is SystemMessageChunk {\n return super.isInstance(obj) && obj.type === \"system\";\n }\n}\n\n/**\n * @deprecated Use {@link SystemMessage.isInstance} instead\n */\nexport function isSystemMessage<TStructure extends MessageStructure>(\n x: BaseMessage\n): x is SystemMessage<TStructure> {\n return x._getType() === \"system\";\n}\n\n/**\n * @deprecated Use {@link SystemMessageChunk.isInstance} instead\n */\nexport function isSystemMessageChunk<TStructure extends MessageStructure>(\n x: BaseMessageChunk\n): x is SystemMessageChunk<TStructure> {\n return x._getType() === \"system\";\n}\n"],"mappings":";;;;;;AAiBA,IAAa,gBAAb,MAAa,sBAEH,YAAkC;CAC1C,OAAO,UAAU;AACf,SAAO;CACR;CAED,AAAS,OAAO;CAEhB,YACEA,QAGA;EACA,MAAM,OAAO;CACd;;;;;;CAOD,OAAOC,OAA+B;AACpC,MAAI,OAAO,UAAU,SACnB,QAAO,IAAI,cAAc;GACvB,GAAG;GACH,SAAS,aAAa,KAAK,SAAS,MAAM;EAC3C;AAGH,MAAI,cAAc,WAAW,MAAM,CACjC,QAAO,IAAI,cAAc;GACvB,GAAG;GACH,mBAAmB;IACjB,GAAG,KAAK;IACR,GAAG,MAAM;GACV;GACD,mBAAmB;IACjB,GAAG,KAAK;IACR,GAAG,MAAM;GACV;GACD,SAAS,aAAa,KAAK,SAAS,MAAM,QAAQ;EACnD;AAGH,QAAM,IAAI,MAAM;CACjB;CAED,OAAO,WAAWC,KAAoC;AACpD,SAAO,MAAM,WAAW,IAAI,IAAI,IAAI,SAAS;CAC9C;AACF;;;;;AAMD,IAAa,qBAAb,cAEU,iBAAuC;CAC/C,OAAO,UAAU;AACf,SAAO;CACR;CAED,AAAS,OAAO;CAEhB,YACEF,QAGA;EACA,MAAM,OAAO;CACd;CAED,OAAOG,OAAuC;EAC5C,MAAM,MAAM,KAAK;AACjB,SAAO,IAAI,IAAI;GACb,SAAS,aAAa,KAAK,SAAS,MAAM,QAAQ;GAClD,mBAAmB,YACjB,KAAK,mBACL,MAAM,kBACP;GACD,mBAAmB,YACjB,KAAK,mBACL,MAAM,kBACP;GACD,IAAI,KAAK,MAAM,MAAM;EACtB;CACF;CAED,OAAO,WAAWD,KAAyC;AACzD,SAAO,MAAM,WAAW,IAAI,IAAI,IAAI,SAAS;CAC9C;AACF;;;;AAKD,SAAgB,gBACdE,GACgC;AAChC,QAAO,EAAE,UAAU,KAAK;AACzB;;;;AAKD,SAAgB,qBACdC,GACqC;AACrC,QAAO,EAAE,UAAU,KAAK;AACzB"}
|
|
@@ -13,7 +13,8 @@ import { RemoveMessage } from "./modifier.cjs";
|
|
|
13
13
|
|
|
14
14
|
//#region src/messages/transformers.d.ts
|
|
15
15
|
type MessageUnion = typeof HumanMessage | typeof AIMessage | typeof SystemMessage | typeof ChatMessage | typeof FunctionMessage | typeof ToolMessage | typeof RemoveMessage;
|
|
16
|
-
type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage;
|
|
16
|
+
type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage;
|
|
17
|
+
// RemoveMessage does not have a chunk class.
|
|
17
18
|
type MessageTypeOrClass = MessageType | MessageUnion | MessageChunkUnion;
|
|
18
19
|
interface FilterMessagesFields {
|
|
19
20
|
/**
|
|
@@ -13,7 +13,8 @@ import { RemoveMessage } from "./modifier.js";
|
|
|
13
13
|
|
|
14
14
|
//#region src/messages/transformers.d.ts
|
|
15
15
|
type MessageUnion = typeof HumanMessage | typeof AIMessage | typeof SystemMessage | typeof ChatMessage | typeof FunctionMessage | typeof ToolMessage | typeof RemoveMessage;
|
|
16
|
-
type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage;
|
|
16
|
+
type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage;
|
|
17
|
+
// RemoveMessage does not have a chunk class.
|
|
17
18
|
type MessageTypeOrClass = MessageType | MessageUnion | MessageChunkUnion;
|
|
18
19
|
interface FilterMessagesFields {
|
|
19
20
|
/**
|
|
@@ -8,28 +8,28 @@ import { SystemMessage, SystemMessageChunk } from "./system.cjs";
|
|
|
8
8
|
import { MessageStructure } from "./message.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/messages/utils.d.ts
|
|
11
|
-
type $Expand<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
11
|
+
type $Expand<T$1> = T$1 extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
12
12
|
/**
|
|
13
13
|
* Extracts the explicitly declared keys from a type T.
|
|
14
14
|
*
|
|
15
15
|
* @template T - The type to extract keys from
|
|
16
16
|
* @returns A union of keys that are not string, number, or symbol
|
|
17
17
|
*/
|
|
18
|
-
type $KnownKeys<T> = { [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T];
|
|
18
|
+
type $KnownKeys<T$1> = { [K in keyof T$1]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T$1];
|
|
19
19
|
/**
|
|
20
20
|
* Detects if T has an index signature.
|
|
21
21
|
*
|
|
22
22
|
* @template T - The type to check for index signatures
|
|
23
23
|
* @returns True if T has an index signature, false otherwise
|
|
24
24
|
*/
|
|
25
|
-
type $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;
|
|
25
|
+
type $HasIndexSignature<T$1> = string extends keyof T$1 ? true : number extends keyof T$1 ? true : symbol extends keyof T$1 ? true : false;
|
|
26
26
|
/**
|
|
27
27
|
* Detects if T has an index signature and no known keys.
|
|
28
28
|
*
|
|
29
29
|
* @template T - The type to check for index signatures and no known keys
|
|
30
30
|
* @returns True if T has an index signature and no known keys, false otherwise
|
|
31
31
|
*/
|
|
32
|
-
type $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;
|
|
32
|
+
type $OnlyIndexSignatures<T$1> = $HasIndexSignature<T$1> extends true ? [$KnownKeys<T$1>] extends [never] ? true : false : false;
|
|
33
33
|
/**
|
|
34
34
|
* Recursively merges two object types T and U, with U taking precedence over T.
|
|
35
35
|
*
|
|
@@ -63,9 +63,9 @@ type $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<
|
|
|
63
63
|
* // }
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
type $MergeObjects<T, U> =
|
|
66
|
+
type $MergeObjects<T$1, U$1> =
|
|
67
67
|
// If U is purely index-signature based, prefer U as a whole
|
|
68
|
-
$OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : { [K in keyof T | keyof U]: K extends keyof T ? K extends keyof U ? T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? $MergeObjects<T[K], U[K]> : U[K] : U[K] : T[K] : K extends keyof U ? U[K] : never };
|
|
68
|
+
$OnlyIndexSignatures<U$1> extends true ? U$1 : $OnlyIndexSignatures<T$1> extends true ? U$1 : { [K in keyof T$1 | keyof U$1]: K extends keyof T$1 ? K extends keyof U$1 ? T$1[K] extends Record<string, unknown> ? U$1[K] extends Record<string, unknown> ? $MergeObjects<T$1[K], U$1[K]> : U$1[K] : U$1[K] : T$1[K] : K extends keyof U$1 ? U$1[K] : never };
|
|
69
69
|
/**
|
|
70
70
|
* Merges two discriminated unions A and B based on a discriminator key (defaults to "type").
|
|
71
71
|
* For each possible value of the discriminator across both unions:
|
|
@@ -79,14 +79,14 @@ $OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true
|
|
|
79
79
|
*/
|
|
80
80
|
type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = "type"> = { [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value
|
|
81
81
|
? Extract<A, Record<Key, T>> : [Extract<A, Record<Key, T>>] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>> }[A[Key] | B[Key]];
|
|
82
|
-
type Constructor<T> = new (...args: unknown[]) => T;
|
|
82
|
+
type Constructor<T$1> = new (...args: unknown[]) => T$1;
|
|
83
83
|
/**
|
|
84
84
|
* Immediately-invoked function expression.
|
|
85
85
|
*
|
|
86
86
|
* @param fn - The function to execute
|
|
87
87
|
* @returns The result of the function
|
|
88
88
|
*/
|
|
89
|
-
declare const iife: <T>(fn: () => T) => T;
|
|
89
|
+
declare const iife: <T$1>(fn: () => T$1) => T$1;
|
|
90
90
|
declare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;
|
|
91
91
|
/**
|
|
92
92
|
* This function is used by memory classes to get a string representation
|
package/dist/messages/utils.d.ts
CHANGED
|
@@ -8,28 +8,28 @@ import { SystemMessage, SystemMessageChunk } from "./system.js";
|
|
|
8
8
|
import { MessageStructure } from "./message.js";
|
|
9
9
|
|
|
10
10
|
//#region src/messages/utils.d.ts
|
|
11
|
-
type $Expand<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
11
|
+
type $Expand<T$1> = T$1 extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
12
12
|
/**
|
|
13
13
|
* Extracts the explicitly declared keys from a type T.
|
|
14
14
|
*
|
|
15
15
|
* @template T - The type to extract keys from
|
|
16
16
|
* @returns A union of keys that are not string, number, or symbol
|
|
17
17
|
*/
|
|
18
|
-
type $KnownKeys<T> = { [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T];
|
|
18
|
+
type $KnownKeys<T$1> = { [K in keyof T$1]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T$1];
|
|
19
19
|
/**
|
|
20
20
|
* Detects if T has an index signature.
|
|
21
21
|
*
|
|
22
22
|
* @template T - The type to check for index signatures
|
|
23
23
|
* @returns True if T has an index signature, false otherwise
|
|
24
24
|
*/
|
|
25
|
-
type $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;
|
|
25
|
+
type $HasIndexSignature<T$1> = string extends keyof T$1 ? true : number extends keyof T$1 ? true : symbol extends keyof T$1 ? true : false;
|
|
26
26
|
/**
|
|
27
27
|
* Detects if T has an index signature and no known keys.
|
|
28
28
|
*
|
|
29
29
|
* @template T - The type to check for index signatures and no known keys
|
|
30
30
|
* @returns True if T has an index signature and no known keys, false otherwise
|
|
31
31
|
*/
|
|
32
|
-
type $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;
|
|
32
|
+
type $OnlyIndexSignatures<T$1> = $HasIndexSignature<T$1> extends true ? [$KnownKeys<T$1>] extends [never] ? true : false : false;
|
|
33
33
|
/**
|
|
34
34
|
* Recursively merges two object types T and U, with U taking precedence over T.
|
|
35
35
|
*
|
|
@@ -63,9 +63,9 @@ type $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<
|
|
|
63
63
|
* // }
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
type $MergeObjects<T, U> =
|
|
66
|
+
type $MergeObjects<T$1, U$1> =
|
|
67
67
|
// If U is purely index-signature based, prefer U as a whole
|
|
68
|
-
$OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : { [K in keyof T | keyof U]: K extends keyof T ? K extends keyof U ? T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? $MergeObjects<T[K], U[K]> : U[K] : U[K] : T[K] : K extends keyof U ? U[K] : never };
|
|
68
|
+
$OnlyIndexSignatures<U$1> extends true ? U$1 : $OnlyIndexSignatures<T$1> extends true ? U$1 : { [K in keyof T$1 | keyof U$1]: K extends keyof T$1 ? K extends keyof U$1 ? T$1[K] extends Record<string, unknown> ? U$1[K] extends Record<string, unknown> ? $MergeObjects<T$1[K], U$1[K]> : U$1[K] : U$1[K] : T$1[K] : K extends keyof U$1 ? U$1[K] : never };
|
|
69
69
|
/**
|
|
70
70
|
* Merges two discriminated unions A and B based on a discriminator key (defaults to "type").
|
|
71
71
|
* For each possible value of the discriminator across both unions:
|
|
@@ -79,14 +79,14 @@ $OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true
|
|
|
79
79
|
*/
|
|
80
80
|
type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = "type"> = { [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value
|
|
81
81
|
? Extract<A, Record<Key, T>> : [Extract<A, Record<Key, T>>] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>> }[A[Key] | B[Key]];
|
|
82
|
-
type Constructor<T> = new (...args: unknown[]) => T;
|
|
82
|
+
type Constructor<T$1> = new (...args: unknown[]) => T$1;
|
|
83
83
|
/**
|
|
84
84
|
* Immediately-invoked function expression.
|
|
85
85
|
*
|
|
86
86
|
* @param fn - The function to execute
|
|
87
87
|
* @returns The result of the function
|
|
88
88
|
*/
|
|
89
|
-
declare const iife: <T>(fn: () => T) => T;
|
|
89
|
+
declare const iife: <T$1>(fn: () => T$1) => T$1;
|
|
90
90
|
declare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;
|
|
91
91
|
/**
|
|
92
92
|
* This function is used by memory classes to get a string representation
|
|
@@ -3,8 +3,11 @@ import { BaseMessage } from "../messages/base.js";
|
|
|
3
3
|
import { ChatGeneration, Generation } from "../outputs.js";
|
|
4
4
|
import { Callbacks } from "../callbacks/manager.js";
|
|
5
5
|
import { RunnableConfig } from "../runnables/types.js";
|
|
6
|
+
import "../runnables/config.js";
|
|
6
7
|
import { Runnable } from "../runnables/base.js";
|
|
7
8
|
import { BasePromptValueInterface } from "../prompt_values.js";
|
|
9
|
+
import "../messages/index.js";
|
|
10
|
+
import "../runnables/index.js";
|
|
8
11
|
|
|
9
12
|
//#region src/output_parsers/base.d.ts
|
|
10
13
|
/**
|
|
@@ -2,11 +2,11 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_json = require('../utils/json.cjs');
|
|
3
3
|
const require_base = require('./base.cjs');
|
|
4
4
|
const require_transform = require('./transform.cjs');
|
|
5
|
+
const require_json$1 = require('./json.cjs');
|
|
5
6
|
const require_bytes = require('./bytes.cjs');
|
|
6
7
|
const require_list = require('./list.cjs');
|
|
7
8
|
const require_string = require('./string.cjs');
|
|
8
9
|
const require_structured = require('./structured.cjs');
|
|
9
|
-
const require_json$1 = require('./json.cjs');
|
|
10
10
|
const require_xml = require('./xml.cjs');
|
|
11
11
|
|
|
12
12
|
//#region src/output_parsers/index.ts
|
|
@@ -2,11 +2,11 @@ import { __export } from "../_virtual/rolldown_runtime.js";
|
|
|
2
2
|
import { parseJsonMarkdown, parsePartialJson } from "../utils/json.js";
|
|
3
3
|
import { BaseLLMOutputParser, BaseOutputParser, OutputParserException } from "./base.js";
|
|
4
4
|
import { BaseCumulativeTransformOutputParser, BaseTransformOutputParser } from "./transform.js";
|
|
5
|
+
import { JsonOutputParser } from "./json.js";
|
|
5
6
|
import { BytesOutputParser } from "./bytes.js";
|
|
6
7
|
import { CommaSeparatedListOutputParser, CustomListOutputParser, ListOutputParser, MarkdownListOutputParser, NumberedListOutputParser } from "./list.js";
|
|
7
8
|
import { StringOutputParser } from "./string.js";
|
|
8
9
|
import { AsymmetricStructuredOutputParser, JsonMarkdownStructuredOutputParser, StructuredOutputParser } from "./structured.js";
|
|
9
|
-
import { JsonOutputParser } from "./json.js";
|
|
10
10
|
import { XMLOutputParser, XML_FORMAT_INSTRUCTIONS, parseXMLMarkdown } from "./xml.js";
|
|
11
11
|
|
|
12
12
|
//#region src/output_parsers/index.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChatGeneration, Generation } from "../../outputs.js";
|
|
2
2
|
import { Operation } from "../../utils/fast-json-patch/src/core.js";
|
|
3
3
|
import { JsonSchema7ObjectType } from "../../utils/zod-to-json-schema/parsers/object.js";
|
|
4
|
+
import "../../utils/json_schema.js";
|
|
4
5
|
import { BaseLLMOutputParser } from "../base.js";
|
|
5
6
|
import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from "../transform.js";
|
|
6
7
|
import { Optional } from "../../types/type-utils.js";
|
|
7
8
|
|
|
8
9
|
//#region src/output_parsers/openai_functions/json_output_functions_parsers.d.ts
|
|
9
|
-
|
|
10
10
|
/**
|
|
11
11
|
* Represents optional parameters for a function in a JSON Schema.
|
|
12
12
|
*/
|
package/dist/prompts/base.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BaseCallbackConfig } from "../callbacks/manager.js";
|
|
|
4
4
|
import { Runnable } from "../runnables/base.js";
|
|
5
5
|
import { BasePromptValueInterface } from "../prompt_values.js";
|
|
6
6
|
import { BaseOutputParser } from "../output_parsers/base.js";
|
|
7
|
+
import "../output_parsers/index.js";
|
|
7
8
|
|
|
8
9
|
//#region src/prompts/base.d.ts
|
|
9
10
|
type TypedPromptInputValues<RunInput> = InputValues<StringWithAutocomplete<Extract<keyof RunInput, string>>>;
|
package/dist/prompts/chat.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { InputValues, PartialValues } from "../utils/types/index.js";
|
|
|
8
8
|
import { BaseCallbackConfig } from "../callbacks/manager.js";
|
|
9
9
|
import { Runnable } from "../runnables/base.js";
|
|
10
10
|
import { ChatPromptValueInterface } from "../prompt_values.js";
|
|
11
|
+
import "../messages/index.js";
|
|
11
12
|
import { BasePromptTemplate, BasePromptTemplateInput, TypedPromptInputValues } from "./base.js";
|
|
12
13
|
import { BaseStringPromptTemplate } from "./string.js";
|
|
13
14
|
import { TemplateFormat } from "./template.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseMessage } from "../messages/base.js";
|
|
2
2
|
import { InputValues, PartialValues } from "../utils/types/index.js";
|
|
3
|
+
import "../messages/index.js";
|
|
3
4
|
import { BasePromptTemplateInput, Example, TypedPromptInputValues } from "./base.js";
|
|
4
5
|
import { BaseExampleSelector } from "../example_selectors/base.js";
|
|
5
6
|
import { BaseStringPromptTemplate } from "./string.js";
|
package/dist/prompts/image.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ContentBlock } from "../messages/content/index.js";
|
|
2
2
|
import { InputValues, PartialValues } from "../utils/types/index.js";
|
|
3
3
|
import { ImageContent, ImagePromptValue } from "../prompt_values.js";
|
|
4
|
+
import "../messages/index.js";
|
|
4
5
|
import { BasePromptTemplate, BasePromptTemplateInput, TypedPromptInputValues } from "./base.js";
|
|
5
6
|
import { TemplateFormat } from "./template.js";
|
|
6
7
|
|
package/dist/prompts/prompt.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ContentBlock } from "../messages/content/index.js";
|
|
2
2
|
import { MessageContent } from "../messages/base.js";
|
|
3
3
|
import { InputValues, PartialValues } from "../utils/types/index.js";
|
|
4
|
+
import "../messages/index.js";
|
|
4
5
|
import { BasePromptTemplateInput, TypedPromptInputValues } from "./base.js";
|
|
5
6
|
import { BaseStringPromptTemplate } from "./string.js";
|
|
6
7
|
import { TemplateFormat } from "./template.js";
|
package/dist/prompts/serde.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { InputValues } from "../utils/types/index.js";
|
|
2
2
|
import { RunnableConfig } from "../runnables/types.js";
|
|
3
|
+
import "../runnables/config.js";
|
|
3
4
|
import { Runnable, RunnableLike } from "../runnables/base.js";
|
|
4
5
|
import { ChatPromptValueInterface } from "../prompt_values.js";
|
|
5
6
|
import { BaseMessagePromptTemplateLike, ChatPromptTemplate, ChatPromptTemplateInput } from "./chat.js";
|
|
6
7
|
|
|
7
8
|
//#region src/prompts/structured.d.ts
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* Interface for the input of a ChatPromptTemplate.
|
|
11
11
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
|
|
3
|
-
//#region src/retrievers/document_compressors/
|
|
4
|
-
var
|
|
5
|
-
require_rolldown_runtime.__export(
|
|
3
|
+
//#region src/retrievers/document_compressors/index.ts
|
|
4
|
+
var document_compressors_exports = {};
|
|
5
|
+
require_rolldown_runtime.__export(document_compressors_exports, { BaseDocumentCompressor: () => BaseDocumentCompressor });
|
|
6
6
|
/**
|
|
7
7
|
* Base Document Compression class. All compressors should extend this class.
|
|
8
8
|
*/
|
|
@@ -14,10 +14,10 @@ var BaseDocumentCompressor = class {
|
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
exports.BaseDocumentCompressor = BaseDocumentCompressor;
|
|
17
|
-
Object.defineProperty(exports, '
|
|
17
|
+
Object.defineProperty(exports, 'document_compressors_exports', {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function () {
|
|
20
|
-
return
|
|
20
|
+
return document_compressors_exports;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["x: any"],"sources":["../../../src/retrievers/document_compressors/index.ts"],"sourcesContent":["import { Callbacks } from \"../../callbacks/manager.js\";\nimport { DocumentInterface } from \"../../documents/document.js\";\n\n/**\n * Base Document Compression class. All compressors should extend this class.\n */\nexport abstract class BaseDocumentCompressor {\n /**\n * Abstract method that must be implemented by any class that extends\n * `BaseDocumentCompressor`. This method takes an array of `Document`\n * objects and a query string as parameters and returns a Promise that\n * resolves with an array of compressed `Document` objects.\n * @param documents An array of `Document` objects to be compressed.\n * @param query A query string.\n * @returns A Promise that resolves with an array of compressed `Document` objects.\n */\n abstract compressDocuments(\n documents: DocumentInterface[],\n query: string,\n callbacks?: Callbacks\n ): Promise<DocumentInterface[]>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isBaseDocumentCompressor(x: any): x is BaseDocumentCompressor {\n return x?.compressDocuments !== undefined;\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAsB,yBAAtB,MAA6C;CAiB3C,OAAO,yBAAyBA,GAAqC;AACnE,SAAO,GAAG,sBAAsB;CACjC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocumentInterface } from "../../documents/document.cjs";
|
|
2
2
|
import { Callbacks } from "../../callbacks/manager.cjs";
|
|
3
3
|
|
|
4
|
-
//#region src/retrievers/document_compressors/
|
|
4
|
+
//#region src/retrievers/document_compressors/index.d.ts
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Base Document Compression class. All compressors should extend this class.
|
|
@@ -22,4 +22,4 @@ declare abstract class BaseDocumentCompressor {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { BaseDocumentCompressor };
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocumentInterface } from "../../documents/document.js";
|
|
2
2
|
import { Callbacks } from "../../callbacks/manager.js";
|
|
3
3
|
|
|
4
|
-
//#region src/retrievers/document_compressors/
|
|
4
|
+
//#region src/retrievers/document_compressors/index.d.ts
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Base Document Compression class. All compressors should extend this class.
|
|
@@ -22,4 +22,4 @@ declare abstract class BaseDocumentCompressor {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { BaseDocumentCompressor };
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __export } from "../../_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/retrievers/document_compressors/index.ts
|
|
4
|
+
var document_compressors_exports = {};
|
|
5
|
+
__export(document_compressors_exports, { BaseDocumentCompressor: () => BaseDocumentCompressor });
|
|
6
|
+
/**
|
|
7
|
+
* Base Document Compression class. All compressors should extend this class.
|
|
8
|
+
*/
|
|
9
|
+
var BaseDocumentCompressor = class {
|
|
10
|
+
static isBaseDocumentCompressor(x) {
|
|
11
|
+
return x?.compressDocuments !== void 0;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { BaseDocumentCompressor, document_compressors_exports };
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["x: any"],"sources":["../../../src/retrievers/document_compressors/index.ts"],"sourcesContent":["import { Callbacks } from \"../../callbacks/manager.js\";\nimport { DocumentInterface } from \"../../documents/document.js\";\n\n/**\n * Base Document Compression class. All compressors should extend this class.\n */\nexport abstract class BaseDocumentCompressor {\n /**\n * Abstract method that must be implemented by any class that extends\n * `BaseDocumentCompressor`. This method takes an array of `Document`\n * objects and a query string as parameters and returns a Promise that\n * resolves with an array of compressed `Document` objects.\n * @param documents An array of `Document` objects to be compressed.\n * @param query A query string.\n * @returns A Promise that resolves with an array of compressed `Document` objects.\n */\n abstract compressDocuments(\n documents: DocumentInterface[],\n query: string,\n callbacks?: Callbacks\n ): Promise<DocumentInterface[]>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isBaseDocumentCompressor(x: any): x is BaseDocumentCompressor {\n return x?.compressDocuments !== undefined;\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAsB,yBAAtB,MAA6C;CAiB3C,OAAO,yBAAyBA,GAAqC;AACnE,SAAO,GAAG,sBAAsB;CACjC;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DocumentInterface } from "../documents/document.js";
|
|
2
2
|
import { CallbackManagerForRetrieverRun, Callbacks } from "../callbacks/manager.js";
|
|
3
3
|
import { RunnableConfig, RunnableInterface } from "../runnables/types.js";
|
|
4
|
+
import "../runnables/config.js";
|
|
4
5
|
import { Runnable } from "../runnables/base.js";
|
|
5
6
|
|
|
6
7
|
//#region src/retrievers/index.d.ts
|
package/dist/runnables/base.cjs
CHANGED
|
@@ -837,7 +837,7 @@ var RunnableRetry = class extends RunnableBinding {
|
|
|
837
837
|
}
|
|
838
838
|
async _invoke(input, config, runManager) {
|
|
839
839
|
return (0, p_retry.default)((attemptNumber) => super.invoke(input, this._patchConfigForRetry(attemptNumber, config, runManager)), {
|
|
840
|
-
onFailedAttempt: (error) => this.onFailedAttempt(error, input),
|
|
840
|
+
onFailedAttempt: ({ error }) => this.onFailedAttempt(error, input),
|
|
841
841
|
retries: Math.max(this.maxAttemptNumber - 1, 0),
|
|
842
842
|
randomize: true
|
|
843
843
|
});
|
|
@@ -881,7 +881,7 @@ var RunnableRetry = class extends RunnableBinding {
|
|
|
881
881
|
if (firstException) throw firstException;
|
|
882
882
|
return results;
|
|
883
883
|
}, {
|
|
884
|
-
onFailedAttempt: (error) => this.onFailedAttempt(error, error.input),
|
|
884
|
+
onFailedAttempt: ({ error }) => this.onFailedAttempt(error, error.input),
|
|
885
885
|
retries: Math.max(this.maxAttemptNumber - 1, 0),
|
|
886
886
|
randomize: true
|
|
887
887
|
});
|