@langchain/core 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -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 +1 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.d.cts +0 -13
- package/dist/tools/types.d.ts +2 -13
- package/dist/tracers/event_stream.d.ts +1 -0
- package/dist/utils/async_caller.cjs +1 -1
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.js +1 -1
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modifier.d.cts","names":["BaseMessage","BaseMessageFields","MessageStructure","RemoveMessageFields","TStructure","Omit","RemoveMessage","Record"],"sources":["../../src/messages/modifier.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageFields } from \"./base.js\";\nimport { MessageStructure } from \"./message.js\";\nexport interface RemoveMessageFields<TStructure extends MessageStructure = MessageStructure> extends Omit<BaseMessageFields<TStructure, \"remove\">, \"content\"> {\n /**\n * The ID of the message to remove.\n */\n id: string;\n}\n/**\n * Message responsible for deleting other messages.\n */\nexport declare class RemoveMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"remove\"> {\n readonly type: \"remove\";\n /**\n * The ID of the message to remove.\n */\n id: string;\n constructor(fields: RemoveMessageFields<TStructure>);\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is RemoveMessage;\n}\n"],"mappings":";;;;UAEiBG,uCAAuCD,mBAAmBA,0BAA0BG,KAAKJ,kBAAkBG;;AAA5H;;EAAoC,EAAA,EAAoBF,MAAAA;;;;;AAAiD,cASpFI,aAToF,CAAA,mBASnDJ,gBATmD,GAShCA,gBATgC,CAAA,SASNF,WATM,CASMI,UATN,EAAA,QAAA,CAAA,CAAA;EASpFE,SAAAA,IAAAA,EAAAA,QAAa;EAAA;;;EAAuD,EAAA,EAAsBF,MAAAA;EAAU,WAM7EA,CAAAA,MAAAA,EAApBD,mBAAoBC,CAAAA,UAAAA,CAAAA;EAAU,IAA9BD,gBAAAA,CAAAA,CAAAA,EACII,MADJJ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAAmB,OACfI,UAAAA,CAAAA,GAAAA,EAAAA,OAAAA,CAAAA,EAAAA,GAAAA,IACgBD,aADhBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modifier.d.ts","names":["BaseMessage","BaseMessageFields","MessageStructure","RemoveMessageFields","TStructure","Omit","RemoveMessage","Record"],"sources":["../../src/messages/modifier.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageFields } from \"./base.js\";\nimport { MessageStructure } from \"./message.js\";\nexport interface RemoveMessageFields<TStructure extends MessageStructure = MessageStructure> extends Omit<BaseMessageFields<TStructure, \"remove\">, \"content\"> {\n /**\n * The ID of the message to remove.\n */\n id: string;\n}\n/**\n * Message responsible for deleting other messages.\n */\nexport declare class RemoveMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"remove\"> {\n readonly type: \"remove\";\n /**\n * The ID of the message to remove.\n */\n id: string;\n constructor(fields: RemoveMessageFields<TStructure>);\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is RemoveMessage;\n}\n"],"mappings":";;;;UAEiBG,uCAAuCD,mBAAmBA,0BAA0BG,KAAKJ,kBAAkBG;;AAA5H;;EAAoC,EAAA,EAAoBF,MAAAA;;;;;AAAiD,cASpFI,aAToF,CAAA,mBASnDJ,gBATmD,GAShCA,gBATgC,CAAA,SASNF,WATM,CASMI,UATN,EAAA,QAAA,CAAA,CAAA;EASpFE,SAAAA,IAAAA,EAAAA,QAAa;EAAA;;;EAAuD,EAAA,EAAsBF,MAAAA;EAAU,WAM7EA,CAAAA,MAAAA,EAApBD,mBAAoBC,CAAAA,UAAAA,CAAAA;EAAU,IAA9BD,gBAAAA,CAAAA,CAAAA,EACII,MADJJ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAAmB,OACfI,UAAAA,CAAAA,GAAAA,EAAAA,OAAAA,CAAAA,EAAAA,GAAAA,IACgBD,aADhBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","SystemMessageFields","TStructure","SystemMessage","SystemMessageChunk","isSystemMessage","isSystemMessageChunk"],"sources":["../../src/messages/system.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface SystemMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"system\"> {\n}\n/**\n * Represents a system message in a conversation.\n */\nexport declare class SystemMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"system\"> {\n static lc_name(): string;\n readonly type: \"system\";\n constructor(fields: $InferMessageContent<TStructure, \"system\"> | SystemMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is SystemMessage;\n}\n/**\n * Represents a chunk of a system message, which can be concatenated with\n * other system message chunks.\n */\nexport declare class SystemMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"system\"> {\n static lc_name(): string;\n readonly type: \"system\";\n constructor(fields: $InferMessageContent<TStructure, \"system\"> | SystemMessageFields<TStructure>);\n concat(chunk: SystemMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is SystemMessageChunk;\n}\n/**\n * @deprecated Use {@link SystemMessage.isInstance} instead\n */\nexport declare function isSystemMessage<TStructure extends MessageStructure>(x: BaseMessage): x is SystemMessage<TStructure>;\n/**\n * @deprecated Use {@link SystemMessageChunk.isInstance} instead\n */\nexport declare function isSystemMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is SystemMessageChunk<TStructure>;\n"],"mappings":";;;;UAEiBK,uCAAuCD,mBAAmBA,0BAA0BF,kBAAkBI;AAAvH;;;AAA2EF,cAKtDG,aALsDH,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBJ,WALxBI,CAKoCE,UALpCF,EAAAA,QAAAA,CAAAA,CAAAA;EAAgB,OAA4BE,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA5BJ,IAAAA,EAAAA,QAAAA;EAAiB,WAAA,CAAA,MAAA,EAQ9FC,oBAR8F,CAQzEG,UARyE,EAAA,QAAA,CAAA,GAQjDD,mBARiD,CAQ7BC,UAR6B,CAAA;EAKjGC,OAAAA,UAAa,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAIUA,aAJV;;;;;;AAGVJ,cAOHK,kBAPGL,CAAAA,mBAOmCC,gBAPnCD,GAOsDC,gBAPtDD,CAAAA,SAOgFF,gBAPhFE,CAOiGG,UAPjGH,EAAAA,QAAAA,CAAAA,CAAAA;EAAoB,OAA6CG,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA9BD,IAAAA,EAAAA,QAAAA;EAAmB,WAC5CE,CAAAA,MAAAA,EASpBJ,oBAToBI,CASCD,UATDC,EAAAA,QAAAA,CAAAA,GASyBF,mBATzBE,CAS6CD,UAT7CC,CAAAA;EAAa,MAJ0CP,CAAAA,KAAAA,EAcjFQ,kBAdiFR,CAc9DM,UAd8DN,CAAAA,CAAAA,EAAAA,IAAAA;EAAW,OAAA,UAAA,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAelEQ,kBAfkE;AAU9G;;;;AAAyHF,iBAUjGG,eAViGH,CAAAA,mBAU9DF,gBAV8DE,CAAAA,CAAAA,CAAAA,EAUzCN,WAVyCM,CAAAA,EAAAA,CAAAA,IAUtBC,aAVsBD,CAURA,UAVQA,CAAAA;;;;AAGpDD,iBAW7CK,oBAX6CL,CAAAA,mBAWLD,gBAXKC,CAAAA,CAAAA,CAAAA,EAWgBJ,gBAXhBI,CAAAA,EAAAA,CAAAA,IAWwCG,kBAXxCH,CAW2DC,UAX3DD,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","SystemMessageFields","TStructure","SystemMessage","SystemMessageChunk","isSystemMessage","isSystemMessageChunk"],"sources":["../../src/messages/system.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface SystemMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"system\"> {\n}\n/**\n * Represents a system message in a conversation.\n */\nexport declare class SystemMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"system\"> {\n static lc_name(): string;\n readonly type: \"system\";\n constructor(fields: $InferMessageContent<TStructure, \"system\"> | SystemMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is SystemMessage;\n}\n/**\n * Represents a chunk of a system message, which can be concatenated with\n * other system message chunks.\n */\nexport declare class SystemMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"system\"> {\n static lc_name(): string;\n readonly type: \"system\";\n constructor(fields: $InferMessageContent<TStructure, \"system\"> | SystemMessageFields<TStructure>);\n concat(chunk: SystemMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is SystemMessageChunk;\n}\n/**\n * @deprecated Use {@link SystemMessage.isInstance} instead\n */\nexport declare function isSystemMessage<TStructure extends MessageStructure>(x: BaseMessage): x is SystemMessage<TStructure>;\n/**\n * @deprecated Use {@link SystemMessageChunk.isInstance} instead\n */\nexport declare function isSystemMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is SystemMessageChunk<TStructure>;\n"],"mappings":";;;;UAEiBK,uCAAuCD,mBAAmBA,0BAA0BF,kBAAkBI;AAAvH;;;AAA2EF,cAKtDG,aALsDH,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBJ,WALxBI,CAKoCE,UALpCF,EAAAA,QAAAA,CAAAA,CAAAA;EAAgB,OAA4BE,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA5BJ,IAAAA,EAAAA,QAAAA;EAAiB,WAAA,CAAA,MAAA,EAQ9FC,oBAR8F,CAQzEG,UARyE,EAAA,QAAA,CAAA,GAQjDD,mBARiD,CAQ7BC,UAR6B,CAAA;EAKjGC,OAAAA,UAAa,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAIUA,aAJV;;;;;;AAGVJ,cAOHK,kBAPGL,CAAAA,mBAOmCC,gBAPnCD,GAOsDC,gBAPtDD,CAAAA,SAOgFF,gBAPhFE,CAOiGG,UAPjGH,EAAAA,QAAAA,CAAAA,CAAAA;EAAoB,OAA6CG,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA9BD,IAAAA,EAAAA,QAAAA;EAAmB,WAC5CE,CAAAA,MAAAA,EASpBJ,oBAToBI,CASCD,UATDC,EAAAA,QAAAA,CAAAA,GASyBF,mBATzBE,CAS6CD,UAT7CC,CAAAA;EAAa,MAJ0CP,CAAAA,KAAAA,EAcjFQ,kBAdiFR,CAc9DM,UAd8DN,CAAAA,CAAAA,EAAAA,IAAAA;EAAW,OAAA,UAAA,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAelEQ,kBAfkE;AAU9G;;;;AAAyHF,iBAUjGG,eAViGH,CAAAA,mBAU9DF,gBAV8DE,CAAAA,CAAAA,CAAAA,EAUzCN,WAVyCM,CAAAA,EAAAA,CAAAA,IAUtBC,aAVsBD,CAURA,UAVQA,CAAAA;;;;AAGpDD,iBAW7CK,oBAX6CL,CAAAA,mBAWLD,gBAXKC,CAAAA,CAAAA,CAAAA,EAWgBJ,gBAXhBI,CAAAA,EAAAA,CAAAA,IAWwCG,kBAXxCH,CAW2DC,UAX3DD,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ToolMessageFields","TStructure","Record","DirectToolOutput","isDirectToolOutput","ToolMessage","ToolMessageChunk","ToolCall","TName","TArgs","ToolCallChunk","InvalidToolCall","defaultToolCallParser","isToolMessage","isToolMessageChunk"],"sources":["../../src/messages/tool.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ToolMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"tool\"> {\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n tool_call_id: string;\n status?: \"success\" | \"error\";\n metadata?: Record<string, unknown>;\n}\n/**\n * Marker parameter for objects that tools can return directly.\n *\n * If a custom BaseTool is invoked with a ToolCall and the output of custom code is\n * not an instance of DirectToolOutput, the output will automatically be coerced to\n * a string and wrapped in a ToolMessage.\n */\nexport interface DirectToolOutput {\n readonly lc_direct_tool_output: true;\n}\nexport declare function isDirectToolOutput(x: unknown): x is DirectToolOutput;\n/**\n * Represents a tool message in a conversation.\n */\nexport declare class ToolMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"tool\"> implements DirectToolOutput {\n static lc_name(): string;\n get lc_aliases(): Record<string, string>;\n lc_direct_tool_output: true;\n readonly type: \"tool\";\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n tool_call_id: string;\n metadata?: Record<string, unknown>;\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n constructor(fields: $InferMessageContent<TStructure, \"tool\"> | ToolMessageFields, tool_call_id: string, name?: string);\n constructor(fields: ToolMessageFields<TStructure>);\n static isInstance(message: unknown): message is ToolMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a tool message, which can be concatenated\n * with other tool message chunks.\n */\nexport declare class ToolMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"tool\"> {\n readonly type: \"tool\";\n tool_call_id: string;\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n constructor(fields: ToolMessageFields<TStructure>);\n static lc_name(): string;\n concat(chunk: ToolMessageChunk<TStructure>): this;\n get _printableFields(): Record<string, unknown>;\n}\nexport interface ToolCall<TName extends string = string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nTArgs extends Record<string, any> = Record<string, any>> {\n readonly type?: \"tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n}\n/**\n * A chunk of a tool call (e.g., as part of a stream).\n * When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),\n * all string attributes are concatenated. Chunks are only merged if their\n * values of `index` are equal and not None.\n *\n * @example\n * ```ts\n * const leftChunks = [\n * {\n * name: \"foo\",\n * args: '{\"a\":',\n * index: 0\n * }\n * ];\n *\n * const leftAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: leftChunks\n * });\n *\n * const rightChunks = [\n * {\n * name: undefined,\n * args: '1}',\n * index: 0\n * }\n * ];\n *\n * const rightAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: rightChunks\n * });\n *\n * const result = leftAIMessageChunk.concat(rightAIMessageChunk);\n * // result.tool_call_chunks is equal to:\n * // [\n * // {\n * // name: \"foo\",\n * // args: '{\"a\":1}'\n * // index: 0\n * // }\n * // ]\n * ```\n */\nexport interface ToolCallChunk<TName extends string = string> {\n readonly type?: \"tool_call_chunk\";\n /**\n * If provided, a substring of an identifier for the tool call\n */\n id?: string;\n /**\n * If provided, a substring of the name of the tool to be called\n */\n name?: TName;\n /**\n * If provided, a JSON substring of the arguments to the tool call\n */\n args?: string;\n /**\n * If provided, the index of the tool call in a sequence\n */\n index?: number;\n}\nexport interface InvalidToolCall<TName extends string = string> {\n readonly type?: \"invalid_tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * An error message associated with the tool call\n */\n error?: string;\n /**\n * Index of block in aggregate response\n */\n index?: string | number;\n}\nexport declare function defaultToolCallParser(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCalls: Record<string, any>[]): [ToolCall[], InvalidToolCall[]];\n/**\n * @deprecated Use {@link ToolMessage.isInstance} instead\n */\nexport declare function isToolMessage(x: unknown): x is ToolMessage;\n/**\n * @deprecated Use {@link ToolMessageChunk.isInstance} instead\n */\nexport declare function isToolMessageChunk(x: BaseMessageChunk): x is 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AuIqB,CAvIHC,UAuIG,CAAA;EAAA,OAAA,UAAA,CAAA,OAAA,EAAA,OAAA,CAAA,EAAA,OAAA,IAtIOI,WAsIP;EAAA,IAE/BH,gBAAAA,CAAAA,CAAAA,EAvIcA,MAuIdA,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;;;AAAoD;AAIlE;AAIA;AAA0C,cAzIrBI,gBAyIqB,CAAA,mBAzIeP,gBAyIf,GAzIkCA,gBAyIlC,CAAA,SAzI4DH,gBAyI5D,CAzI6EK,UAyI7E,EAAA,MAAA,CAAA,CAAA;EAAA,SAAIL,IAAAA,EAAAA,MAAAA;EAAgB,YAAQU,EAAAA,MAAAA;EAAgB;;;;;;;;;;;;;;sBAxH9DN,kBAAkBC;;gBAExBK,iBAAiBL;0BACPC;;UAEXK;;cAEHL,sBAAsBA;;;;;;;;;QAS1BM;;;;QAIAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+COC;;;;;;;;;SASNF;;;;;;;;;;UAUMG;;;;;;;;;;SAUNH;;;;;;;;;;;;;;iBAcaI,qBAAAA;;cAEVV,yBAAyBK,YAAYI;;;;iBAI3BE,aAAAA,mBAAgCR;;;;iBAIhCS,kBAAAA,IAAsBlB,wBAAwBU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ToolMessageFields","TStructure","Record","DirectToolOutput","isDirectToolOutput","ToolMessage","ToolMessageChunk","ToolCall","TName","TArgs","ToolCallChunk","InvalidToolCall","defaultToolCallParser","isToolMessage","isToolMessageChunk"],"sources":["../../src/messages/tool.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ToolMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"tool\"> {\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n tool_call_id: string;\n status?: \"success\" | \"error\";\n metadata?: Record<string, unknown>;\n}\n/**\n * Marker parameter for objects that tools can return directly.\n *\n * If a custom BaseTool is invoked with a ToolCall and the output of custom code is\n * not an instance of DirectToolOutput, the output will automatically be coerced to\n * a string and wrapped in a ToolMessage.\n */\nexport interface DirectToolOutput {\n readonly lc_direct_tool_output: true;\n}\nexport declare function isDirectToolOutput(x: unknown): x is DirectToolOutput;\n/**\n * Represents a tool message in a conversation.\n */\nexport declare class ToolMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"tool\"> implements DirectToolOutput {\n static lc_name(): string;\n get lc_aliases(): Record<string, string>;\n lc_direct_tool_output: true;\n readonly type: \"tool\";\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n tool_call_id: string;\n metadata?: Record<string, unknown>;\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n constructor(fields: $InferMessageContent<TStructure, \"tool\"> | ToolMessageFields, tool_call_id: string, name?: string);\n constructor(fields: ToolMessageFields<TStructure>);\n static isInstance(message: unknown): message is ToolMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a tool message, which can be concatenated\n * with other tool message chunks.\n */\nexport declare class ToolMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"tool\"> {\n readonly type: \"tool\";\n tool_call_id: string;\n /**\n * Status of the tool invocation.\n * @version 0.2.19\n */\n status?: \"success\" | \"error\";\n /**\n * Artifact of the Tool execution which is not meant to be sent to the model.\n *\n * Should only be specified if it is different from the message content, e.g. if only\n * a subset of the full tool output is being passed as message content but the full\n * output is needed in other parts of the code.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n artifact?: any;\n constructor(fields: ToolMessageFields<TStructure>);\n static lc_name(): string;\n concat(chunk: ToolMessageChunk<TStructure>): this;\n get _printableFields(): Record<string, unknown>;\n}\nexport interface ToolCall<TName extends string = string, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nTArgs extends Record<string, any> = Record<string, any>> {\n readonly type?: \"tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n * The name of the tool being called\n */\n name: TName;\n /**\n * The arguments to the tool call\n */\n args: TArgs;\n}\n/**\n * A chunk of a tool call (e.g., as part of a stream).\n * When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),\n * all string attributes are concatenated. Chunks are only merged if their\n * values of `index` are equal and not None.\n *\n * @example\n * ```ts\n * const leftChunks = [\n * {\n * name: \"foo\",\n * args: '{\"a\":',\n * index: 0\n * }\n * ];\n *\n * const leftAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: leftChunks\n * });\n *\n * const rightChunks = [\n * {\n * name: undefined,\n * args: '1}',\n * index: 0\n * }\n * ];\n *\n * const rightAIMessageChunk = new AIMessageChunk({\n * content: \"\",\n * tool_call_chunks: rightChunks\n * });\n *\n * const result = leftAIMessageChunk.concat(rightAIMessageChunk);\n * // result.tool_call_chunks is equal to:\n * // [\n * // {\n * // name: \"foo\",\n * // args: '{\"a\":1}'\n * // index: 0\n * // }\n * // ]\n * ```\n */\nexport interface ToolCallChunk<TName extends string = string> {\n readonly type?: \"tool_call_chunk\";\n /**\n * If provided, a substring of an identifier for the tool call\n */\n id?: string;\n /**\n * If provided, a substring of the name of the tool to be called\n */\n name?: TName;\n /**\n * If provided, a JSON substring of the arguments to the tool call\n */\n args?: string;\n /**\n * If provided, the index of the tool call in a sequence\n */\n index?: number;\n}\nexport interface InvalidToolCall<TName extends string = string> {\n readonly type?: \"invalid_tool_call\";\n /**\n * If provided, an identifier associated with the tool call\n */\n id?: string;\n /**\n /**\n * The name of the tool being called\n */\n name?: TName;\n /**\n * The arguments to the tool call\n */\n args?: string;\n /**\n * An error message associated with the tool call\n */\n error?: string;\n /**\n * Index of block in aggregate response\n */\n index?: string | number;\n}\nexport declare function defaultToolCallParser(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCalls: Record<string, any>[]): [ToolCall[], InvalidToolCall[]];\n/**\n * @deprecated Use {@link ToolMessage.isInstance} instead\n */\nexport declare function isToolMessage(x: unknown): x is ToolMessage;\n/**\n * @deprecated Use {@link ToolMessageChunk.isInstance} instead\n */\nexport declare function isToolMessageChunk(x: BaseMessageChunk): x is ToolMessageChunk;\n"],"mappings":";;;;UAEiBK,qCAAqCD,mBAAmBA,0BAA0BF,kBAAkBI;;AAArH;;;;;;EAYqB;EAZ+F,QAAA,CAAA,EAAA,GAAA;EAqBnGE,YAAAA,EAAAA,MAAgB;EAGTC,MAAAA,CAAAA,EAAAA,SAAAA,GAAkB,OAAA;EAIrBC,QAAAA,CAAAA,EAhBNH,MAgBiB,CAAA,MAAA,EAAA,OAAA,CAAA;;;;;;;;;AAqBmCF,UA5BlDG,gBAAAA,CA4BkDH;EAAiB,SAC1CC,qBAAAA,EAAAA,IAAAA;;AACUI,iBA3B5BD,kBAAAA,CA2B4BC,CAAAA,EAAAA,OAAAA,CAAAA,EAAAA,CAAAA,IA3BSF,gBA2BTE;;;;AAvBwG,cAAvIA,WAAuI,CAAA,mBAAxGN,gBAAwG,GAArFA,gBAAqF,CAAA,SAA3DJ,WAA2D,CAA/CM,UAA+C,EAAA,MAAA,CAAA,YAAhBE,gBAAgB,CAAA;EA8BvIG,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAgB;EAAA,IAAA,UAAA,CAAA,CAAA,EA5BfJ,MA4Be,CAAA,MAAA,EAAA,MAAA,CAA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A,mBAAgCR;;;;iBAIhCS,kBAAAA,IAAsBlB,wBAAwBU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.cts","names":["BaseDocumentTransformer","BaseLanguageModel","Runnable","AIMessage","AIMessageChunk","BaseMessage","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","MessageType","RemoveMessage","SystemMessage","SystemMessageChunk","ToolMessage","ToolMessageChunk","MessageUnion","MessageChunkUnion","MessageTypeOrClass","FilterMessagesFields","filterMessages","mergeMessageRuns","_TextSplitterInterface","Promise","TrimMessagesFields","trimMessages","defaultTextSplitter"],"sources":["../../src/messages/transformers.d.ts"],"sourcesContent":["import { BaseDocumentTransformer } from \"../documents/transformers.js\";\nimport { BaseLanguageModel } from \"../language_models/base.js\";\nimport { Runnable } from \"../runnables/base.js\";\nimport { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { BaseMessage } from \"./base.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { MessageType } from \"./message.js\";\nimport { RemoveMessage } from \"./modifier.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { ToolMessage, ToolMessageChunk } from \"./tool.js\";\nexport type MessageUnion = typeof HumanMessage | typeof AIMessage | typeof SystemMessage | typeof ChatMessage | typeof FunctionMessage | typeof ToolMessage | typeof RemoveMessage;\nexport type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage; // RemoveMessage does not have a chunk class.\nexport type MessageTypeOrClass = MessageType | MessageUnion | MessageChunkUnion;\nexport interface FilterMessagesFields {\n /**\n * @param {string[] | undefined} includeNames Message names to include.\n */\n includeNames?: string[];\n /**\n * @param {string[] | undefined} excludeNames Messages names to exclude.\n */\n excludeNames?: string[];\n /**\n * @param {(MessageType | BaseMessage)[] | undefined} includeTypes Message types to include. Can be specified as string names (e.g.\n * \"system\", \"human\", \"ai\", ...) or as BaseMessage classes (e.g.\n * SystemMessage, HumanMessage, AIMessage, ...).\n */\n includeTypes?: MessageTypeOrClass[];\n /**\n * @param {(MessageType | BaseMessage)[] | undefined} excludeTypes Message types to exclude. Can be specified as string names (e.g.\n * \"system\", \"human\", \"ai\", ...) or as BaseMessage classes (e.g.\n * SystemMessage, HumanMessage, AIMessage, ...).\n */\n excludeTypes?: MessageTypeOrClass[];\n /**\n * @param {string[] | undefined} includeIds Message IDs to include.\n */\n includeIds?: string[];\n /**\n * @param {string[] | undefined} excludeIds Message IDs to exclude.\n */\n excludeIds?: string[];\n}\n/**\n * Filter messages based on name, type or id.\n *\n * @param {BaseMessage[] | FilterMessagesFields} messagesOrOptions - Either an array of BaseMessage objects to filter or the filtering options. If an array is provided, the `options` parameter should also be supplied. If filtering options are provided, a RunnableLambda is returned.\n * @param {FilterMessagesFields} [options] - Optional filtering options. Should only be provided if `messagesOrOptions` is an array of BaseMessage objects.\n * @returns A list of Messages that meets at least one of the include conditions and none\n * of the exclude conditions, or a RunnableLambda which does the same. If no include conditions are specified then\n * anything that is not explicitly excluded will be included.\n * @throws {Error} If two incompatible arguments are provided.\n *\n * @example\n * ```typescript\n * import { filterMessages, AIMessage, HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your name\", id: \"foo\", name: \"example_user\" }),\n * new AIMessage({ content: \"steve-o\", id: \"bar\", name: \"example_assistant\" }),\n * new HumanMessage({ content: \"what's your favorite color\", id: \"baz\" }),\n * new AIMessage({ content: \"silicon blue\" , id: \"blah\" }),\n * ];\n *\n * filterMessages(messages, {\n * includeNames: [\"example_user\", \"example_assistant\"],\n * includeTypes: [\"system\"],\n * excludeIds: [\"bar\"],\n * });\n * ```\n *\n * The above example would return:\n * ```typescript\n * [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your name\", id: \"foo\", name: \"example_user\" }),\n * ]\n * ```\n */\nexport declare function filterMessages(options?: FilterMessagesFields): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function filterMessages(messages: BaseMessage[], options?: FilterMessagesFields): BaseMessage[];\n/**\n * Merge consecutive Messages of the same type.\n *\n * **NOTE**: ToolMessages are not merged, as each has a distinct tool call id that\n * can't be merged.\n *\n * @param {BaseMessage[] | undefined} messages Sequence of Message-like objects to merge. Optional. If not provided, a RunnableLambda is returned.\n * @returns List of BaseMessages with consecutive runs of message types merged into single\n * messages, or a RunnableLambda which returns a list of BaseMessages If two messages being merged both have string contents, the merged\n * content is a concatenation of the two strings with a new-line separator. If at\n * least one of the messages has a list of content blocks, the merged content is a\n * list of content blocks.\n *\n * @example\n * ```typescript\n * import { mergeMessageRuns, AIMessage, HumanMessage, SystemMessage, ToolCall } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your favorite color\", id: \"foo\" }),\n * new HumanMessage({ content: \"wait your favorite food\", id: \"bar\" }),\n * new AIMessage({\n * content: \"my favorite colo\",\n * tool_calls: [{ name: \"blah_tool\", args: { x: 2 }, id: \"123\" }],\n * id: \"baz\",\n * }),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"my favorite dish is lasagna\" }],\n * tool_calls: [{ name: \"blah_tool\", args: { x: -10 }, id: \"456\" }],\n * id: \"blur\",\n * }),\n * ];\n *\n * mergeMessageRuns(messages);\n * ```\n *\n * The above example would return:\n * ```typescript\n * [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({\n * content: \"what's your favorite colorwait your favorite food\",\n * id: \"foo\",\n * }),\n * new AIMessage({\n * content: [\n * { type: \"text\", text: \"my favorite colo\" },\n * { type: \"text\", text: \"my favorite dish is lasagna\" },\n * ],\n * tool_calls: [\n * { name: \"blah_tool\", args: { x: 2 }, id: \"123\" },\n * { name: \"blah_tool\", args: { x: -10 }, id: \"456\" },\n * ],\n * id: \"baz\",\n * }),\n * ]\n * ```\n */\nexport declare function mergeMessageRuns(): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function mergeMessageRuns(messages: BaseMessage[]): BaseMessage[];\n// Since we can not import from `@langchain/textsplitters` we need\n// to reconstruct the interface here.\ninterface _TextSplitterInterface extends BaseDocumentTransformer {\n splitText(text: string): Promise<string[]>;\n}\nexport interface TrimMessagesFields {\n /**\n * @param {number} maxTokens Max token count of trimmed messages.\n */\n maxTokens: number;\n /**\n * @param {((messages: BaseMessage[]) => number) | ((messages: BaseMessage[]) => Promise<number>) | BaseLanguageModel} tokenCounter\n * Function or LLM for counting tokens in an array of `BaseMessage`s.\n * If a `BaseLanguageModel` is passed in then `BaseLanguageModel.getNumTokens()` will be used.\n */\n tokenCounter: ((messages: BaseMessage[]) => number) | ((messages: BaseMessage[]) => Promise<number>) | BaseLanguageModel;\n /**\n * @param {\"first\" | \"last\"} [strategy=\"last\"] Strategy for trimming.\n * - \"first\": Keep the first <= n_count tokens of the messages.\n * - \"last\": Keep the last <= n_count tokens of the messages.\n * @default \"last\"\n */\n strategy?: \"first\" | \"last\";\n /**\n * @param {boolean} [allowPartial=false] Whether to split a message if only part of the message can be included.\n * If `strategy: \"last\"` then the last partial contents of a message are included.\n * If `strategy: \"first\"` then the first partial contents of a message are included.\n * @default false\n */\n allowPartial?: boolean;\n /**\n * @param {MessageTypeOrClass | MessageTypeOrClass[]} [endOn] The message type to end on.\n * If specified then every message after the last occurrence of this type is ignored.\n * If `strategy === \"last\"` then this is done before we attempt to get the last `maxTokens`.\n * If `strategy === \"first\"` then this is done after we get the first `maxTokens`.\n * Can be specified as string names (e.g. \"system\", \"human\", \"ai\", ...) or as `BaseMessage` classes\n * (e.g. `SystemMessage`, `HumanMessage`, `AIMessage`, ...). Can be a single type or an array of types.\n */\n endOn?: MessageTypeOrClass | MessageTypeOrClass[];\n /**\n * @param {MessageTypeOrClass | MessageTypeOrClass[]} [startOn] The message type to start on.\n * Should only be specified if `strategy: \"last\"`. If specified then every message before the first occurrence\n * of this type is ignored. This is done after we trim the initial messages to the last `maxTokens`.\n * Does not apply to a `SystemMessage` at index 0 if `includeSystem: true`.\n * Can be specified as string names (e.g. \"system\", \"human\", \"ai\", ...) or as `BaseMessage` classes\n * (e.g. `SystemMessage`, `HumanMessage`, `AIMessage`, ...). Can be a single type or an array of types.\n */\n startOn?: MessageTypeOrClass | MessageTypeOrClass[];\n /**\n * @param {boolean} [includeSystem=false] Whether to keep the `SystemMessage` if there is one at index 0.\n * Should only be specified if `strategy: \"last\"`.\n * @default false\n */\n includeSystem?: boolean;\n /**\n * @param {((text: string) => string[]) | BaseDocumentTransformer} [textSplitter] Function or `BaseDocumentTransformer` for\n * splitting the string contents of a message. Only used if `allowPartial: true`.\n * If `strategy: \"last\"` then the last split tokens from a partial message will be included.\n * If `strategy: \"first\"` then the first split tokens from a partial message will be included.\n * Token splitter assumes that separators are kept, so that split contents can be directly concatenated\n * to recreate the original text. Defaults to splitting on newlines.\n */\n textSplitter?: ((text: string) => string[]) | ((text: string) => Promise<string[]>) | _TextSplitterInterface;\n}\n/**\n * Trim messages to be below a token count.\n *\n * @param {BaseMessage[]} messages Array of `BaseMessage` instances to trim.\n * @param {TrimMessagesFields} options Trimming options.\n * @returns An array of trimmed `BaseMessage`s or a `Runnable` that takes a sequence of `BaseMessage`-like objects and returns\n * an array of trimmed `BaseMessage`s.\n * @throws {Error} If two incompatible arguments are specified or an unrecognized `strategy` is specified.\n *\n * @example\n * ```typescript\n * import { trimMessages, AIMessage, BaseMessage, HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"This is a 4 token text. The full message is 10 tokens.\"),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * new AIMessage({\n * content: [\n * { type: \"text\", text: \"This is the FIRST 4 token block.\" },\n * { type: \"text\", text: \"This is the SECOND 4 token block.\" },\n * ],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ];\n *\n * function dummyTokenCounter(messages: BaseMessage[]): number {\n * // treat each message like it adds 3 default tokens at the beginning\n * // of the message and at the end of the message. 3 + 4 + 3 = 10 tokens\n * // per message.\n *\n * const defaultContentLen = 4;\n * const defaultMsgPrefixLen = 3;\n * const defaultMsgSuffixLen = 3;\n *\n * let count = 0;\n * for (const msg of messages) {\n * if (typeof msg.content === \"string\") {\n * count += defaultMsgPrefixLen + defaultContentLen + defaultMsgSuffixLen;\n * }\n * if (Array.isArray(msg.content)) {\n * count +=\n * defaultMsgPrefixLen +\n * msg.content.length * defaultContentLen +\n * defaultMsgSuffixLen;\n * }\n * }\n * return count;\n * }\n * ```\n *\n * First 30 tokens, not allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * ]\n * ```\n *\n * First 30 tokens, allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * allowPartial: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * ]\n * ```\n *\n * First 30 tokens, allowing partial messages, have to end on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * allowPartial: true,\n * endOn: \"human\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * ]\n * ```\n *\n * Last 30 tokens, including system message, not allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * includeSystem: true,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n *\n * Last 40 tokens, including system message, allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 40,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * allowPartial: true,\n * includeSystem: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n *\n * Last 30 tokens, including system message, allowing partial messages, end on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * endOn: \"human\",\n * includeSystem: true,\n * allowPartial: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * ]\n * ```\n *\n * Last 40 tokens, including system message, allowing partial messages, start on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 40,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * includeSystem: true,\n * allowPartial: true,\n * startOn: \"human\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n */\nexport declare function trimMessages(options: TrimMessagesFields): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function trimMessages(messages: BaseMessage[], options: TrimMessagesFields): Promise<BaseMessage[]>;\n/**\n * The default text splitter function that splits text by newlines.\n *\n * @param {string} text\n * @returns A promise that resolves to an array of strings split by newlines.\n */\nexport declare function defaultTextSplitter(text: string): Promise<string[]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;KAYYkB,YAAAA,UAAsBR,sBAAsBP,mBAAmBW,uBAAuBR,qBAAqBE,yBAAyBQ,qBAAqBH;KACzJM,iBAAAA,UAA2BR,2BAA2BP,wBAAwBW,4BAA4BN,8BAA8BQ,0BAA0BV,0BAA0BM;AAD5LK,KAEAE,kBAAAA,GAAqBR,WAFT,GAEuBM,YAFvB,GAEsCC,iBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6PlEG,YAAAA,UAAsBD,qBAAqBxB,SAASG,eAAeA;iBACnEsB,YAAAA,WAAuBtB,wBAAwBqB,qBAAqBD,QAAQpB;;;;;;;iBAO5EuB,mBAAAA,gBAAmCH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.ts","names":["BaseDocumentTransformer","BaseLanguageModel","Runnable","AIMessage","AIMessageChunk","BaseMessage","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","MessageType","RemoveMessage","SystemMessage","SystemMessageChunk","ToolMessage","ToolMessageChunk","MessageUnion","MessageChunkUnion","MessageTypeOrClass","FilterMessagesFields","filterMessages","mergeMessageRuns","_TextSplitterInterface","Promise","TrimMessagesFields","trimMessages","defaultTextSplitter"],"sources":["../../src/messages/transformers.d.ts"],"sourcesContent":["import { BaseDocumentTransformer } from \"../documents/transformers.js\";\nimport { BaseLanguageModel } from \"../language_models/base.js\";\nimport { Runnable } from \"../runnables/base.js\";\nimport { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { BaseMessage } from \"./base.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { MessageType } from \"./message.js\";\nimport { RemoveMessage } from \"./modifier.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { ToolMessage, ToolMessageChunk } from \"./tool.js\";\nexport type MessageUnion = typeof HumanMessage | typeof AIMessage | typeof SystemMessage | typeof ChatMessage | typeof FunctionMessage | typeof ToolMessage | typeof RemoveMessage;\nexport type MessageChunkUnion = typeof HumanMessageChunk | typeof AIMessageChunk | typeof SystemMessageChunk | typeof FunctionMessageChunk | typeof ToolMessageChunk | typeof ChatMessageChunk | typeof RemoveMessage; // RemoveMessage does not have a chunk class.\nexport type MessageTypeOrClass = MessageType | MessageUnion | MessageChunkUnion;\nexport interface FilterMessagesFields {\n /**\n * @param {string[] | undefined} includeNames Message names to include.\n */\n includeNames?: string[];\n /**\n * @param {string[] | undefined} excludeNames Messages names to exclude.\n */\n excludeNames?: string[];\n /**\n * @param {(MessageType | BaseMessage)[] | undefined} includeTypes Message types to include. Can be specified as string names (e.g.\n * \"system\", \"human\", \"ai\", ...) or as BaseMessage classes (e.g.\n * SystemMessage, HumanMessage, AIMessage, ...).\n */\n includeTypes?: MessageTypeOrClass[];\n /**\n * @param {(MessageType | BaseMessage)[] | undefined} excludeTypes Message types to exclude. Can be specified as string names (e.g.\n * \"system\", \"human\", \"ai\", ...) or as BaseMessage classes (e.g.\n * SystemMessage, HumanMessage, AIMessage, ...).\n */\n excludeTypes?: MessageTypeOrClass[];\n /**\n * @param {string[] | undefined} includeIds Message IDs to include.\n */\n includeIds?: string[];\n /**\n * @param {string[] | undefined} excludeIds Message IDs to exclude.\n */\n excludeIds?: string[];\n}\n/**\n * Filter messages based on name, type or id.\n *\n * @param {BaseMessage[] | FilterMessagesFields} messagesOrOptions - Either an array of BaseMessage objects to filter or the filtering options. If an array is provided, the `options` parameter should also be supplied. If filtering options are provided, a RunnableLambda is returned.\n * @param {FilterMessagesFields} [options] - Optional filtering options. Should only be provided if `messagesOrOptions` is an array of BaseMessage objects.\n * @returns A list of Messages that meets at least one of the include conditions and none\n * of the exclude conditions, or a RunnableLambda which does the same. If no include conditions are specified then\n * anything that is not explicitly excluded will be included.\n * @throws {Error} If two incompatible arguments are provided.\n *\n * @example\n * ```typescript\n * import { filterMessages, AIMessage, HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your name\", id: \"foo\", name: \"example_user\" }),\n * new AIMessage({ content: \"steve-o\", id: \"bar\", name: \"example_assistant\" }),\n * new HumanMessage({ content: \"what's your favorite color\", id: \"baz\" }),\n * new AIMessage({ content: \"silicon blue\" , id: \"blah\" }),\n * ];\n *\n * filterMessages(messages, {\n * includeNames: [\"example_user\", \"example_assistant\"],\n * includeTypes: [\"system\"],\n * excludeIds: [\"bar\"],\n * });\n * ```\n *\n * The above example would return:\n * ```typescript\n * [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your name\", id: \"foo\", name: \"example_user\" }),\n * ]\n * ```\n */\nexport declare function filterMessages(options?: FilterMessagesFields): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function filterMessages(messages: BaseMessage[], options?: FilterMessagesFields): BaseMessage[];\n/**\n * Merge consecutive Messages of the same type.\n *\n * **NOTE**: ToolMessages are not merged, as each has a distinct tool call id that\n * can't be merged.\n *\n * @param {BaseMessage[] | undefined} messages Sequence of Message-like objects to merge. Optional. If not provided, a RunnableLambda is returned.\n * @returns List of BaseMessages with consecutive runs of message types merged into single\n * messages, or a RunnableLambda which returns a list of BaseMessages If two messages being merged both have string contents, the merged\n * content is a concatenation of the two strings with a new-line separator. If at\n * least one of the messages has a list of content blocks, the merged content is a\n * list of content blocks.\n *\n * @example\n * ```typescript\n * import { mergeMessageRuns, AIMessage, HumanMessage, SystemMessage, ToolCall } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({ content: \"what's your favorite color\", id: \"foo\" }),\n * new HumanMessage({ content: \"wait your favorite food\", id: \"bar\" }),\n * new AIMessage({\n * content: \"my favorite colo\",\n * tool_calls: [{ name: \"blah_tool\", args: { x: 2 }, id: \"123\" }],\n * id: \"baz\",\n * }),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"my favorite dish is lasagna\" }],\n * tool_calls: [{ name: \"blah_tool\", args: { x: -10 }, id: \"456\" }],\n * id: \"blur\",\n * }),\n * ];\n *\n * mergeMessageRuns(messages);\n * ```\n *\n * The above example would return:\n * ```typescript\n * [\n * new SystemMessage(\"you're a good assistant.\"),\n * new HumanMessage({\n * content: \"what's your favorite colorwait your favorite food\",\n * id: \"foo\",\n * }),\n * new AIMessage({\n * content: [\n * { type: \"text\", text: \"my favorite colo\" },\n * { type: \"text\", text: \"my favorite dish is lasagna\" },\n * ],\n * tool_calls: [\n * { name: \"blah_tool\", args: { x: 2 }, id: \"123\" },\n * { name: \"blah_tool\", args: { x: -10 }, id: \"456\" },\n * ],\n * id: \"baz\",\n * }),\n * ]\n * ```\n */\nexport declare function mergeMessageRuns(): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function mergeMessageRuns(messages: BaseMessage[]): BaseMessage[];\n// Since we can not import from `@langchain/textsplitters` we need\n// to reconstruct the interface here.\ninterface _TextSplitterInterface extends BaseDocumentTransformer {\n splitText(text: string): Promise<string[]>;\n}\nexport interface TrimMessagesFields {\n /**\n * @param {number} maxTokens Max token count of trimmed messages.\n */\n maxTokens: number;\n /**\n * @param {((messages: BaseMessage[]) => number) | ((messages: BaseMessage[]) => Promise<number>) | BaseLanguageModel} tokenCounter\n * Function or LLM for counting tokens in an array of `BaseMessage`s.\n * If a `BaseLanguageModel` is passed in then `BaseLanguageModel.getNumTokens()` will be used.\n */\n tokenCounter: ((messages: BaseMessage[]) => number) | ((messages: BaseMessage[]) => Promise<number>) | BaseLanguageModel;\n /**\n * @param {\"first\" | \"last\"} [strategy=\"last\"] Strategy for trimming.\n * - \"first\": Keep the first <= n_count tokens of the messages.\n * - \"last\": Keep the last <= n_count tokens of the messages.\n * @default \"last\"\n */\n strategy?: \"first\" | \"last\";\n /**\n * @param {boolean} [allowPartial=false] Whether to split a message if only part of the message can be included.\n * If `strategy: \"last\"` then the last partial contents of a message are included.\n * If `strategy: \"first\"` then the first partial contents of a message are included.\n * @default false\n */\n allowPartial?: boolean;\n /**\n * @param {MessageTypeOrClass | MessageTypeOrClass[]} [endOn] The message type to end on.\n * If specified then every message after the last occurrence of this type is ignored.\n * If `strategy === \"last\"` then this is done before we attempt to get the last `maxTokens`.\n * If `strategy === \"first\"` then this is done after we get the first `maxTokens`.\n * Can be specified as string names (e.g. \"system\", \"human\", \"ai\", ...) or as `BaseMessage` classes\n * (e.g. `SystemMessage`, `HumanMessage`, `AIMessage`, ...). Can be a single type or an array of types.\n */\n endOn?: MessageTypeOrClass | MessageTypeOrClass[];\n /**\n * @param {MessageTypeOrClass | MessageTypeOrClass[]} [startOn] The message type to start on.\n * Should only be specified if `strategy: \"last\"`. If specified then every message before the first occurrence\n * of this type is ignored. This is done after we trim the initial messages to the last `maxTokens`.\n * Does not apply to a `SystemMessage` at index 0 if `includeSystem: true`.\n * Can be specified as string names (e.g. \"system\", \"human\", \"ai\", ...) or as `BaseMessage` classes\n * (e.g. `SystemMessage`, `HumanMessage`, `AIMessage`, ...). Can be a single type or an array of types.\n */\n startOn?: MessageTypeOrClass | MessageTypeOrClass[];\n /**\n * @param {boolean} [includeSystem=false] Whether to keep the `SystemMessage` if there is one at index 0.\n * Should only be specified if `strategy: \"last\"`.\n * @default false\n */\n includeSystem?: boolean;\n /**\n * @param {((text: string) => string[]) | BaseDocumentTransformer} [textSplitter] Function or `BaseDocumentTransformer` for\n * splitting the string contents of a message. Only used if `allowPartial: true`.\n * If `strategy: \"last\"` then the last split tokens from a partial message will be included.\n * If `strategy: \"first\"` then the first split tokens from a partial message will be included.\n * Token splitter assumes that separators are kept, so that split contents can be directly concatenated\n * to recreate the original text. Defaults to splitting on newlines.\n */\n textSplitter?: ((text: string) => string[]) | ((text: string) => Promise<string[]>) | _TextSplitterInterface;\n}\n/**\n * Trim messages to be below a token count.\n *\n * @param {BaseMessage[]} messages Array of `BaseMessage` instances to trim.\n * @param {TrimMessagesFields} options Trimming options.\n * @returns An array of trimmed `BaseMessage`s or a `Runnable` that takes a sequence of `BaseMessage`-like objects and returns\n * an array of trimmed `BaseMessage`s.\n * @throws {Error} If two incompatible arguments are specified or an unrecognized `strategy` is specified.\n *\n * @example\n * ```typescript\n * import { trimMessages, AIMessage, BaseMessage, HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n *\n * const messages = [\n * new SystemMessage(\"This is a 4 token text. The full message is 10 tokens.\"),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * new AIMessage({\n * content: [\n * { type: \"text\", text: \"This is the FIRST 4 token block.\" },\n * { type: \"text\", text: \"This is the SECOND 4 token block.\" },\n * ],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ];\n *\n * function dummyTokenCounter(messages: BaseMessage[]): number {\n * // treat each message like it adds 3 default tokens at the beginning\n * // of the message and at the end of the message. 3 + 4 + 3 = 10 tokens\n * // per message.\n *\n * const defaultContentLen = 4;\n * const defaultMsgPrefixLen = 3;\n * const defaultMsgSuffixLen = 3;\n *\n * let count = 0;\n * for (const msg of messages) {\n * if (typeof msg.content === \"string\") {\n * count += defaultMsgPrefixLen + defaultContentLen + defaultMsgSuffixLen;\n * }\n * if (Array.isArray(msg.content)) {\n * count +=\n * defaultMsgPrefixLen +\n * msg.content.length * defaultContentLen +\n * defaultMsgSuffixLen;\n * }\n * }\n * return count;\n * }\n * ```\n *\n * First 30 tokens, not allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * ]\n * ```\n *\n * First 30 tokens, allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * allowPartial: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * ]\n * ```\n *\n * First 30 tokens, allowing partial messages, have to end on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"first\",\n * allowPartial: true,\n * endOn: \"human\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"first\",\n * }),\n * ]\n * ```\n *\n * Last 30 tokens, including system message, not allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * includeSystem: true,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n *\n * Last 40 tokens, including system message, allowing partial messages:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 40,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * allowPartial: true,\n * includeSystem: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n *\n * Last 30 tokens, including system message, allowing partial messages, end on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 30,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * endOn: \"human\",\n * includeSystem: true,\n * allowPartial: true,\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new AIMessage({\n * content: [{ type: \"text\", text: \"This is the FIRST 4 token block.\" }],\n * id: \"second\",\n * }),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * ]\n * ```\n *\n * Last 40 tokens, including system message, allowing partial messages, start on HumanMessage:\n * ```typescript\n * await trimMessages(messages, {\n * maxTokens: 40,\n * tokenCounter: dummyTokenCounter,\n * strategy: \"last\",\n * includeSystem: true,\n * allowPartial: true,\n * startOn: \"human\",\n * });\n * ```\n *\n * Output:\n * ```typescript\n * [\n * new SystemMessage(\n * \"This is a 4 token text. The full message is 10 tokens.\"\n * ),\n * new HumanMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"third\",\n * }),\n * new AIMessage({\n * content: \"This is a 4 token text. The full message is 10 tokens.\",\n * id: \"fourth\",\n * }),\n * ]\n * ```\n */\nexport declare function trimMessages(options: TrimMessagesFields): Runnable<BaseMessage[], BaseMessage[]>;\nexport declare function trimMessages(messages: BaseMessage[], options: TrimMessagesFields): Promise<BaseMessage[]>;\n/**\n * The default text splitter function that splits text by newlines.\n *\n * @param {string} text\n * @returns A promise that resolves to an array of strings split by newlines.\n */\nexport declare function defaultTextSplitter(text: string): Promise<string[]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;KAYYkB,YAAAA,UAAsBR,sBAAsBP,mBAAmBW,uBAAuBR,qBAAqBE,yBAAyBQ,qBAAqBH;KACzJM,iBAAAA,UAA2BR,2BAA2BP,wBAAwBW,4BAA4BN,8BAA8BQ,0BAA0BV,0BAA0BM;AAD5LK,KAEAE,kBAAAA,GAAqBR,WAFT,GAEuBM,YAFvB,GAEsCC,iBAFtC;AAAA,UAGPE,oBAAAA,CAHO;EAAA;;;EAAgE,YAAUf,CAAAA,EAAAA,MAAAA,EAAAA;EAAW;;;EAAqE,YAAA,CAAA,EAAA,MAAA,EAAA;EACtKa;;;;;EAAgG,YAAUV,CAAAA,EAgBnGW,kBAhBmGX,EAAAA;EAAoB;;;AAA2E;AACrN;EAA8B,YAAA,CAAA,EAqBXW,kBArBW,EAAA;EAAA;;;EAAiD,UAAA,CAAA,EAAA,MAAA,EAAA;EAC9DC;;;EAcoB,UAMlBD,CAAAA,EAAAA,MAAAA,EAAAA;AAAkB;AA+CrC;;;;;;AAAgF;AAChF;;;;;AAA4G;AA2D5G;;;;;AAAoD;AACpD;;;;AAA8E;AAAG;;;;AAGjB;AAGhE;;;;;;;;AA0CcA,iBA7GUE,cAAAA,CA6GVF,OAAAA,CAAAA,EA7GmCC,oBA6GnCD,CAAAA,EA7G0DlB,QA6G1DkB,CA7GmEf,WA6GnEe,EAAAA,EA7GkFf,WA6GlFe,EAAAA,CAAAA;AAAqBA,iBA5GXE,cAAAA,CA4GWF,QAAAA,EA5Gcf,WA4Gde,EAAAA,EAAAA,OAAAA,CAAAA,EA5GuCC,oBA4GvCD,CAAAA,EA5G8Df,WA4G9De,EAAAA;;;AAe6E;AA6PhH;;;;;;AAA2E;AAC3E;;;;;;AAAmG;AAOnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArUwBG,gBAAAA,CAAAA,GAAoBrB,SAASG,eAAeA;iBAC5CkB,gBAAAA,WAA2BlB,gBAAgBA;;;UAGzDmB,sBAAAA,SAA+BxB;2BACZyB;;UAEZC,kBAAAA;;;;;;;;;;4BAUarB,wCAAwCA,kBAAkBoB,mBAAmBxB;;;;;;;;;;;;;;;;;;;;;;;UAuB/FmB,qBAAqBA;;;;;;;;;YASnBA,qBAAqBA;;;;;;;;;;;;;;;mEAekCK,qBAAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6PlEG,YAAAA,UAAsBD,qBAAqBxB,SAASG,eAAeA;iBACnEsB,YAAAA,WAAuBtB,wBAAwBqB,qBAAqBD,QAAQpB;;;;;;;iBAO5EuB,mBAAAA,gBAAmCH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":["AIMessage","AIMessageChunk","BaseMessageLike","BaseMessage","StoredMessage","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","SystemMessage","SystemMessageChunk","ToolMessage","$Expand","T","U","K","$KnownKeys","$HasIndexSignature","$OnlyIndexSignatures","$MergeObjects","Record","$MergeDiscriminatedUnion","Key","PropertyKey","A","B","Extract","Constructor","iife","coerceMessageLikeToMessage","getBufferString","mapStoredMessageToChatMessage","__message_js0","MessageStructure","mapStoredMessagesToChatMessages","mapChatMessagesToStoredMessages","convertToChunk"],"sources":["../../src/messages/utils.d.ts"],"sourcesContent":["import { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { BaseMessageLike, BaseMessage, StoredMessage } from \"./base.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { ToolMessage } from \"./tool.js\";\nexport type $Expand<T> = T extends infer U ? {\n [K in keyof U]: U[K];\n} : never;\n/**\n * Extracts the explicitly declared keys from a type T.\n *\n * @template T - The type to extract keys from\n * @returns A union of keys that are not string, number, or symbol\n */\ntype $KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K;\n}[keyof T];\n/**\n * Detects if T has an index signature.\n *\n * @template T - The type to check for index signatures\n * @returns True if T has an index signature, false otherwise\n */\ntype $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;\n/**\n * Detects if T has an index signature and no known keys.\n *\n * @template T - The type to check for index signatures and no known keys\n * @returns True if T has an index signature and no known keys, false otherwise\n */\ntype $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;\n/**\n * Recursively merges two object types T and U, with U taking precedence over T.\n *\n * This utility type performs a deep merge of two object types:\n * - For keys that exist in both T and U:\n * - If both values are objects (Record<string, unknown>), recursively merge them\n * - Otherwise, U's value takes precedence\n * - For keys that exist only in T, use T's value\n * - For keys that exist only in U, use U's value\n *\n * @template T - The first object type to merge\n * @template U - The second object type to merge (takes precedence over T)\n *\n * @example\n * ```ts\n * type ObjectA = {\n * shared: { a: string; b: number };\n * onlyInA: boolean;\n * };\n *\n * type ObjectB = {\n * shared: { b: string; c: Date };\n * onlyInB: symbol;\n * };\n *\n * type Merged = $MergeObjects<ObjectA, ObjectB>;\n * // Result: {\n * // shared: { a: string; b: string; c: Date };\n * // onlyInA: boolean;\n * // onlyInB: symbol;\n * // }\n * ```\n */\nexport type $MergeObjects<T, U> = \n// If U is purely index-signature based, prefer U as a whole\n$OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : {\n [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;\n};\n/**\n * Merges two discriminated unions A and B based on a discriminator key (defaults to \"type\").\n * For each possible value of the discriminator across both unions:\n * - If B has a member with that discriminator value, use B's member\n * - Otherwise use A's member with that discriminator value\n * This effectively merges the unions while giving B's members precedence over A's members.\n *\n * @template A - First discriminated union type that extends Record<Key, PropertyKey>\n * @template B - Second discriminated union type that extends Record<Key, PropertyKey>\n * @template Key - The discriminator key property, defaults to \"type\"\n */\nexport type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = \"type\"> = {\n [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value\n ? Extract<A, Record<Key, T>> : [\n Extract<A, Record<Key, T>>\n ] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>>;\n}[A[Key] | B[Key]];\nexport type Constructor<T> = new (...args: unknown[]) => T;\n/**\n * Immediately-invoked function expression.\n *\n * @param fn - The function to execute\n * @returns The result of the function\n */\nexport declare const iife: <T>(fn: () => T) => T;\nexport declare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;\n/**\n * This function is used by memory classes to get a string representation\n * of the chat message history, based on the message content and role.\n */\nexport declare function getBufferString(messages: BaseMessage[], humanPrefix?: string, aiPrefix?: string): string;\nexport declare function mapStoredMessageToChatMessage(message: StoredMessage): AIMessage<import(\"./message.js\").MessageStructure> | ChatMessage<import(\"./message.js\").MessageStructure> | FunctionMessage<import(\"./message.js\").MessageStructure> | HumanMessage<import(\"./message.js\").MessageStructure> | SystemMessage<import(\"./message.js\").MessageStructure> | ToolMessage<import(\"./message.js\").MessageStructure>;\n/**\n * Transforms an array of `StoredMessage` instances into an array of\n * `BaseMessage` instances. It uses the `mapV1MessageToStoredMessage`\n * function to ensure all messages are in the `StoredMessage` format, then\n * creates new instances of the appropriate `BaseMessage` subclass based\n * on the type of each message. This function is used to prepare stored\n * messages for use in a chat context.\n */\nexport declare function mapStoredMessagesToChatMessages(messages: StoredMessage[]): BaseMessage[];\n/**\n * Transforms an array of `BaseMessage` instances into an array of\n * `StoredMessage` instances. It does this by calling the `toDict` method\n * on each `BaseMessage`, which returns a `StoredMessage`. This function\n * is used to prepare chat messages for storage.\n */\nexport declare function mapChatMessagesToStoredMessages(messages: BaseMessage[]): StoredMessage[];\nexport declare function convertToChunk(message: BaseMessage): AIMessageChunk<import(\"./message.js\").MessageStructure> | ChatMessageChunk<import(\"./message.js\").MessageStructure> | FunctionMessageChunk<import(\"./message.js\").MessageStructure> | HumanMessageChunk<import(\"./message.js\").MessageStructure> | SystemMessageChunk<import(\"./message.js\").MessageStructure>;\nexport {};\n"],"mappings":";;;;;;;;;;KAOYc,aAAaC,kCACTC,IAAIA,EAAEC;AADtB;;;;;;AACuB,KAQlBC,UARkB,CAAA,CAAA,CAAA,GAAA,QAQlBA,MACWH,CADD,GAAA,MAAA,SACoBE,CADpB,GAAA,KAAA,GAAA,MAAA,SAC+CA,CAD/C,GAAA,KAAA,GAAA,MAAA,SAC0EA,CAD1E,GAAA,KAAA,GACsFA,CADtF,EAAA,CAAA,MAEPF,CAFO,CAAA;;;;;;;AAEN,KAOJI,kBAPI,CAAA,CAAA,CAAA,GAAA,MAAA,SAAA,MAOyCJ,CAPzC,GAAA,IAAA,GAAA,MAAA,SAAA,MAOyEA,CAPzE,GAAA,IAAA,GAAA,MAAA,SAAA,MAOyGA,CAPzG,GAAA,IAAA,GAAA,KAAA;AAAA;;;;;AAO0G;AAAA,KAO9GK,oBAAAA,CAAAA,CAAoB,CAAA,GAAMD,kBAAN,CAAyBJ,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AAAA,EAgB+BnB,WAhB/BmB,EAAAA,EAAAA,WAAAA,CAAAA,EAAAA,MAAAA,EAAAA,QAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;AAAXM,iBAiBgBK,6BAAAA,CAjBhBL,OAAAA,EAiBuDxB,aAjBvDwB,CAAAA,EAiBuE5B,SAjBvE4B,CAiBoE,gBAAA,CAjBpEA,GAiB4HvB,WAjB5HuB,CAiBgF,gBAAA,CAjBhFA,GAiBmLrB,eAjBnLqB,CAiBuI,gBAAA,CAjBvIA,GAiB8OnB,YAjB9OmB,CAiBkM,gBAAA,CAjBlMA,GAiBsSjB,aAjBtSiB,CAiB0P,gBAAA,CAjB1PA,GAiB+Vf,WAjB/Ve,CAiBmT,gBAAA,CAjBnTA;;;;;;;;;AACsEN,iBAyBtDc,+BAAAA,CAzBsDd,QAAAA,EAyBZlB,aAzBYkB,EAAAA,CAAAA,EAyBMnB,WAzBNmB,EAAAA;;;;;;;AAAzBD,iBAgC7BgB,+BAAAA,CAhC6BhB,QAAAA,EAgCalB,WAhCbkB,EAAAA,CAAAA,EAgC6BjB,aAhC7BiB,EAAAA;AACnDK,iBAgCsBY,cAAAA,CAhCtBZ,OAAAA,EAgC8CvB,WAhC9CuB,CAAAA,EAgC4DzB,cAhC5DyB,CAgCyD,gBAAA,CAhCzDA,GAgCsHpB,gBAhCtHoB,CAgC0E,gBAAA,CAhC1EA,GAgCkLlB,oBAhClLkB,CAgCsI,gBAAA,CAhCtIA,GAgCkPhB,iBAhClPgB,CAgCsM,gBAAA,CAhCtMA,GAgC+Sd,kBAhC/Sc,CAgCmQ,gBAAA,CAhCnQA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":["AIMessage","AIMessageChunk","BaseMessageLike","BaseMessage","StoredMessage","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","SystemMessage","SystemMessageChunk","ToolMessage","$Expand","T","U","K","$KnownKeys","$HasIndexSignature","$OnlyIndexSignatures","$MergeObjects","Record","$MergeDiscriminatedUnion","Key","PropertyKey","A","B","Extract","Constructor","iife","coerceMessageLikeToMessage","getBufferString","mapStoredMessageToChatMessage","__message_js0","MessageStructure","mapStoredMessagesToChatMessages","mapChatMessagesToStoredMessages","convertToChunk"],"sources":["../../src/messages/utils.d.ts"],"sourcesContent":["import { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { BaseMessageLike, BaseMessage, StoredMessage } from \"./base.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { ToolMessage } from \"./tool.js\";\nexport type $Expand<T> = T extends infer U ? {\n [K in keyof U]: U[K];\n} : never;\n/**\n * Extracts the explicitly declared keys from a type T.\n *\n * @template T - The type to extract keys from\n * @returns A union of keys that are not string, number, or symbol\n */\ntype $KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K;\n}[keyof T];\n/**\n * Detects if T has an index signature.\n *\n * @template T - The type to check for index signatures\n * @returns True if T has an index signature, false otherwise\n */\ntype $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;\n/**\n * Detects if T has an index signature and no known keys.\n *\n * @template T - The type to check for index signatures and no known keys\n * @returns True if T has an index signature and no known keys, false otherwise\n */\ntype $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;\n/**\n * Recursively merges two object types T and U, with U taking precedence over T.\n *\n * This utility type performs a deep merge of two object types:\n * - For keys that exist in both T and U:\n * - If both values are objects (Record<string, unknown>), recursively merge them\n * - Otherwise, U's value takes precedence\n * - For keys that exist only in T, use T's value\n * - For keys that exist only in U, use U's value\n *\n * @template T - The first object type to merge\n * @template U - The second object type to merge (takes precedence over T)\n *\n * @example\n * ```ts\n * type ObjectA = {\n * shared: { a: string; b: number };\n * onlyInA: boolean;\n * };\n *\n * type ObjectB = {\n * shared: { b: string; c: Date };\n * onlyInB: symbol;\n * };\n *\n * type Merged = $MergeObjects<ObjectA, ObjectB>;\n * // Result: {\n * // shared: { a: string; b: string; c: Date };\n * // onlyInA: boolean;\n * // onlyInB: symbol;\n * // }\n * ```\n */\nexport type $MergeObjects<T, U> = \n// If U is purely index-signature based, prefer U as a whole\n$OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : {\n [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;\n};\n/**\n * Merges two discriminated unions A and B based on a discriminator key (defaults to \"type\").\n * For each possible value of the discriminator across both unions:\n * - If B has a member with that discriminator value, use B's member\n * - Otherwise use A's member with that discriminator value\n * This effectively merges the unions while giving B's members precedence over A's members.\n *\n * @template A - First discriminated union type that extends Record<Key, PropertyKey>\n * @template B - Second discriminated union type that extends Record<Key, PropertyKey>\n * @template Key - The discriminator key property, defaults to \"type\"\n */\nexport type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = \"type\"> = {\n [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value\n ? Extract<A, Record<Key, T>> : [\n Extract<A, Record<Key, T>>\n ] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>>;\n}[A[Key] | B[Key]];\nexport type Constructor<T> = new (...args: unknown[]) => T;\n/**\n * Immediately-invoked function expression.\n *\n * @param fn - The function to execute\n * @returns The result of the function\n */\nexport declare const iife: <T>(fn: () => T) => T;\nexport declare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;\n/**\n * This function is used by memory classes to get a string representation\n * of the chat message history, based on the message content and role.\n */\nexport declare function getBufferString(messages: BaseMessage[], humanPrefix?: string, aiPrefix?: string): string;\nexport declare function mapStoredMessageToChatMessage(message: StoredMessage): AIMessage<import(\"./message.js\").MessageStructure> | ChatMessage<import(\"./message.js\").MessageStructure> | FunctionMessage<import(\"./message.js\").MessageStructure> | HumanMessage<import(\"./message.js\").MessageStructure> | SystemMessage<import(\"./message.js\").MessageStructure> | ToolMessage<import(\"./message.js\").MessageStructure>;\n/**\n * Transforms an array of `StoredMessage` instances into an array of\n * `BaseMessage` instances. It uses the `mapV1MessageToStoredMessage`\n * function to ensure all messages are in the `StoredMessage` format, then\n * creates new instances of the appropriate `BaseMessage` subclass based\n * on the type of each message. This function is used to prepare stored\n * messages for use in a chat context.\n */\nexport declare function mapStoredMessagesToChatMessages(messages: StoredMessage[]): BaseMessage[];\n/**\n * Transforms an array of `BaseMessage` instances into an array of\n * `StoredMessage` instances. It does this by calling the `toDict` method\n * on each `BaseMessage`, which returns a `StoredMessage`. This function\n * is used to prepare chat messages for storage.\n */\nexport declare function mapChatMessagesToStoredMessages(messages: BaseMessage[]): StoredMessage[];\nexport declare function convertToChunk(message: BaseMessage): AIMessageChunk<import(\"./message.js\").MessageStructure> | ChatMessageChunk<import(\"./message.js\").MessageStructure> | FunctionMessageChunk<import(\"./message.js\").MessageStructure> | HumanMessageChunk<import(\"./message.js\").MessageStructure> | SystemMessageChunk<import(\"./message.js\").MessageStructure>;\nexport {};\n"],"mappings":";;;;;;;;;;KAOYc,aAAaC,kCACTC,IAAIA,EAAEC;AADtB;;;;;;AACuB,KAQlBC,UARkB,CAAA,CAAA,CAAA,GAAA,QAQlBA,MACWH,CADD,GAAA,MAAA,SACoBE,CADpB,GAAA,KAAA,GAAA,MAAA,SAC+CA,CAD/C,GAAA,KAAA,GAAA,MAAA,SAC0EA,CAD1E,GAAA,KAAA,GACsFA,CADtF,EAAA,CAAA,MAEPF,CAF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PgB,CAgCsM,gBAAA,CAhCtMA,GAgC+Sd,kBAhC/Sc,CAgCmQ,gBAAA,CAhCnQA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":["Runnable","RunnableConfig","BasePromptValueInterface","BaseMessage","ContentBlock","Callbacks","Generation","ChatGeneration","FormatInstructionsOptions","BaseLLMOutputParser","T","Promise","BaseOutputParser","OutputParserException","Error"],"sources":["../../src/output_parsers/base.d.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {\n}\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport declare abstract class BaseLLMOutputParser<T = unknown> extends Runnable<string | BaseMessage, T> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(generations: Generation[] | ChatGeneration[], _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n protected _baseMessageToString(message: BaseMessage): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n invoke(input: string | BaseMessage, options?: RunnableConfig): Promise<T>;\n}\n/**\n * Class to parse the output of an LLM call.\n */\nexport declare abstract class BaseOutputParser<T = unknown> extends BaseLLMOutputParser<T> {\n parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n parseWithPrompt(text: string, _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string;\n}\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport declare class OutputParserException extends Error {\n llmOutput?: string;\n observation?: string;\n sendToLLM: boolean;\n constructor(message: string, llmOutput?: string, observation?: string, sendToLLM?: boolean);\n}\n"],"mappings":";;;;;;;;;;;;AASiBQ,UAAAA,yBAAAA,CAAyB,CAO1C;;;;;;AASmFH,uBATrDI,mBASqDJ,CAAAA,IAAAA,OAAAA,CAAAA,SATZL,QASYK,CAAAA,MAAAA,GATMF,WASNE,EATmBK,CASnBL,CAAAA,CAAAA;EAAS;;;;;;;;EAS8C,SAC9FF,WAAAA,CAAAA,WAAAA,EAVNG,UAUMH,EAAAA,GAVSI,cAUTJ,EAAAA,EAAAA,SAAAA,CAAAA,EAVuCE,SAUvCF,CAAAA,EAVmDQ,OAUnDR,CAV2DO,CAU3DP,CAAAA;EAAW;;;;;;AAnBwB;AAoC/E;EAA8C,qBAAA,CAAA,WAAA,EAlBPG,UAkBO,EAAA,GAlBQC,cAkBR,EAAA,EAAA,OAAA,EAlBmCL,wBAkBnC,EAAA,SAAA,CAAA,EAlByEG,SAkBzE,CAAA,EAlBqFM,OAkBrF,CAlB6FD,CAkB7F,CAAA;EAAA,UAA0CA,oBAAAA,CAAAA,OAAAA,EAjB5CP,WAiB4CO,CAAAA,EAAAA,MAAAA;EAAC,UAC5DJ,2BAAAA,CAAAA,OAAAA,EAjBsBF,YAiBtBE,EAAAA,CAAAA,EAAAA,MAAAA;EAAU;;;;;;;;;;EAQ+D,MAATK,CAAAA,KAAAA,EAAAA,MAAAA,GAdlER,WAckEQ,EAAAA,OAAAA,CAAAA,EAd3CV,cAc2CU,CAAAA,EAd1BA,OAc0BA,CAdlBD,CAckBC,CAAAA;;;AATN;AA6CvF;uBA7C8BC,sCAAsCH,oBAAoBC;2BAC3DJ,eAAeC,8BAA8BF,YAAYM,QAAQD;;;;;;;2CAOjDL,YAAYM,QAAQD;yCACtBR,sCAAsCG,YAAYM,QAAQD;;;;;;;;;;;;2CAYxDF;;;;;;;;;;;;;;;;;;;;;;;;cAwBxBK,qBAAAA,SAA8BC,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":["Runnable","RunnableConfig","BasePromptValueInterface","BaseMessage","ContentBlock","Callbacks","Generation","ChatGeneration","FormatInstructionsOptions","BaseLLMOutputParser","T","Promise","BaseOutputParser","OutputParserException","Error"],"sources":["../../src/output_parsers/base.d.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {\n}\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport declare abstract class BaseLLMOutputParser<T = unknown> extends Runnable<string | BaseMessage, T> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(generations: Generation[] | ChatGeneration[], _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n protected _baseMessageToString(message: BaseMessage): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n invoke(input: string | BaseMessage, options?: RunnableConfig): Promise<T>;\n}\n/**\n * Class to parse the output of an LLM call.\n */\nexport declare abstract class BaseOutputParser<T = unknown> extends BaseLLMOutputParser<T> {\n parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n parseWithPrompt(text: string, _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string;\n}\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport declare class OutputParserException extends Error {\n llmOutput?: string;\n observation?: string;\n sendToLLM: boolean;\n constructor(message: string, llmOutput?: string, observation?: string, sendToLLM?: boolean);\n}\n"],"mappings":";;;;;;;;;;;;AASiBQ,UAAAA,yBAAAA,CAAyB,CAO1C;;;;;;AASmFH,uBATrDI,mBASqDJ,CAAAA,IAAAA,OAAAA,CAAAA,SATZL,QASYK,CAAAA,MAAAA,GATMF,WASNE,EATmBK,CASnBL,CAAAA,CAAAA;EAAS;;;;;;;;EAS8C,SAC9FF,WAAAA,CAAAA,WAAAA,EAVNG,UAUMH,EAAAA,GAVSI,cAUTJ,EAAAA,EAAAA,SAAAA,CAAAA,EAVuCE,SAUvCF,CAAAA,EAVmDQ,OAUnDR,CAV2DO,CAU3DP,CAAAA;EAAW;;;;;;AAnBwB;AAoC/E;EAA8C,qBAAA,CAAA,WAAA,EAlBPG,UAkBO,EAAA,GAlBQC,cAkBR,EAAA,EAAA,OAAA,EAlBmCL,wBAkBnC,EAAA,SAAA,CAAA,EAlByEG,SAkBzE,CAAA,EAlBqFM,OAkBrF,CAlB6FD,CAkB7F,CAAA;EAAA,UAA0CA,oBAAAA,CAAAA,OAAAA,EAjB5CP,WAiB4CO,CAAAA,EAAAA,MAAAA;EAAC,UAC5DJ,2BAAAA,CAAAA,OAAAA,EAjBsBF,YAiBtBE,EAAAA,CAAAA,EAAAA,MAAAA;EAAU;;;;;;;;;;EAQ+D,MAATK,CAAAA,KAAAA,EAAAA,MAAAA,GAdlER,WAckEQ,EAAAA,OAAAA,CAAAA,EAd3CV,cAc2CU,CAAAA,EAd1BA,OAc0BA,CAdlBD,CAckBC,CAAAA;;;AATN;AA6CvF;uBA7C8BC,sCAAsCH,oBAAoBC;2BAC3DJ,eAAeC,8BAA8BF,YAAYM,QAAQD;;;;;;;2CAOjDL,YAAYM,QAAQD;yCACtBR,sCAAsCG,YAAYM,QAAQD;;;;;;;;;;;;2CAYxDF;;;;;;;;;;;;;;;;;;;;;;;;cAwBxBK,qBAAAA,SAA8BC,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.d.cts","names":["BaseTransformOutputParser","BytesOutputParser","Uint8Array","TextEncoder","InstanceType","Promise"],"sources":["../../src/output_parsers/bytes.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected textEncoder: InstanceType<typeof TextEncoder>;\n parse(text: string): Promise<Uint8Array>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;AAKA;;AAAyEE,cAApDD,iBAAAA,SAA0BD,yBAA0BE,CAAAA,UAAAA,CAAAA,CAAAA;EAAU,OAIpCC,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAW,YAA/BC,EAAAA,MAAAA,EAAAA;EAAY,eACNF,EAAAA,OAAAA;EAAU,UAAlBG,WAAAA,EADED,YACFC,CAAAA,OADsBF,WACtBE,CAAAA;EAAO,KALeL,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAKtBK,OALsBL,CAKdE,UALcF,CAAAA;EAAyB,qBAAA,CAAA,CAAA,EAAA,MAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.d.ts","names":["BaseTransformOutputParser","BytesOutputParser","Uint8Array","TextEncoder","InstanceType","Promise"],"sources":["../../src/output_parsers/bytes.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected textEncoder: InstanceType<typeof TextEncoder>;\n parse(text: string): Promise<Uint8Array>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;AAKA;;AAAyEE,cAApDD,iBAAAA,SAA0BD,yBAA0BE,CAAAA,UAAAA,CAAAA,CAAAA;EAAU,OAIpCC,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAW,YAA/BC,EAAAA,MAAAA,EAAAA;EAAY,eACNF,EAAAA,OAAAA;EAAU,UAAlBG,WAAAA,EADED,YACFC,CAAAA,OADsBF,WACtBE,CAAAA;EAAO,KALeL,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAKtBK,OALsBL,CAKdE,UALcF,CAAAA;EAAyB,qBAAA,CAAA,CAAA,EAAA,MAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.cts","names":["BaseCumulativeTransformOutputParser","Operation","ChatGeneration","Generation","parseJsonMarkdown","parsePartialJson","JsonOutputParser","Record","T","Promise"],"sources":["../../src/output_parsers/json.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport declare class JsonOutputParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /** @internal */\n _concatOutputChunks<T>(first: T, second: T): T;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;\n parse(text: string): Promise<T>;\n getFormatInstructions(): string;\n}\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":";;;;;;;;;AAOA;AAAqC,cAAhBM,gBAAgB;;UAE3BC,MAAsBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAAA,MAAAA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAA6BP,mCAA7BO,CAAiEC,CAAjED,CAAAA,CAAAA;EAAM,OAA2DC,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAC,YAKhEA,EAAAA,MAAAA,EAAAA;EAAC,eAAUA,EAAAA,OAAAA;EAAC;EAAI,mBACaP,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,EAD7BO,CAC6BP,EAAAA,MAAAA,EADlBO,CACkBP,CAAAA,EADdO,CACcP;EAAS,UAGpCC,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAH2BD,SAG3BC,EAAAA,GAAAA,SAAAA;EAAc;EAAe;EAAc,kBAATO,CAAAA,WAAAA,EAAlCP,cAAkCO,EAAAA,GAAfN,UAAeM,EAAAA,CAAAA,EAAAA,OAAAA,CAAQD,CAARC,GAAAA,SAAAA,CAAAA;EAAO,KAC5CD,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAARC,OAAQD,CAAAA,CAAAA,CAAAA;EAAC,qBAATC,CAAAA,CAAAA,EAAAA,MAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","names":["BaseCumulativeTransformOutputParser","Operation","ChatGeneration","Generation","parseJsonMarkdown","parsePartialJson","JsonOutputParser","Record","T","Promise"],"sources":["../../src/output_parsers/json.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport declare class JsonOutputParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /** @internal */\n _concatOutputChunks<T>(first: T, second: T): T;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;\n parse(text: string): Promise<T>;\n getFormatInstructions(): string;\n}\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":";;;;;;;;;AAOA;AAAqC,cAAhBM,gBAAgB;;UAE3BC,MAAsBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAAA,MAAAA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAA6BP,mCAA7BO,CAAiEC,CAAjED,CAAAA,CAAAA;EAAM,OAA2DC,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAC,YAKhEA,EAAAA,MAAAA,EAAAA;EAAC,eAAUA,EAAAA,OAAAA;EAAC;EAAI,mBACaP,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,EAD7BO,CAC6BP,EAAAA,MAAAA,EADlBO,CACkBP,CAAAA,EADdO,CACcP;EAAS,UAGpCC,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAH2BD,SAG3BC,EAAAA,GAAAA,SAAAA;EAAc;EAAe;EAAc,kBAATO,CAAAA,WAAAA,EAAlCP,cAAkCO,EAAAA,GAAfN,UAAeM,EAAAA,CAAAA,EAAAA,OAAAA,CAAQD,CAARC,GAAAA,SAAAA,CAAAA;EAAO,KAC5CD,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAARC,OAAQD,CAAAA,CAAAA,CAAAA;EAAC,qBAATC,CAAAA,CAAAA,EAAAA,MAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.cts","names":["BaseMessage","BaseTransformOutputParser","ListOutputParser","RegExp","AsyncGenerator","CommaSeparatedListOutputParser","Promise","CustomListOutputParser","length","separator","NumberedListOutputParser","MarkdownListOutputParser"],"sources":["../../src/output_parsers/list.d.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport declare abstract class ListOutputParser extends BaseTransformOutputParser<string[]> {\n re?: RegExp;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<string[]>;\n}\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport declare class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport declare class CustomListOutputParser extends ListOutputParser {\n lc_namespace: string[];\n private length;\n private separator;\n constructor({ length, separator }: {\n length?: number;\n separator?: string;\n });\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\nexport declare class NumberedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\nexport declare class MarkdownListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\n"],"mappings":";;;;;;;AAMA;;AACSG,uBADqBD,gBAAAA,SAAyBD,yBAC9CE,CAAAA,MAAAA,EAAAA,CAAAA,CAAAA;EAAM,EAAA,CACwCH,EAD9CG,MAC8CH;EAAW,UAAnCI,CAAAA,cAAAA,EAAAA,cAAAA,CAAAA,MAAAA,GAAwBJ,WAAxBI,CAAAA,CAAAA,EAAuCA,cAAvCA,CAAAA,MAAAA,EAAAA,CAAAA;;;AAFiD;AAQhF;;AAUyBE,cAVJD,8BAAAA,SAAuCH,gBAAAA,CAUnCI;EAAO,OAV4BJ,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAgB,YAAA,EAAA,MAAA,EAAA;EAsBvDK,eAAAA,EAAAA,OAAAA;EAAsB;;;;;AAAyB;EAwB/CG,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EApCIJ,OAoCoB,CAAA,MAAA,EAAA,CAAA;EAAA;;;;AAAyB;EAQjDK,qBAAAA,CAAAA,CAAAA,EAAAA,MAAwB;;;;;AAAyB;cAhCjDJ,sBAAAA,SAA+BL,gBAAAA;;;;;;;;;;;;;;;;;;uBAe3BI;;;;;;;;;cASJI,wBAAAA,SAAiCR,gBAAAA;;;;;MAK9CC;uBACiBG;;cAEJK,wBAAAA,SAAiCT,gBAAAA;;;;;MAK9CC;uBACiBG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","names":["BaseMessage","BaseTransformOutputParser","ListOutputParser","RegExp","AsyncGenerator","CommaSeparatedListOutputParser","Promise","CustomListOutputParser","length","separator","NumberedListOutputParser","MarkdownListOutputParser"],"sources":["../../src/output_parsers/list.d.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport declare abstract class ListOutputParser extends BaseTransformOutputParser<string[]> {\n re?: RegExp;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<string[]>;\n}\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport declare class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport declare class CustomListOutputParser extends ListOutputParser {\n lc_namespace: string[];\n private length;\n private separator;\n constructor({ length, separator }: {\n length?: number;\n separator?: string;\n });\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\nexport declare class NumberedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\nexport declare class MarkdownListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\n"],"mappings":";;;;;;;AAMA;;AACSG,uBADqBD,gBAAAA,SAAyBD,yBAC9CE,CAAAA,MAAAA,EAAAA,CAAAA,CAAAA;EAAM,EAAA,CACwCH,EAD9CG,MAC8CH;EAAW,UAAnCI,CAAAA,cAAAA,EAAAA,cAAAA,CAAAA,MAAAA,GAAwBJ,WAAxBI,CAAAA,CAAAA,EAAuCA,cAAvCA,CAAAA,MAAAA,EAAAA,CAAAA;;;AAFiD;AAQhF;;AAUyBE,cAVJD,8BAAAA,SAAuCH,gBAAAA,CAUnCI;EAAO,OAV4BJ,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAgB,YAAA,EAAA,MAAA,EAAA;EAsBvDK,eAAAA,EAAAA,OAAAA;EAAsB;;;;;AAAyB;EAwB/CG,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EApCIJ,OAoCoB,CAAA,MAAA,EAAA,CAAA;EAAA;;;;AAAyB;EAQjDK,qBAAAA,CAAAA,CAAAA,EAAAA,MAAwB;;;;;AAAyB;cAhCjDJ,sBAAAA,SAA+BL,gBAAAA;;;;;;;;;;;;;;;;;;uBAe3BI;;;;;;;;;cASJI,wBAAAA,SAAiCR,gBAAAA;;;;;MAK9CC;uBACiBG;;cAEJK,wBAAAA,SAAiCT,gBAAAA;;;;;MAK9CC;uBACiBG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_functions_parsers.d.cts","names":["Optional","Generation","ChatGeneration","BaseLLMOutputParser","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","JsonSchema7ObjectType","Operation","JSONPatchOperation","FunctionParameters","OutputFunctionsParser","Promise","JsonOutputFunctionsParser","Record","Output","JsonKeyOutputFunctionsParser","T"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.d.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport { type Operation as JSONPatchOperation } from \"../../utils/json_patch.js\";\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<JsonSchema7ObjectType, \"additionalProperties\">;\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n });\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<string>;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport declare class JsonOutputFunctionsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nOutput extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: OutputFunctionsParser;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n } & BaseCumulativeTransformOutputParserInput);\n protected _diff(prev: unknown | undefined, next: unknown): JSONPatchOperation[] | undefined;\n parsePartialResult(generations: ChatGeneration[]): Promise<Output | undefined>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<Output>;\n parse(text: string): Promise<Output>;\n getFormatInstructions(): string;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport declare class JsonKeyOutputFunctionsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: JsonOutputFunctionsParser<Record<string, any>>;\n attrName: string;\n get lc_aliases(): {\n attrName: string;\n };\n constructor(fields: {\n attrName: string;\n });\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<T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AoCPD,EAAAA,CAAAA,EApC0BU,OAoC1BV,CApCkCa,MAoClCb,GAAAA,SAAAA,CAAAA;EAAU;;;;AAlByC;;2BAXnDA,eAAeC,mBAAmBS,QAAQG;uBAC9CH,QAAQG;;;;;;;;cAQZC;;UAEXF,sBAAsBA,6BAA6BV,oBAAoBa;;;;gBAI/DJ,0BAA0BC;;;;;;;;;;;;;;2BAcfZ,eAAeC,mBAAmBS,QAAQK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_functions_parsers.d.ts","names":["Optional","Generation","ChatGeneration","BaseLLMOutputParser","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","JsonSchema7ObjectType","Operation","JSONPatchOperation","FunctionParameters","OutputFunctionsParser","Promise","JsonOutputFunctionsParser","Record","Output","JsonKeyOutputFunctionsParser","T"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.d.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport { type Operation as JSONPatchOperation } from \"../../utils/json_patch.js\";\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<JsonSchema7ObjectType, \"additionalProperties\">;\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n });\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<string>;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport declare class JsonOutputFunctionsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nOutput extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: OutputFunctionsParser;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n } & BaseCumulativeTransformOutputParserInput);\n protected _diff(prev: unknown | undefined, next: unknown): JSONPatchOperation[] | undefined;\n parsePartialResult(generations: ChatGeneration[]): Promise<Output | undefined>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<Output>;\n parse(text: string): Promise<Output>;\n getFormatInstructions(): string;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport declare class JsonKeyOutputFunctionsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: JsonOutputFunctionsParser<Record<string, any>>;\n attrName: string;\n get lc_aliases(): {\n attrName: string;\n };\n constructor(fields: {\n attrName: string;\n });\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<T>;\n}\n"],"mappings":";;;;;;;;;;;AASA;AAA8B,KAAlBS,kBAAAA,GAAqBT,QAAH,CAAYM,qBAAZ,EAAA,sBAAA,CAAA;;;AAAW;AAKzC;AAA0C,cAArBI,qBAAAA,SAA8BP,mB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QZC;;UAEXF,sBAAsBA,6BAA6BV,oBAAoBa;;;;gBAI/DJ,0BAA0BC;;;;;;;;;;;;;;2BAcfZ,eAAeC,mBAAmBS,QAAQK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_tools_parsers.d.cts","names":["z3","z4","ChatGeneration","ChatGenerationChunk","InvalidToolCall","ToolCall","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","InteropZodType","ParsedToolCall","Record","JsonOutputToolsParserParams","parseToolCall","convertLangChainToolCallToOpenAI","makeInvalidToolCall","JsonOutputToolsParser","T","Promise","JsonOutputKeyToolsParserParamsBase","JsonOutputKeyToolsParserParamsV3","ZodType","JsonOutputKeyToolsParserParamsV4","$ZodType","JsonOutputKeyToolsParserParamsInterop","JsonOutputKeyToolsParserParams","JsonOutputKeyToolsParser"],"sources":["../../../src/output_parsers/openai_tools/json_output_tools_parsers.d.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport { ChatGeneration, ChatGenerationChunk } from \"../../outputs.js\";\nimport { InvalidToolCall, ToolCall } from \"../../messages/tool.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { type InteropZodType } from \"../../utils/types/zod.js\";\nexport type ParsedToolCall = {\n id?: string;\n type: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args: Record<string, any>;\n};\nexport type JsonOutputToolsParserParams = {\n /** Whether to return the tool call id. */\n returnId?: boolean;\n} & BaseCumulativeTransformOutputParserInput;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options: {\n returnId?: boolean;\n partial: true;\n}): ToolCall | undefined;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: false;\n}): ToolCall;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: boolean;\n}): ToolCall | undefined;\nexport declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {\n id: string;\n type: string;\n function: {\n name: string;\n arguments: string;\n };\n};\nexport declare function makeInvalidToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object.\n */\nexport declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n returnId: boolean;\n lc_namespace: string[];\n lc_serializable: boolean;\n constructor(fields?: JsonOutputToolsParserParams);\n protected _diff(): void;\n parse(): Promise<T>;\n parseResult(generations: ChatGeneration[]): Promise<T>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Promise<any>;\n}\ntype JsonOutputKeyToolsParserParamsBase = {\n keyName: string;\n returnSingle?: boolean;\n} & JsonOutputToolsParserParams;\ntype JsonOutputKeyToolsParserParamsV3<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z3.ZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\ntype JsonOutputKeyToolsParserParamsV4<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z4.$ZodType<T, T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParamsInterop<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: InteropZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\n// Use Zod 3 for backwards compatibility\nexport type JsonOutputKeyToolsParserParams<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object if you are\n * expecting only a single tool to be called.\n */\nexport declare class JsonOutputKeyToolsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n returnId: boolean;\n /** The type of tool calls to return. */\n keyName: string;\n /** Whether to return only the first tool call. */\n returnSingle: boolean;\n zodSchema?: InteropZodType<T>;\n constructor(params: JsonOutputKeyToolsParserParamsV3<T>);\n constructor(params: JsonOutputKeyToolsParserParamsV4<T>);\n constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);\n protected _validateResult(result: unknown): Promise<T>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsePartialResult(generations: ChatGeneration[]): Promise<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseResult(generations: ChatGeneration[]): Promise<any>;\n}\nexport {};\n"],"mappings":";;;;;;;;KAMYS,cAAAA;;EAAAA,IAAAA,EAAAA,MAAAA;EAMAE;EAIYC,IAAAA,EANdF,MAMcE,CAAAA,MAAa,EAAA,GAAA,CAAA;CAAA;AAExBF,KANDC,2BAAAA,GAMCD;EAAM;EAGP,QAAA,CAAA,EAAA,OAAA;AACZ,CAAA,GAPIH,wCAOiC;AAAA,iBANbK,aAAAA;;WAWpBP,EATSK,MASTL,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,EAAAA,OAAAA,EAAAA;EAAQ,QAAA,CAAA,EAAA,OAAA;EACYO,OAAAA,EAAAA,IAAAA;CAAa,CAAA,EAPjCP,QAOiC,GAAA,SAAA;AAExBK,iBARWE,aAAAA;;AAWZ,WAAA,EATC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,CAAAA,GAnBPG,gCAmBOH,CAnB0BA,CAmB1BA,CAAAA;;;;;AAGPC,cAjBlCQ,wBAiBkCR;;UAf7CP,MAiBsCO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAjBhBP,MAiBgBO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAjBaF,qBAiBbE,CAjBmCD,CAiBnCC,CAAAA,CAAAA;EAAO,OAjBMF,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAqB,YAAA,EAAA,MAAA,EAAA;;;;;;;cASlEP,eAAeQ;sBACPG,iCAAiCH;sBACjCK,iCAAiCL;sBACjCO,sCAAsCP;8CACdC,QAAQD;;kCAEpBd,mBAAmBe;;2BAE1Bf,mBAAmBe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_tools_parsers.d.ts","names":["z3","z4","ChatGeneration","ChatGenerationChunk","InvalidToolCall","ToolCall","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","InteropZodType","ParsedToolCall","Record","JsonOutputToolsParserParams","parseToolCall","convertLangChainToolCallToOpenAI","makeInvalidToolCall","JsonOutputToolsParser","T","Promise","JsonOutputKeyToolsParserParamsBase","JsonOutputKeyToolsParserParamsV3","ZodType","JsonOutputKeyToolsParserParamsV4","$ZodType","JsonOutputKeyToolsParserParamsInterop","JsonOutputKeyToolsParserParams","JsonOutputKeyToolsParser"],"sources":["../../../src/output_parsers/openai_tools/json_output_tools_parsers.d.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport { ChatGeneration, ChatGenerationChunk } from \"../../outputs.js\";\nimport { InvalidToolCall, ToolCall } from \"../../messages/tool.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { type InteropZodType } from \"../../utils/types/zod.js\";\nexport type ParsedToolCall = {\n id?: string;\n type: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args: Record<string, any>;\n};\nexport type JsonOutputToolsParserParams = {\n /** Whether to return the tool call id. */\n returnId?: boolean;\n} & BaseCumulativeTransformOutputParserInput;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options: {\n returnId?: boolean;\n partial: true;\n}): ToolCall | undefined;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: false;\n}): ToolCall;\nexport declare function parseToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: boolean;\n}): ToolCall | undefined;\nexport declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {\n id: string;\n type: string;\n function: {\n name: string;\n arguments: string;\n };\n};\nexport declare function makeInvalidToolCall(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nrawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object.\n */\nexport declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n returnId: boolean;\n lc_namespace: string[];\n lc_serializable: boolean;\n constructor(fields?: JsonOutputToolsParserParams);\n protected _diff(): void;\n parse(): Promise<T>;\n parseResult(generations: ChatGeneration[]): Promise<T>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Promise<any>;\n}\ntype JsonOutputKeyToolsParserParamsBase = {\n keyName: string;\n returnSingle?: boolean;\n} & JsonOutputToolsParserParams;\ntype JsonOutputKeyToolsParserParamsV3<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z3.ZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\ntype JsonOutputKeyToolsParserParamsV4<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z4.$ZodType<T, T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParamsInterop<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = {\n zodSchema?: InteropZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\n// Use Zod 3 for backwards compatibility\nexport type JsonOutputKeyToolsParserParams<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object if you are\n * expecting only a single tool to be called.\n */\nexport declare class JsonOutputKeyToolsParser<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n returnId: boolean;\n /** The type of tool calls to return. */\n keyName: string;\n /** Whether to return only the first tool call. */\n returnSingle: boolean;\n zodSchema?: InteropZodType<T>;\n constructor(params: JsonOutputKeyToolsParserParamsV3<T>);\n constructor(params: JsonOutputKeyToolsParserParamsV4<T>);\n constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);\n protected _validateResult(result: unknown): Promise<T>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsePartialResult(generations: ChatGeneration[]): Promise<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseResult(generations: ChatGeneration[]): Promise<any>;\n}\nexport {};\n"],"mappings":";;;;;;;;KAMYS,cAAAA;;EAAAA,IAAAA,EAAAA,MAAAA;EAMAE;EAIYC,IAAAA,EANdF,MAMcE,CAAAA,MAAa,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AeoBb;;UAbtBA,MAsBqBM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAtBCN,MAsBDM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAAAA;EAAC,SAAhBR,CAAAA,EArBAA,cAqBAA,CArBeQ,CAqBfR,CAAAA;CAAc,GApB1BU,kCAqBqDF;;AACAA,KApB7CQ,8BAoB6CR;;UAlB/CN,MAmBoDM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAnB9BN,MAmB8BM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAnBPG,gCAmBOH,CAnB0BA,CAmB1BA,CAAAA;;;;;AAGPC,cAjBlCQ,wBAiBkCR;;UAf7CP,MAiBsCO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAjBhBP,MAiBgBO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAjBaF,qBAiBbE,CAjBmCD,CAiBnCC,CAAAA,CAAAA;EAAO,OAjBMF,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAqB,YAAA,EAAA,MAAA,EAAA;;;;;;;cASlEP,eAAeQ;sBACPG,iCAAiCH;sBACjCK,iCAAiCL;sBACjCO,sCAAsCP;8CACdC,QAAQD;;kCAEpBd,mBAAmBe;;2BAE1Bf,mBAAmBe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.cts","names":["BaseTransformOutputParser","ContentBlock","StringOutputParser","Promise","Text","Data","URLContentBlock"],"sources":["../../src/output_parsers/string.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\nimport { ContentBlock } from \"../messages/index.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string.\n * @example\n * ```typescript\n * const promptTemplate = PromptTemplate.fromTemplate(\n * \"Tell me a joke about {topic}\",\n * );\n *\n * const chain = RunnableSequence.from([\n * promptTemplate,\n * new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * new StringOutputParser(),\n * ]);\n *\n * const result = await chain.invoke({ topic: \"bears\" });\n * console.log(\"What do you call a bear with no teeth? A gummy bear!\");\n * ```\n */\nexport declare class StringOutputParser extends BaseTransformOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses a string output from an LLM call. This method is meant to be\n * implemented by subclasses to define how a string output from an LLM\n * should be parsed.\n * @param text The string output from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parse(text: string): Promise<string>;\n getFormatInstructions(): string;\n protected _textContentToString(content: ContentBlock.Text): string;\n protected _imageUrlContentToString(_content: ContentBlock.Data.URLContentBlock): string;\n protected _messageContentToString(content: ContentBlock): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n}\n"],"mappings":";;;;;;;AAoBA;;;;;;;;AAAyE;;;;;;;;cAApDE,kBAAAA,SAA2BF;;;;;;;;;;;;uBAYvBG;;0CAEmBF,YAAAA,CAAaG;+CACRH,YAAAA,CAAaI,IAAAA,CAAKC;6CACpBL;iDACIA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","names":["BaseTransformOutputParser","ContentBlock","StringOutputParser","Promise","Text","Data","URLContentBlock"],"sources":["../../src/output_parsers/string.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\nimport { ContentBlock } from \"../messages/index.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string.\n * @example\n * ```typescript\n * const promptTemplate = PromptTemplate.fromTemplate(\n * \"Tell me a joke about {topic}\",\n * );\n *\n * const chain = RunnableSequence.from([\n * promptTemplate,\n * new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * new StringOutputParser(),\n * ]);\n *\n * const result = await chain.invoke({ topic: \"bears\" });\n * console.log(\"What do you call a bear with no teeth? A gummy bear!\");\n * ```\n */\nexport declare class StringOutputParser extends BaseTransformOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses a string output from an LLM call. This method is meant to be\n * implemented by subclasses to define how a string output from an LLM\n * should be parsed.\n * @param text The string output from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parse(text: string): Promise<string>;\n getFormatInstructions(): string;\n protected _textContentToString(content: ContentBlock.Text): string;\n protected _imageUrlContentToString(_content: ContentBlock.Data.URLContentBlock): string;\n protected _messageContentToString(content: ContentBlock): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n}\n"],"mappings":";;;;;;;AAoBA;;;;;;;;AAAyE;;;;;;;;cAApDE,kBAAAA,SAA2BF;;;;;;;;;;;;uBAYvBG;;0CAEmBF,YAAAA,CAAaG;+CACRH,YAAAA,CAAaI,IAAAA,CAAKC;6CACpBL;iDACIA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structured.d.cts","names":["z","BaseOutputParser","FormatInstructionsOptions","InteropZodType","InferInteropZodOutput","JsonMarkdownStructuredOutputParserInput","JsonMarkdownFormatInstructionsOptions","StructuredOutputParser","T","___load_serializable_js0","SerializedNotImplemented","S","ZodString","ZodTypeAny","ZodObject","Promise","JsonMarkdownStructuredOutputParser","AsymmetricStructuredOutputParserFields","AsymmetricStructuredOutputParser","Y","inputSchema"],"sources":["../../src/output_parsers/structured.d.ts"],"sourcesContent":["import { z } from \"zod/v3\";\nimport { BaseOutputParser, FormatInstructionsOptions } from \"./base.js\";\nimport { type InteropZodType, type InferInteropZodOutput } from \"../utils/types/zod.js\";\nexport type JsonMarkdownStructuredOutputParserInput = {\n interpolationDepth?: number;\n};\nexport interface JsonMarkdownFormatInstructionsOptions extends FormatInstructionsOptions {\n interpolationDepth?: number;\n}\nexport declare class StructuredOutputParser<T extends InteropZodType> extends BaseOutputParser<InferInteropZodOutput<T>> {\n schema: T;\n static lc_name(): string;\n lc_namespace: string[];\n toJSON(): import(\"../load/serializable.js\").SerializedNotImplemented;\n constructor(schema: T);\n /**\n * Creates a new StructuredOutputParser from a Zod schema.\n * @param schema The Zod schema which the output should match\n * @returns A new instance of StructuredOutputParser.\n */\n static fromZodSchema<T extends InteropZodType>(schema: T): StructuredOutputParser<T>;\n /**\n * Creates a new StructuredOutputParser from a set of names and\n * descriptions.\n * @param schemas An object where each key is a name and each value is a description\n * @returns A new instance of StructuredOutputParser.\n */\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): StructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n /**\n * Returns a markdown code snippet with a JSON object formatted according\n * to the schema.\n * @param options Optional. The options for formatting the instructions\n * @returns A markdown code snippet with a JSON object formatted according to the schema.\n */\n getFormatInstructions(): string;\n /**\n * Parses the given text according to the schema.\n * @param text The text to parse\n * @returns The parsed output.\n */\n parse(text: string): Promise<InferInteropZodOutput<T>>;\n}\n/**\n * A specific type of `StructuredOutputParser` that parses JSON data\n * formatted as a markdown code snippet.\n */\nexport declare class JsonMarkdownStructuredOutputParser<T extends InteropZodType> extends StructuredOutputParser<T> {\n static lc_name(): string;\n getFormatInstructions(options?: JsonMarkdownFormatInstructionsOptions): string;\n private _schemaToInstruction;\n static fromZodSchema<T extends InteropZodType>(schema: T): JsonMarkdownStructuredOutputParser<T>;\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): JsonMarkdownStructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n}\nexport interface AsymmetricStructuredOutputParserFields<T extends InteropZodType> {\n inputSchema: T;\n}\n/**\n * A type of `StructuredOutputParser` that handles asymmetric input and\n * output schemas.\n */\nexport declare abstract class AsymmetricStructuredOutputParser<T extends InteropZodType, Y = unknown> extends BaseOutputParser<Y> {\n private structuredInputParser;\n constructor({ inputSchema }: AsymmetricStructuredOutputParserFields<T>);\n /**\n * Processes the parsed input into the desired output format. Must be\n * implemented by subclasses.\n * @param input The parsed input\n * @returns The processed output.\n */\n abstract outputProcessor(input: InferInteropZodOutput<T>): Promise<Y>;\n parse(text: string): Promise<Y>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;KAGYK,uCAAAA;;;AAAAA,UAGKC,qCAAAA,SAA8CJ,yBAHZ,CAAA;EAGlCI,kBAAAA,CAAAA,EAAAA,MAAAA;AAGjB;AAA2C,cAAtBC,sBAAsB,CAAA,UAAWJ,cAAX,CAAA,SAAmCF,gBAAnC,CAAoDG,qBAApD,CAA0EI,CAA1E,CAAA,CAAA,CAAA;EAAA,MAAWL,EAC1CK,CAD0CL;EAAc,OAAiDK,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAC,YAAvBJ,EAAAA,MAAAA,EAAAA;EAAqB,MACxGI,CAAAA,CAAAA,EAAC,wBAADA;EAAC,WAAA,CAAA,MAAA,EAIWA,CAJX;EAG2D;;;;;EAOa,OASrEG,aAAAA,CAAAA,UATmBR,cASnBQ,CAAAA,CAAAA,MAAAA,EAT2CH,CAS3CG,CAAAA,EAT+CJ,sBAS/CI,CATsEH,CAStEG,CAAAA;EAAC;;;;;;EAmBqC,OAA7BI,wBAAAA,CAAAA,UAAAA;IAvCqDd,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAgB,CAAA,CAAA,CAAA,OAAA,EAoB9EU,CApB8E,CAAA,EAoB1EJ,sBApB0E,CAoBnDP,CAAAA,CAAEc,SApBiD,CAAA;IA6CzEE,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAxBAhB,CAAAA,CAAEY,SAwBFI;EAAkC,CAAA,EAAA,OAAA,EAvBvChB,CAAAA,CAAEa,UAuBqC,EAAA;IAAWV,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAc,CAAA,EAAiCK;IAE7EF,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,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AQI;uBAC9CJ,QAAQI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structured.d.ts","names":["z","BaseOutputParser","FormatInstructionsOptions","InteropZodType","InferInteropZodOutput","JsonMarkdownStructuredOutputParserInput","JsonMarkdownFormatInstructionsOptions","StructuredOutputParser","T","___load_serializable_js0","SerializedNotImplemented","S","ZodString","ZodTypeAny","ZodObject","Promise","JsonMarkdownStructuredOutputParser","AsymmetricStructuredOutputParserFields","AsymmetricStructuredOutputParser","Y","inputSchema"],"sources":["../../src/output_parsers/structured.d.ts"],"sourcesContent":["import { z } from \"zod/v3\";\nimport { BaseOutputParser, FormatInstructionsOptions } from \"./base.js\";\nimport { type InteropZodType, type InferInteropZodOutput } from \"../utils/types/zod.js\";\nexport type JsonMarkdownStructuredOutputParserInput = {\n interpolationDepth?: number;\n};\nexport interface JsonMarkdownFormatInstructionsOptions extends FormatInstructionsOptions {\n interpolationDepth?: number;\n}\nexport declare class StructuredOutputParser<T extends InteropZodType> extends BaseOutputParser<InferInteropZodOutput<T>> {\n schema: T;\n static lc_name(): string;\n lc_namespace: string[];\n toJSON(): import(\"../load/serializable.js\").SerializedNotImplemented;\n constructor(schema: T);\n /**\n * Creates a new StructuredOutputParser from a Zod schema.\n * @param schema The Zod schema which the output should match\n * @returns A new instance of StructuredOutputParser.\n */\n static fromZodSchema<T extends InteropZodType>(schema: T): StructuredOutputParser<T>;\n /**\n * Creates a new StructuredOutputParser from a set of names and\n * descriptions.\n * @param schemas An object where each key is a name and each value is a description\n * @returns A new instance of StructuredOutputParser.\n */\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): StructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n /**\n * Returns a markdown code snippet with a JSON object formatted according\n * to the schema.\n * @param options Optional. The options for formatting the instructions\n * @returns A markdown code snippet with a JSON object formatted according to the schema.\n */\n getFormatInstructions(): string;\n /**\n * Parses the given text according to the schema.\n * @param text The text to parse\n * @returns The parsed output.\n */\n parse(text: string): Promise<InferInteropZodOutput<T>>;\n}\n/**\n * A specific type of `StructuredOutputParser` that parses JSON data\n * formatted as a markdown code snippet.\n */\nexport declare class JsonMarkdownStructuredOutputParser<T extends InteropZodType> extends StructuredOutputParser<T> {\n static lc_name(): string;\n getFormatInstructions(options?: JsonMarkdownFormatInstructionsOptions): string;\n private _schemaToInstruction;\n static fromZodSchema<T extends InteropZodType>(schema: T): JsonMarkdownStructuredOutputParser<T>;\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): JsonMarkdownStructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n}\nexport interface AsymmetricStructuredOutputParserFields<T extends InteropZodType> {\n inputSchema: T;\n}\n/**\n * A type of `StructuredOutputParser` that handles asymmetric input and\n * output schemas.\n */\nexport declare abstract class AsymmetricStructuredOutputParser<T extends InteropZodType, Y = unknown> extends BaseOutputParser<Y> {\n private structuredInputParser;\n constructor({ inputSchema }: AsymmetricStructuredOutputParserFields<T>);\n /**\n * Processes the parsed input into the desired output format. Must be\n * implemented by subclasses.\n * @param input The parsed input\n * @returns The processed output.\n */\n abstract outputProcessor(input: InferInteropZodOutput<T>): Promise<Y>;\n parse(text: string): Promise<Y>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;KAGYK,uCAAAA;;;AAAAA,UAGKC,qCAAAA,SAA8CJ,yBAHZ,CAAA;EAGlCI,kBAAAA,CAAAA,EAAAA,MAAAA;AAGjB;AAA2C,cAAtBC,sBAAsB,CAAA,UAAWJ,cAAX,CAAA,SAAmCF,gBAAnC,CAAoDG,qBAApD,CAA0EI,CAA1E,CAAA,CAAA,CAAA;EAAA,MAAWL,EAC1CK,CAD0CL;EAAc,OAAiDK,OAAAA,CAAAA,CAAAA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CF,qCAsBoCE,CAAAA,EAAAA,MAAAA;EAAC,QAAxCS,oBAAAA;EAAsC,OAObT,aAAAA,CAAAA,UA3BvBL,cA2BuBK,CAAAA,CAAAA,MAAAA,EA3BCA,CA2BDA,CAAAA,EA3BKQ,kCA2BLR,CA3BwCA,CA2BxCA,CAAAA;EAAC,OAAvBJ,wBAAAA,CAAAA,UAAAA;IAAmCe,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAC,CAAA,CAAA,CAATJ,OAAAA,EAxB/CJ,CAwB+CI,CAAAA,EAxB3CC,kCAwB2CD,CAxBRf,CAAAA,CAAEc,SAwBMC,CAAAA;IAC9BI,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAxBZnB,CAAAA,CAAEY,SAwBUO;EAAC,CAAA,EAATJ,OAAAA,EAvBTf,CAAAA,CAAEa,UAuBOE,EAAAA;IAVqFd,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAgB,CAAA,EAAA;;;;UAP7GgB,iDAAiDd;eACjDK;;;;;;uBAMaU,2CAA2Cf,qCAAqCF,iBAAiBkB;;;;KAE9FF,uCAAuCT;;;;;;;kCAOpCJ,sBAAsBI,KAAKO,QAAQI;uBAC9CJ,QAAQI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.cts","names":["BaseOutputParser","BaseMessage","BaseCallbackConfig","Generation","ChatGeneration","BaseTransformOutputParser","T","AsyncGenerator","BaseCumulativeTransformOutputParserInput","BaseCumulativeTransformOutputParser","Promise"],"sources":["../../src/output_parsers/transform.d.ts"],"sourcesContent":["import { BaseOutputParser } from \"./base.js\";\nimport { type BaseMessage } from \"../messages/base.js\";\nimport type { BaseCallbackConfig } from \"../callbacks/manager.js\";\nimport { type Generation, type ChatGeneration } from \"../outputs.js\";\n/**\n * Class to parse the output of an LLM call that also allows streaming inputs.\n */\nexport declare abstract class BaseTransformOutputParser<T = unknown> extends BaseOutputParser<T> {\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n /**\n * Transforms an asynchronous generator of input into an asynchronous\n * generator of parsed output.\n * @param inputGenerator An asynchronous generator of input.\n * @param options A configuration object.\n * @returns An asynchronous generator of parsed output.\n */\n transform(inputGenerator: AsyncGenerator<string | BaseMessage>, options: BaseCallbackConfig): AsyncGenerator<T>;\n}\nexport type BaseCumulativeTransformOutputParserInput = {\n diff?: boolean;\n};\n/**\n * A base class for output parsers that can handle streaming input. It\n * extends the `BaseTransformOutputParser` class and provides a method for\n * converting parsed outputs into a diff format.\n */\nexport declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {\n protected diff: boolean;\n constructor(fields?: BaseCumulativeTransformOutputParserInput);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected abstract _diff(prev: any | undefined, next: any): any;\n abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;;;;AAOA;AAAuD,uBAAzBK,yBAAyB,CAAA,IAAA,OAAA,CAAA,SAAsBL,gBAAtB,CAAuCM,CAAvC,CAAA,CAAA;EAAA,UAAuCA,CAAAA,cAAAA,EAC/DC,cAD+DD,CAAAA,MAAAA,GACvCL,WADuCK,CAAAA,CAAAA,EACxBC,cADwBD,CACTA,CADSA,CAAAA;EAAC;;;;;;;EASA,SAAkBA,CAAAA,cAAAA,EAAnFC,cAAmFD,CAAAA,MAAAA,GAA3DL,WAA2DK,CAAAA,EAAAA,OAAAA,EAApCJ,kBAAoCI,CAAAA,EAAfC,cAAeD,CAAAA,CAAAA,CAAAA;;AATpCN,KAWjEQ,wCAAAA,GAXiER;EAAgB,IAAA,CAAA,EAAA,OAAA;AAW7F,CAAA;AAQA;;;;;AAK4DI,uBAL9BK,mCAK8BL,CAAAA,IAAAA,OAAAA,CAAAA,SAL2BC,yBAK3BD,CALqDE,CAKrDF,CAAAA,CAAAA;EAAc,UAAaE,IAAAA,EAAAA,OAAAA;EAAC,WAATI,CAAAA,MAAAA,CAAAA,EAHtDF,wCAGsDE;EAAO;EACpB,mBAAnCH,KAAAA,CAAAA,IAAAA,EAAAA,GAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,GAAAA,CAAAA,EAAAA,GAAAA;EAAc,SAAwCD,kBAAAA,CAAAA,WAAAA,EADxCH,UACwCG,EAAAA,GADzBF,cACyBE,EAAAA,CAAAA,EADNI,OACMJ,CADEA,CACFA,GAAAA,SAAAA,CAAAA;EAAC,UAAhBC,CAAAA,cAAAA,EAAvCA,cAAuCA,CAAAA,MAAAA,GAAfN,WAAeM,CAAAA,CAAAA,EAAAA,cAAAA,CAAeD,CAAfC,CAAAA;EAAc,qBANGF,CAAAA,CAAAA,EAAAA,MAAAA;AAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","names":["BaseOutputParser","BaseMessage","BaseCallbackConfig","Generation","ChatGeneration","BaseTransformOutputParser","T","AsyncGenerator","BaseCumulativeTransformOutputParserInput","BaseCumulativeTransformOutputParser","Promise"],"sources":["../../src/output_parsers/transform.d.ts"],"sourcesContent":["import { BaseOutputParser } from \"./base.js\";\nimport { type BaseMessage } from \"../messages/base.js\";\nimport type { BaseCallbackConfig } from \"../callbacks/manager.js\";\nimport { type Generation, type ChatGeneration } from \"../outputs.js\";\n/**\n * Class to parse the output of an LLM call that also allows streaming inputs.\n */\nexport declare abstract class BaseTransformOutputParser<T = unknown> extends BaseOutputParser<T> {\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n /**\n * Transforms an asynchronous generator of input into an asynchronous\n * generator of parsed output.\n * @param inputGenerator An asynchronous generator of input.\n * @param options A configuration object.\n * @returns An asynchronous generator of parsed output.\n */\n transform(inputGenerator: AsyncGenerator<string | BaseMessage>, options: BaseCallbackConfig): AsyncGenerator<T>;\n}\nexport type BaseCumulativeTransformOutputParserInput = {\n diff?: boolean;\n};\n/**\n * A base class for output parsers that can handle streaming input. It\n * extends the `BaseTransformOutputParser` class and provides a method for\n * converting parsed outputs into a diff format.\n */\nexport declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {\n protected diff: boolean;\n constructor(fields?: BaseCumulativeTransformOutputParserInput);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected abstract _diff(prev: any | undefined, next: any): any;\n abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n getFormatInstructions(): string;\n}\n"],"mappings":";;;;;;;;;AAOA;AAAuD,uBAAzBK,yBAAyB,CAAA,IAAA,OAAA,CAAA,SAAsBL,gBAAtB,CAAuCM,CAAvC,CAAA,CAAA;EAAA,UAAuCA,CAAAA,cAAAA,EAC/DC,cAD+DD,CAAAA,MAAAA,GACvCL,WADuCK,CAAAA,CAAAA,EACxBC,cADwBD,CACTA,CADSA,CAAAA;EAAC;;;;;;;EASA,SAAkBA,CAAAA,cAAAA,EAAnFC,cAAmFD,CAAAA,MAAAA,GAA3DL,WAA2DK,CAAAA,EAAAA,OAAAA,EAApCJ,kBAAoCI,CAAAA,EAAfC,cAAeD,CAAAA,CAAAA,CAAAA;;AATpCN,KAWjEQ,wCAAAA,GAXiER;EAAgB,IAAA,CAAA,EAAA,OAAA;AAW7F,CAAA;AAQA;;;;;AAK4DI,uBAL9BK,mCAK8BL,CAAAA,IAAAA,OAAAA,CAAAA,SAL2BC,yBAK3BD,CALqDE,CAKrDF,CAAAA,CAAAA;EAAc,UAAaE,IAAAA,EAAAA,OAAAA;EAAC,WAATI,CAAAA,MAAAA,CAAAA,EAHtDF,wCAGsDE;EAAO;EACpB,mBAAnCH,KAAAA,CAAAA,IAAAA,EAAAA,GAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,GAAAA,CAAAA,EAAAA,GAAAA;EAAc,SAAwCD,kBAAAA,CAAAA,WAAAA,EADxCH,UACwCG,EAAAA,GADzBF,cACyBE,EAAAA,CAAAA,EADNI,OACMJ,CADEA,CACFA,GAAAA,SAAAA,CAAAA;EAAC,UAAhBC,CAAAA,cAAAA,EAAvCA,cAAuCA,CAAAA,MAAAA,GAAfN,WAAeM,CAAAA,CAAAA,EAAAA,cAAAA,CAAeD,CAAfC,CAAAA;EAAc,qBANGF,CAAAA,CAAAA,EAAAA,MAAAA;AAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xml.d.cts","names":["BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","Operation","ChatGeneration","Generation","XML_FORMAT_INSTRUCTIONS","XMLOutputParserFields","Content","Array","XMLResult","XMLOutputParser","Promise","parseXMLMarkdown"],"sources":["../../src/output_parsers/xml.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nexport declare const XML_FORMAT_INSTRUCTIONS = \"The output should be formatted as a XML file.\\n1. Output should conform to the tags below. \\n2. If tags are not given, make them on your own.\\n3. Remember to always open and close all the tags.\\n\\nAs an example, for the tags [\\\"foo\\\", \\\"bar\\\", \\\"baz\\\"]:\\n1. String \\\"<foo>\\n <bar>\\n <baz></baz>\\n </bar>\\n</foo>\\\" is a well-formatted instance of the schema. \\n2. String \\\"<foo>\\n <bar>\\n </foo>\\\" is a badly-formatted instance.\\n3. String \\\"<foo>\\n <tag>\\n </tag>\\n</foo>\\\" is a badly-formatted instance.\\n\\nHere are the output tags:\\n```\\n{tags}\\n```\";\nexport interface XMLOutputParserFields extends BaseCumulativeTransformOutputParserInput {\n /**\n * Optional list of tags that the output should conform to.\n * Only used in formatting of the prompt.\n */\n tags?: string[];\n}\nexport type Content = string | undefined | Array<{\n [key: string]: Content;\n}>;\nexport type XMLResult = {\n [key: string]: Content;\n};\nexport declare class XMLOutputParser extends BaseCumulativeTransformOutputParser<XMLResult> {\n tags?: string[];\n constructor(fields?: XMLOutputParserFields);\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<XMLResult | undefined>;\n parse(text: string): Promise<XMLResult>;\n getFormatInstructions(): string;\n}\nexport declare function parseXMLMarkdown(s: string): XMLResult;\n"],"mappings":";;;;;cAGqBK,uBAAAA;UACJC,qBAAAA,SAA8BL;EAD1BI;AACrB;AAOA;;EAAmB,IACAE,CAAAA,EAAAA,MAAAA,EAAAA;;AAD6B,KAApCA,OAAAA,GAAoC,MAAA,GAAA,SAAA,GAALC,KAAK,CAAA;EAGpCC,CAAAA,GAAAA,EAAAA,MAAS,CAAA,EAFFF,OAEE;AAGrB,CAAA,CAAA;AAAoC,KAHxBE,SAAAA,GAGwB;EAAA,CAAA,GAA6CA,EAAAA,MAAAA,CAAAA,EAF9DF,OAE8DE;CAAS;AAM3BP,cAN1CQ,eAAAA,SAAwBV,mCAMkBE,CANkBO,SAMlBP,CAAAA,CAAAA;EAAS,IACpCC,CAAAA,EAAAA,MAAAA,EAAAA;EAAc,WAAKC,CAAAA,MAAAA,CAAAA,EAL9BE,qBAK8BF;EAAU,OAAaK,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAS,YAAjBE,EAAAA,MAAAA,EAAAA;EAAO,eAC5CF,EAAAA,OAAAA;EAAS,UAAjBE,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAFsCT,SAEtCS,EAAAA,GAAAA,SAAAA;EAAO,kBARaX,CAAAA,WAAAA,EAOTG,cAPSH,EAAAA,GAOUI,UAPVJ,EAAAA,CAAAA,EAOyBW,OAPzBX,CAOiCS,SAPjCT,GAAAA,SAAAA,CAAAA;EAAmC,KAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAQvDW,OARuD,CAQ/CF,SAR+C,CAAA;EAWxDG,qBAAgB,CAAA,CAAA,EAAA,MAAaH;;iBAA7BG,gBAAAA,aAA6BH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xml.d.ts","names":["BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","Operation","ChatGeneration","Generation","XML_FORMAT_INSTRUCTIONS","XMLOutputParserFields","Content","Array","XMLResult","XMLOutputParser","Promise","parseXMLMarkdown"],"sources":["../../src/output_parsers/xml.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nexport declare const XML_FORMAT_INSTRUCTIONS = \"The output should be formatted as a XML file.\\n1. Output should conform to the tags below. \\n2. If tags are not given, make them on your own.\\n3. Remember to always open and close all the tags.\\n\\nAs an example, for the tags [\\\"foo\\\", \\\"bar\\\", \\\"baz\\\"]:\\n1. String \\\"<foo>\\n <bar>\\n <baz></baz>\\n </bar>\\n</foo>\\\" is a well-formatted instance of the schema. \\n2. String \\\"<foo>\\n <bar>\\n </foo>\\\" is a badly-formatted instance.\\n3. String \\\"<foo>\\n <tag>\\n </tag>\\n</foo>\\\" is a badly-formatted instance.\\n\\nHere are the output tags:\\n```\\n{tags}\\n```\";\nexport interface XMLOutputParserFields extends BaseCumulativeTransformOutputParserInput {\n /**\n * Optional list of tags that the output should conform to.\n * Only used in formatting of the prompt.\n */\n tags?: string[];\n}\nexport type Content = string | undefined | Array<{\n [key: string]: Content;\n}>;\nexport type XMLResult = {\n [key: string]: Content;\n};\nexport declare class XMLOutputParser extends BaseCumulativeTransformOutputParser<XMLResult> {\n tags?: string[];\n constructor(fields?: XMLOutputParserFields);\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<XMLResult | undefined>;\n parse(text: string): Promise<XMLResult>;\n getFormatInstructions(): string;\n}\nexport declare function parseXMLMarkdown(s: string): XMLResult;\n"],"mappings":";;;;;cAGqBK,uBAAAA;UACJC,qBAAAA,SAA8BL;EAD1BI;AACrB;AAOA;;EAAmB,IACAE,CAAAA,EAAAA,MAAAA,EAAAA;;AAD6B,KAApCA,OAAAA,GAAoC,MAAA,GAAA,SAAA,GAALC,KAAK,CAAA;EAGpCC,CAAAA,GAAAA,EAAAA,MAAS,CAAA,EAFFF,OAEE;AAGrB,CAAA,CAAA;AAAoC,KAHxBE,SAAAA,GAGwB;EAAA,CAAA,GAA6CA,EAAAA,MAAAA,CAAAA,EAF9DF,OAE8DE;CAAS;AAM3BP,cAN1CQ,eAAAA,SAAwBV,mCAMkBE,CANkBO,SAMlBP,CAAAA,CAAAA;EAAS,IACpCC,CAAAA,EAAAA,MAAAA,EAAAA;EAAc,WAAKC,CAAAA,MAAAA,CAAAA,EAL9BE,qBAK8BF;EAAU,OAAaK,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAS,YAAjBE,EAAAA,MAAAA,EAAAA;EAAO,eAC5CF,EAAAA,OAAAA;EAAS,UAAjBE,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAFsCT,SAEtCS,EAAAA,GAAAA,SAAAA;EAAO,kBARaX,CAAAA,WAAAA,EAOTG,cAPSH,EAAAA,GAOUI,UAPVJ,EAAAA,CAAAA,EAOyBW,OAPzBX,CAOiCS,SAPjCT,GAAAA,SAAAA,CAAAA;EAAmC,KAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAQvDW,OARuD,CAQ/CF,SAR+C,CAAA;EAWxDG,qBAAgB,CAAA,CAAA,EAAA,MAAaH;;iBAA7BG,gBAAAA,aAA6BH"}
|
package/dist/outputs.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.d.cts","names":["BaseMessage","BaseMessageChunk","RUN_KEY","Generation","Record","GenerationChunkFields","GenerationChunk","LLMResult","ChatGeneration","ChatGenerationChunkFields","ChatGenerationChunk","ChatResult"],"sources":["../src/outputs.d.ts"],"sourcesContent":["import { type BaseMessage, type BaseMessageChunk } from \"./messages/base.js\";\nexport declare const RUN_KEY = \"__run\";\n/**\n * Output of a single generation.\n */\nexport interface Generation {\n /**\n * Generated text output\n */\n text: string;\n /**\n * Raw generation info response from the provider.\n * May include things like reason for finishing (e.g. in {@link OpenAI})\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n}\nexport type GenerationChunkFields = {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n};\n/**\n * Chunk of a single generation. Used for streaming.\n */\nexport declare class GenerationChunk implements Generation {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n constructor(fields: GenerationChunkFields);\n concat(chunk: GenerationChunk): GenerationChunk;\n}\n/**\n * Contains all relevant information returned by an LLM.\n */\nexport type LLMResult = {\n /**\n * List of the things generated. Each input could have multiple {@link Generation | generations}, hence this is a list of lists.\n */\n generations: Generation[][];\n /**\n * Dictionary of arbitrary LLM-provider specific output.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n /**\n * Dictionary of run metadata\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [RUN_KEY]?: Record<string, any>;\n};\nexport interface ChatGeneration extends Generation {\n message: BaseMessage;\n}\nexport type ChatGenerationChunkFields = GenerationChunkFields & {\n message: BaseMessageChunk;\n};\nexport declare class ChatGenerationChunk extends GenerationChunk implements ChatGeneration {\n message: BaseMessageChunk;\n constructor(fields: ChatGenerationChunkFields);\n concat(chunk: ChatGenerationChunk): ChatGenerationChunk;\n}\nexport interface ChatResult {\n generations: ChatGeneration[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n}\n"],"mappings":";;;cACqBE,OAAAA;;AAArB;AAIA;AAYYG,UAZKF,UAAAA,CAYgB;EAQZG;;;EAGM,IACHD,EAAAA,MAAAA;EAAqB;;;AAJa;EAU9CE;EAAS,cAAA,CAAA,EApBAH,MAoBA,CAAA,MAAA,EAAA,GAAA,CAAA;;AASLA,KA3BJC,qBAAAA,GA2BID;EAAM,IAKNA,EAAAA,MAAAA;EAAM;EAAV,cAAA,CAAA,EA7BSA,MA6BT,CAAA,MAAA,EAAA,GAAA,CAAA;AAEZ,CAAA;;;;AAAkD,cA1B7BE,eAAAA,YAA2BH,UA0BE,CAAA;EAGtCM,IAAAA,EAAAA,MAAAA;EAAyB;EAAA,cAAGJ,CAAAA,EA1BnBD,MA0BmBC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAqB,WAChDJ,CAAAA,MAAAA,EA1BWI,qBA0BXJ;EAAgB,MAAA,CAAA,KAAA,EAzBXK,eAyBW,CAAA,EAzBOA,eAyBP;AAE7B;;;;AAGkBI,KAzBNH,SAAAA,GAyBMG;EAAmB;;;EAHqD,WAAA,EAlBzEP,UAkByE,EAAA,EAAA;EAKzEQ;;;EACc;EAET,SAAA,CAAA,EArBNP,MAqBM,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;GAhBjBF,OAAAA,IAAWE;;UAECI,cAAAA,SAAuBL;WAC3BH;;KAEDS,yBAAAA,GAA4BJ;WAC3BJ;;cAEQS,mBAAAA,SAA4BJ,eAAAA,YAA2BE;WAC/DP;sBACWQ;gBACNC,sBAAsBA;;UAEvBC,UAAAA;eACAH;;cAEDJ"}
|
package/dist/outputs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.d.ts","names":["BaseMessage","BaseMessageChunk","RUN_KEY","Generation","Record","GenerationChunkFields","GenerationChunk","LLMResult","ChatGeneration","ChatGenerationChunkFields","ChatGenerationChunk","ChatResult"],"sources":["../src/outputs.d.ts"],"sourcesContent":["import { type BaseMessage, type BaseMessageChunk } from \"./messages/base.js\";\nexport declare const RUN_KEY = \"__run\";\n/**\n * Output of a single generation.\n */\nexport interface Generation {\n /**\n * Generated text output\n */\n text: string;\n /**\n * Raw generation info response from the provider.\n * May include things like reason for finishing (e.g. in {@link OpenAI})\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n}\nexport type GenerationChunkFields = {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n};\n/**\n * Chunk of a single generation. Used for streaming.\n */\nexport declare class GenerationChunk implements Generation {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n constructor(fields: GenerationChunkFields);\n concat(chunk: GenerationChunk): GenerationChunk;\n}\n/**\n * Contains all relevant information returned by an LLM.\n */\nexport type LLMResult = {\n /**\n * List of the things generated. Each input could have multiple {@link Generation | generations}, hence this is a list of lists.\n */\n generations: Generation[][];\n /**\n * Dictionary of arbitrary LLM-provider specific output.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n /**\n * Dictionary of run metadata\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [RUN_KEY]?: Record<string, any>;\n};\nexport interface ChatGeneration extends Generation {\n message: BaseMessage;\n}\nexport type ChatGenerationChunkFields = GenerationChunkFields & {\n message: BaseMessageChunk;\n};\nexport declare class ChatGenerationChunk extends GenerationChunk implements ChatGeneration {\n message: BaseMessageChunk;\n constructor(fields: ChatGenerationChunkFields);\n concat(chunk: ChatGenerationChunk): ChatGenerationChunk;\n}\nexport interface ChatResult {\n generations: ChatGeneration[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n}\n"],"mappings":";;;cACqBE,OAAAA;;AAArB;AAIA;AAYYG,UAZKF,UAAAA,CAYgB;EAQZG;;;EAGM,IACHD,EAAAA,MAAAA;EAAqB;;;AAJa;EAU9CE;EAAS,cAAA,CAAA,EApBAH,MAoBA,CAAA,MAAA,EAAA,GAAA,CAAA;;AASLA,KA3BJC,qBAAAA,GA2BID;EAAM,IAKNA,EAAAA,MAAAA;EAAM;EAAV,cAAA,CAAA,EA7BSA,MA6BT,CAAA,MAAA,EAAA,GAAA,CAAA;AAEZ,CAAA;;;;AAAkD,cA1B7BE,eAAAA,YAA2BH,UA0BE,CAAA;EAGtCM,IAAAA,EAAAA,MAAAA;EAAyB;EAAA,cAAGJ,CAAAA,EA1BnBD,MA0BmBC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAqB,WAChDJ,CAAAA,MAAAA,EA1BWI,qBA0BXJ;EAAgB,MAAA,CAAA,KAAA,EAzBXK,eAyBW,CAAA,EAzBOA,eAyBP;AAE7B;;;;AAGkBI,KAzBNH,SAAAA,GAyBMG;EAAmB;;;EAHqD,WAAA,EAlBzEP,UAkByE,EAAA,EAAA;EAKzEQ;;;EACc;EAET,SAAA,CAAA,EArBNP,MAqBM,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;GAhBjBF,OAAAA,IAAWE;;UAECI,cAAAA,SAAuBL;WAC3BH;;KAEDS,yBAAAA,GAA4BJ;WAC3BJ;;cAEQS,mBAAAA,SAA4BJ,eAAAA,YAA2BE;WAC/DP;sBACWQ;gBACNC,sBAAsBA;;UAEvBC,UAAAA;eACAH;;cAEDJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt_values.d.cts","names":["Serializable","BaseMessage","HumanMessage","BasePromptValueInterface","StringPromptValueInterface","ChatPromptValueInterface","BasePromptValue","StringPromptValue","__messages_message_js0","MessageStructure","ChatPromptValueFields","ChatPromptValue","MessageType","ImageContent","ImagePromptValueFields","ImagePromptValue"],"sources":["../src/prompt_values.d.ts"],"sourcesContent":["import { Serializable } from \"./load/serializable.js\";\nimport { type BaseMessage } from \"./messages/base.js\";\nimport { HumanMessage } from \"./messages/human.js\";\nexport interface BasePromptValueInterface extends Serializable {\n toString(): string;\n toChatMessages(): BaseMessage[];\n}\nexport interface StringPromptValueInterface extends BasePromptValueInterface {\n value: string;\n}\nexport interface ChatPromptValueInterface extends BasePromptValueInterface {\n messages: BaseMessage[];\n}\n/**\n * Base PromptValue class. All prompt values should extend this class.\n */\nexport declare abstract class BasePromptValue extends Serializable implements BasePromptValueInterface {\n abstract toString(): string;\n abstract toChatMessages(): BaseMessage[];\n}\n/**\n * Represents a prompt value as a string. It extends the BasePromptValue\n * class and overrides the toString and toChatMessages methods.\n */\nexport declare class StringPromptValue extends BasePromptValue implements StringPromptValueInterface {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n value: string;\n constructor(value: string);\n toString(): string;\n toChatMessages(): HumanMessage<import(\"./messages/message.js\").MessageStructure>[];\n}\n/**\n * Interface for the fields of a ChatPromptValue.\n */\nexport interface ChatPromptValueFields {\n messages: BaseMessage[];\n}\n/**\n * Class that represents a chat prompt value. It extends the\n * BasePromptValue and includes an array of BaseMessage instances.\n */\nexport declare class ChatPromptValue extends BasePromptValue implements ChatPromptValueInterface {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n messages: BaseMessage[];\n constructor(messages: BaseMessage[]);\n constructor(fields: ChatPromptValueFields);\n toString(): string;\n toChatMessages(): BaseMessage<import(\"./messages/message.js\").MessageStructure, import(\"./messages/message.js\").MessageType>[];\n}\nexport type ImageContent = {\n /** Specifies the detail level of the image. */\n detail?: \"auto\" | \"low\" | \"high\";\n /** Either a URL of the image or the base64 encoded image data. */\n url: string;\n};\nexport interface ImagePromptValueFields {\n imageUrl: ImageContent;\n}\n/**\n * Class that represents an image prompt value. It extends the\n * BasePromptValue and includes an ImageURL instance.\n */\nexport declare class ImagePromptValue extends BasePromptValue {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n imageUrl: ImageContent;\n /** @ignore */\n value: string;\n constructor(fields: ImagePromptValueFields);\n constructor(fields: ImageContent);\n toString(): string;\n toChatMessages(): HumanMessage<import(\"./messages/message.js\").MessageStructure>[];\n}\n"],"mappings":";;;;;;UAGiBG,wBAAAA,SAAiCH;;oBAE5BC;AAFtB;AAAyC,UAIxBG,0BAAAA,SAAmCD,wBAJX,CAAA;EAAA,KAEnBF,EAAAA,MAAAA;;AAFwC,UAO7CI,wBAAAA,SAAiCF,wBAPY,CAAA;EAI7CC,QAAAA,EAIHH,WAJGG,EAAAA;AAGjB;;;;AAA0E,uBAM5CE,eAAAA,SAAwBN,YAAAA,YAAwBG,wBANJ,CAAA;EAM5CG,SAAAA,QAAAA,CAAAA,CAAe,EAAA,MAAA;EAAA,SAAA,cAAA,CAAA,CAAA,EAEdL,WAFc,EAAA;;;;AAAyD;AAQtG;AAAsC,cAAjBM,iBAAAA,SAA0BD,eAAAA,YAA2BF,0BAApC,CAAA;EAAA,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EAO6C,YAA7DF,EAAAA,MAAAA,EAAAA;EAAY,eAPaI,EAAAA,OAAAA;EAAe,KAAYF,EAAAA,MAAAA;EAA0B,WAAA,CAAA,KAAA,EAAA,MAAA;EAYnFM,QAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAOIC,cAAAA,CAAAA,CAAAA,EAZCT,YAYc,CAnBE,gBAAA,CAmBF,EAAA;;;;;AAMS,UAb5BQ,qBAAAA,CAa4B;EAEqC,QAAA,EAdpET,WAcoE,EAAA;;;;AARc;AAUhG;AAMiBa,cAhBIH,eAAAA,SAAwBL,eAAAA,YAA2BD,wBAiB9C,CAAA;EAMLU,YAAAA,EAAAA,MAAgB,EAAA;EAAA,eAAA,EAAA,OAAA;EAAA,OAIvBF,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAY,Q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